TheChess
|
00001 /* 00002 * thechess, chess game web application written in C++ and based on Wt 00003 * Copyright (C) 2010 Boris Nagaev 00004 * 00005 * thechess is licensed under the GNU GPL Version 2. 00006 * Other versions of the GPL do not apply. 00007 * See the LICENSE file for terms of use. 00008 */ 00009 00010 #ifndef THECHESS_WIDGETS_COMPETITION_PARAMETERS_WIDGET_HPP_ 00011 #define THECHESS_WIDGETS_COMPETITION_PARAMETERS_WIDGET_HPP_ 00012 00013 #include <Wt/WContainerWidget> 00014 #include <Wt/WComboBox> 00015 #include <Wt/WCheckBox> 00016 #include <Wt/WTextEdit> 00017 00018 #include "widgets/GameParametersWidget.hpp" 00019 #include "model/CompetitionParameters.hpp" 00020 #include "model/Competition.hpp" 00021 00022 namespace thechess { 00023 namespace widgets { 00024 00025 class MySpinBox; 00026 class MyDoubleSpinBox; 00027 class TimeDeltaWidget; 00028 class ClassificationWidget; 00029 class IntervalWidget; 00030 00031 class CompetitionParametersWidget : public GameParametersWidget { 00032 public: 00033 CompetitionParametersWidget(const model::CompetitionParameters* cp, 00034 bool allow_change_type=true, Wt::WContainerWidget* parent=0); 00035 00036 void apply_parameters(model::CompetitionParameters* cp); 00037 00038 private: 00039 Wt::WComboBox* type_; 00040 MySpinBox* min_rating_; 00041 MySpinBox* max_rating_; 00042 ClassificationWidget* min_classification_; 00043 ClassificationWidget* max_classification_; 00044 00045 TimeDeltaWidget* force_start_delay_; 00046 00047 MySpinBox* min_users_; 00048 MySpinBox* max_users_; 00049 IntervalWidget* users_; 00050 TimeDeltaWidget* min_recruiting_time_; 00051 TimeDeltaWidget* max_recruiting_time_; 00052 IntervalWidget* recruiting_time_; 00053 00054 MySpinBox* max_simultaneous_games_; 00055 MyDoubleSpinBox* games_factor_; 00056 00057 TimeDeltaWidget* relax_time_; 00058 MySpinBox* min_substages_; 00059 MySpinBox* increment_substages_; 00060 00061 void type_handler_(); 00062 model::CompetitionType get_type_() const; 00063 void set_type_(model::CompetitionType t); 00064 }; 00065 00066 class CompetitionParametersWidget2 : public CompetitionParametersWidget { 00067 public: 00068 CompetitionParametersWidget2(const model::Competition* c, 00069 bool allow_change_type=true, Wt::WContainerWidget* parent=0); 00070 00071 void apply_parameters(model::Competition* c); 00072 00073 private: 00074 Wt::WLineEdit* name_; 00075 Wt::WTextEdit* description_; 00076 }; 00077 00078 } 00079 } 00080 00081 #endif 00082