Rename many tstate -> state_t
This commit is contained in:
parent
77cace19db
commit
173c4aecf3
46 changed files with 79 additions and 79 deletions
|
@ -179,4 +179,4 @@ void chat_handler::add_chat_room_message_received(const std::string &room,
|
|||
add_chat_message(time(nullptr), room + ": " + speaker, 0, message, events::chat_handler::MESSAGE_PRIVATE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
class location_palette_item : public gui::widget
|
||||
{
|
||||
public:
|
||||
struct tstate {
|
||||
tstate()
|
||||
struct state_t {
|
||||
state_t()
|
||||
: selected(false)
|
||||
, mouseover(false)
|
||||
{}
|
||||
bool selected;
|
||||
bool mouseover;
|
||||
friend bool operator==(tstate r, tstate l)
|
||||
friend bool operator==(state_t r, state_t l)
|
||||
{
|
||||
return r.selected == l.selected && r.mouseover == l.mouseover;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
if (hidden() || !enabled() || mouse_locked())
|
||||
return;
|
||||
|
||||
tstate start_state = state_;
|
||||
state_t start_state = state_;
|
||||
|
||||
switch (e.type) {
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
|
@ -123,7 +123,7 @@ public:
|
|||
private:
|
||||
std::string id_;
|
||||
std::string desc_;
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
editor::location_palette& parent_;
|
||||
};
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
/**
|
||||
* Acts like @ref twalker_::next for the level where the policy is used.
|
||||
*/
|
||||
twalker_::tstate next(twalker_&)
|
||||
twalker_::state_t next(twalker_&)
|
||||
{
|
||||
return twalker_::fail;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
/**
|
||||
* Acts like @ref twalker_::next for the level where the policy is used.
|
||||
*/
|
||||
twalker_::tstate next(twalker_& visitor)
|
||||
twalker_::state_t next(twalker_& visitor)
|
||||
{
|
||||
return visitor.next(level);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
*
|
||||
* The enum is used to return the state of @ref next.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
/**
|
||||
* When calling next the following it has the following results.
|
||||
*
|
||||
|
@ -89,7 +89,7 @@ public:
|
|||
*
|
||||
* @returns The status of the operation.
|
||||
*/
|
||||
virtual tstate next(const tlevel level) = 0;
|
||||
virtual state_t next(const tlevel level) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether the current widget is valid.
|
||||
|
|
|
@ -29,7 +29,7 @@ tgrid::tgrid(gui2::tgrid& grid)
|
|||
{
|
||||
}
|
||||
|
||||
twalker_::tstate tgrid::next(const tlevel level)
|
||||
twalker_::state_t tgrid::next(const tlevel level)
|
||||
{
|
||||
if(at_end(level)) {
|
||||
return fail;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
explicit tgrid(gui2::tgrid& grid);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::twalker_. */
|
||||
virtual tstate next(const tlevel level);
|
||||
virtual state_t next(const tlevel level);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::twalker_. */
|
||||
virtual bool at_end(const tlevel level) const;
|
||||
|
|
|
@ -30,7 +30,7 @@ ttree_node::ttree_node(gui2::ttree_view_node& node, boost::ptr_vector<gui2::ttre
|
|||
{
|
||||
}
|
||||
|
||||
twalker_::tstate ttree_node::next(const tlevel level)
|
||||
twalker_::state_t ttree_node::next(const tlevel level)
|
||||
{
|
||||
if(at_end(level)) {
|
||||
return fail;
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
ttree_node(gui2::ttree_view_node& node, boost::ptr_vector<gui2::ttree_view_node>& children);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::twalker_. */
|
||||
virtual tstate next(const tlevel level);
|
||||
virtual state_t next(const tlevel level);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::twalker_. */
|
||||
virtual bool at_end(const tlevel level) const;
|
||||
|
|
|
@ -32,7 +32,7 @@ twidget::twidget(gui2::twidget& widget) : widget_(&widget)
|
|||
{
|
||||
}
|
||||
|
||||
twalker_::tstate twidget::next(const tlevel level)
|
||||
twalker_::state_t twidget::next(const tlevel level)
|
||||
{
|
||||
if(at_end(level)) {
|
||||
return fail;
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
explicit twidget(gui2::twidget& widget);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::twalker_. */
|
||||
virtual tstate next(const tlevel level);
|
||||
virtual state_t next(const tlevel level);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::twalker_. */
|
||||
virtual bool at_end(const tlevel level) const;
|
||||
|
|
|
@ -72,7 +72,7 @@ unsigned tbutton::get_state() const
|
|||
return state_;
|
||||
}
|
||||
|
||||
void tbutton::set_state(const tstate state)
|
||||
void tbutton::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
@ -187,7 +187,7 @@ tbutton_definition::tbutton_definition(const config& cfg)
|
|||
tbutton_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in button.hpp.
|
||||
// Note the order should be the same as the enum state_t in button.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_pressed")));
|
||||
|
|
|
@ -70,7 +70,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
PRESSED,
|
||||
|
@ -78,14 +78,14 @@ private:
|
|||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
/**
|
||||
* Current state of the widget.
|
||||
*
|
||||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/**
|
||||
* The return value of the button.
|
||||
|
|
|
@ -101,7 +101,7 @@ tdrawing_definition::tresolution::tresolution(const config& cfg)
|
|||
: tresolution_definition_(cfg)
|
||||
{
|
||||
/*
|
||||
* Note the order should be the same as the enum tstate in drawing.hpp.
|
||||
* Note the order should be the same as the enum state_t in drawing.hpp.
|
||||
* Normally the [draw] section is in the config, but for this widget the
|
||||
* original draw section is ignored, so send a dummy.
|
||||
*/
|
||||
|
|
|
@ -73,7 +73,7 @@ private:
|
|||
* Note the order of the states must be the same as defined in
|
||||
* settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
COUNT
|
||||
};
|
||||
|
|
|
@ -183,7 +183,7 @@ thorizontal_scrollbar_definition::tresolution::tresolution(const config& cfg)
|
|||
missing_mandatory_wml_key("resolution",
|
||||
"minimum_positioner_length"));
|
||||
|
||||
// Note the order should be the same as the enum tstate is scrollbar.hpp.
|
||||
// Note the order should be the same as the enum state_t is scrollbar.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_pressed")));
|
||||
|
|
|
@ -132,7 +132,7 @@ timage_definition::timage_definition(const config& cfg)
|
|||
timage_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in image.hpp.
|
||||
// Note the order should be the same as the enum state_t in image.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
COUNT
|
||||
};
|
||||
|
|
|
@ -120,7 +120,7 @@ void tlabel::set_link_color(const std::string & color)
|
|||
set_is_dirty(true);
|
||||
}
|
||||
|
||||
void tlabel::set_state(const tstate state)
|
||||
void tlabel::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
@ -266,7 +266,7 @@ tlabel_definition::tresolution::tresolution(const config& cfg)
|
|||
, link_aware(cfg["link_aware"].to_bool(false))
|
||||
, link_color(cfg["link_color"].str().size() > 0 ? cfg["link_color"].str() : "#ffff00")
|
||||
{
|
||||
// Note the order should be the same as the enum tstate is label.hpp.
|
||||
// Note the order should be the same as the enum state_t is label.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
}
|
||||
|
|
|
@ -75,13 +75,13 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
|
||||
/**
|
||||
* Current state of the widget.
|
||||
|
@ -89,7 +89,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/** Holds the label can wrap or not. */
|
||||
bool can_wrap_;
|
||||
|
|
|
@ -217,7 +217,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
COUNT
|
||||
|
@ -229,7 +229,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/**
|
||||
* Contains a pointer to the generator.
|
||||
|
|
|
@ -798,7 +798,7 @@ tlistbox_definition::tlistbox_definition(const config& cfg)
|
|||
tlistbox_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg), grid(nullptr)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in listbox.hpp.
|
||||
// Note the order should be the same as the enum state_t in listbox.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ tmatrix_definition::tresolution::tresolution(const config& cfg)
|
|||
: tresolution_definition_(cfg)
|
||||
, content(new tbuilder_grid(cfg.child("content", "[matrix_definition]")))
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in matrix.hpp.
|
||||
// Note the order should be the same as the enum state_t in matrix.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ protected:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
COUNT
|
||||
|
@ -62,7 +62,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
};
|
||||
|
||||
template <class STATE>
|
||||
|
|
|
@ -79,7 +79,7 @@ unsigned tmenu_button::get_state() const
|
|||
return state_;
|
||||
}
|
||||
|
||||
void tmenu_button::set_state(const tstate state)
|
||||
void tmenu_button::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
@ -238,7 +238,7 @@ tmenu_button_definition::tmenu_button_definition(const config& cfg)
|
|||
tmenu_button_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in menu_button.hpp.
|
||||
// Note the order should be the same as the enum state_t in menu_button.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_pressed")));
|
||||
|
|
|
@ -94,7 +94,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
PRESSED,
|
||||
|
@ -102,14 +102,14 @@ private:
|
|||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
/**
|
||||
* Current state of the widget.
|
||||
*
|
||||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/**
|
||||
* The return value of the button.
|
||||
|
|
|
@ -294,7 +294,7 @@ tminimap_definition::tminimap_definition(const config& cfg)
|
|||
tminimap_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in minimap.hpp.
|
||||
// Note the order should be the same as the enum state_t in minimap.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ tprogress_bar_definition::tprogress_bar_definition(const config& cfg)
|
|||
tprogress_bar_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in progress_bar.hpp.
|
||||
// Note the order should be the same as the enum state_t in progress_bar.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
COUNT
|
||||
};
|
||||
|
|
|
@ -85,7 +85,7 @@ unsigned trepeating_button::get_state() const
|
|||
return state_;
|
||||
}
|
||||
|
||||
void trepeating_button::set_state(const tstate state)
|
||||
void trepeating_button::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
@ -207,7 +207,7 @@ trepeating_button_definition::trepeating_button_definition(const config& cfg)
|
|||
trepeating_button_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in
|
||||
// Note the order should be the same as the enum state_t in
|
||||
// repeating_button.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
|
|
|
@ -80,7 +80,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
PRESSED,
|
||||
|
@ -88,14 +88,14 @@ private:
|
|||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
/**
|
||||
* Current state of the widget.
|
||||
*
|
||||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/** The timer for the repeating events. */
|
||||
size_t repeat_timer_;
|
||||
|
|
|
@ -189,7 +189,7 @@ tscroll_label_definition::tscroll_label_definition(const config& cfg)
|
|||
tscroll_label_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg), grid(nullptr)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate is scroll_label.hpp.
|
||||
// Note the order should be the same as the enum state_t is scroll_label.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
|
||||
|
|
|
@ -73,14 +73,14 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
COUNT
|
||||
};
|
||||
|
||||
// It's not needed for now so keep it disabled, no definition exists yet.
|
||||
// void set_state(const tstate state);
|
||||
// void set_state(const state_t state);
|
||||
|
||||
/**
|
||||
* Current state of the widget.
|
||||
|
@ -88,7 +88,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
bool wrap_on;
|
||||
|
||||
const std::string text_alignment;
|
||||
|
|
|
@ -157,7 +157,7 @@ void tscrollbar_::update_canvas()
|
|||
set_is_dirty(true);
|
||||
}
|
||||
|
||||
void tscrollbar_::set_state(const tstate state)
|
||||
void tscrollbar_::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
PRESSED,
|
||||
|
@ -206,14 +206,14 @@ protected:
|
|||
}
|
||||
|
||||
private:
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
/**
|
||||
* Current state of the widget.
|
||||
*
|
||||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/** The number of items the scrollbar 'holds'. */
|
||||
unsigned item_count_;
|
||||
|
|
|
@ -453,7 +453,7 @@ private:
|
|||
*
|
||||
* Note the order of the states must be the same as defined in settings.hpp.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
COUNT
|
||||
|
@ -465,7 +465,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/**
|
||||
* The mode of how to show the scrollbar.
|
||||
|
|
|
@ -409,7 +409,7 @@ tslider_definition::tresolution::tresolution(const config& cfg)
|
|||
missing_mandatory_wml_key("resolution",
|
||||
"minimum_positioner_length"));
|
||||
|
||||
// Note the order should be the same as the enum tstate is slider.hpp.
|
||||
// Note the order should be the same as the enum state_t is slider.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_pressed")));
|
||||
|
|
|
@ -244,7 +244,7 @@ void ttext_::set_selection(size_t start, int length)
|
|||
update_canvas();
|
||||
}
|
||||
|
||||
void ttext_::set_state(const tstate state)
|
||||
void ttext_::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
|
|
@ -255,14 +255,14 @@ protected:
|
|||
private:
|
||||
/** Note the order of the states must be the same as defined in
|
||||
* settings.hpp. */
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
FOCUSED,
|
||||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
|
||||
virtual void toggle_cursor_timer(bool enable);
|
||||
|
||||
|
@ -277,7 +277,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/** The text entered in the widget. */
|
||||
font::pango_text text_;
|
||||
|
|
|
@ -446,7 +446,7 @@ ttext_box_definition::tresolution::tresolution(const config& cfg)
|
|||
, text_x_offset(cfg["text_x_offset"])
|
||||
, text_y_offset(cfg["text_y_offset"])
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in text_box.hpp.
|
||||
// Note the order should be the same as the enum state_t in text_box.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_focused")));
|
||||
|
|
|
@ -131,7 +131,7 @@ void ttoggle_button::set_retval(const int retval)
|
|||
set_wants_mouse_left_double_click(retval_ != 0);
|
||||
}
|
||||
|
||||
void ttoggle_button::set_state(const tstate state)
|
||||
void ttoggle_button::set_state(const state_t state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
@ -243,7 +243,7 @@ ttoggle_button_definition::ttoggle_button_definition(const config& cfg)
|
|||
ttoggle_button_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in
|
||||
// Note the order should be the same as the enum state_t in
|
||||
// toggle_button.hpp.
|
||||
for(const auto& c : cfg.child_range("state"))
|
||||
{
|
||||
|
|
|
@ -90,14 +90,14 @@ private:
|
|||
* same and also that 'up' is before 'down'. 'up' has no suffix, 'down' has
|
||||
* the SELECTED suffix.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
FOCUSED,
|
||||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
|
||||
/**
|
||||
* Current state of the widget.
|
||||
|
@ -105,7 +105,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
/**
|
||||
* Usually 1 for selected and 0 for not selected, can also have higher values in tristate buttons.
|
||||
*/
|
||||
|
|
|
@ -179,7 +179,7 @@ void ttoggle_panel::set_retval(const int retval)
|
|||
retval_ = retval;
|
||||
}
|
||||
|
||||
void ttoggle_panel::set_state(const tstate state)
|
||||
void ttoggle_panel::set_state(const state_t state)
|
||||
{
|
||||
if(state == state_) {
|
||||
return;
|
||||
|
@ -368,7 +368,7 @@ ttoggle_panel_definition::tresolution::tresolution(const config& cfg)
|
|||
, left_border(cfg["left_border"])
|
||||
, right_border(cfg["right_border"])
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in toggle_panel.hpp.
|
||||
// Note the order should be the same as the enum state_t in toggle_panel.hpp.
|
||||
for(const auto& c : cfg.child_range("state"))
|
||||
{
|
||||
state.push_back(tstate_definition(c.child("enabled")));
|
||||
|
|
|
@ -122,14 +122,14 @@ private:
|
|||
* same and also that 'up' is before 'down'. 'up' has no suffix, 'down' has
|
||||
* the SELECTED suffix.
|
||||
*/
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
FOCUSED,
|
||||
COUNT
|
||||
};
|
||||
|
||||
void set_state(const tstate state);
|
||||
void set_state(const state_t state);
|
||||
|
||||
/**
|
||||
* Current state of the widget.
|
||||
|
@ -137,7 +137,7 @@ private:
|
|||
* The state of the widget determines what to render and how the widget
|
||||
* reacts to certain 'events'.
|
||||
*/
|
||||
tstate state_;
|
||||
state_t state_;
|
||||
|
||||
/**
|
||||
* Usually 1 for selected and 0 for not selected, can also have higher values in tristate buttons.
|
||||
|
|
|
@ -304,7 +304,7 @@ ttree_view_definition::ttree_view_definition(const config& cfg)
|
|||
ttree_view_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg), grid(nullptr)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate is listbox.hpp.
|
||||
// Note the order should be the same as the enum state_t is listbox.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ private:
|
|||
template<typename T> // This is only a template to avoid including units/attack.hpp
|
||||
void print_attack_details(T attacks, ttree_view_node& parent_node);
|
||||
|
||||
enum tstate {
|
||||
enum state_t {
|
||||
ENABLED
|
||||
};
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ tvertical_scrollbar_definition::tresolution::tresolution(const config& cfg)
|
|||
missing_mandatory_wml_key("resolution",
|
||||
"minimum_positioner_length"));
|
||||
|
||||
// Note the order should be the same as the enum tstate in scrollbar.hpp.
|
||||
// Note the order should be the same as the enum state_t in scrollbar.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_pressed")));
|
||||
|
|
Loading…
Add table
Reference in a new issue