Skip to content

Commit

Permalink
WIDGET::getState() should be const
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 28, 2024
1 parent b9c3759 commit b4e00db
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/widget/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ W_BUTTON::W_BUTTON()
, FontID(font_regular)
{}

unsigned W_BUTTON::getState()
unsigned W_BUTTON::getState() const
{
return state & (WBUT_DISABLE | WBUT_LOCK | WBUT_CLICKLOCK | WBUT_FLASH | WBUT_DOWN | WBUT_HIGHLIGHT);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class W_BUTTON : public WIDGET
void display(int xOffset, int yOffset) override;
void displayRecursive(WidgetGraphicsContext const &context) override; // for handling progress border overlay

unsigned getState() override;
unsigned getState() const override;
void setState(unsigned state) override;
void setFlash(bool enable) override;
WzString getString() const override;
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/form.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ W_CLICKFORM::W_CLICKFORM()
, AudioCallback(WidgGetAudioCallback())
{}

unsigned W_CLICKFORM::getState()
unsigned W_CLICKFORM::getState() const
{
return state & (WBUT_DISABLE | WBUT_LOCK | WBUT_CLICKLOCK | WBUT_FLASH | WBUT_DOWN | WBUT_HIGHLIGHT);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/form.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class W_CLICKFORM : public W_FORM
return &(help.value());
}

unsigned getState() override;
unsigned getState() const override;
void setState(unsigned state) override;
void setFlash(bool enable) override;
void setTip(std::string string) override;
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/widgbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class WIDGET: public std::enable_shared_from_this<WIDGET>
virtual void mouseDragged(WIDGET_KEY, W_CONTEXT *start, W_CONTEXT *current) {}

public:
virtual unsigned getState();
virtual unsigned getState() const;
virtual void setState(unsigned state);
virtual void setFlash(bool enable);
virtual WzString getString() const;
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ UDWORD widgGetButtonKey_DEPRECATED(const std::shared_ptr<W_SCREEN> &psScreen)
return lastReleasedKey_DEPRECATED;
}

unsigned WIDGET::getState()
unsigned WIDGET::getState() const
{
ASSERT(false, "Can't get widget type %u's state.", type);
return 0;
Expand Down

0 comments on commit b4e00db

Please sign in to comment.