Fix setting "pressed" bitmap for wxToggleButton.
Move wxAnyButton::GetNormalState(), which allows wxToggleButton to override what "normal" means for it, down to the platform-independent wxAnyButtonBase class and use it now in wxGTK as well to correctly choose the pressed bitmap for a toggle button in this state. Closes #16771.
This commit is contained in:
committed by
Vadim Zeitlin
parent
c0ae81ced7
commit
1ad4596e8c
@@ -135,6 +135,13 @@ public:
|
||||
State_Max
|
||||
};
|
||||
|
||||
// return the current setting for the "normal" state of the button, it can
|
||||
// be different from State_Normal for a wxToggleButton
|
||||
virtual State GetNormalState() const
|
||||
{
|
||||
return State_Normal;
|
||||
}
|
||||
|
||||
// return true if this button shouldn't show the text label, either because
|
||||
// it doesn't have it or because it was explicitly disabled with wxBU_NOTEXT
|
||||
bool DontShowLabel() const
|
||||
|
@@ -36,7 +36,6 @@ public:
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual State GetNormalState() const { return State_Normal; }
|
||||
|
||||
// returns true if the platform should explicitly apply a theme border
|
||||
virtual bool CanApplyThemeBorder() const { return false; }
|
||||
|
@@ -46,8 +46,6 @@ public:
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
virtual State GetNormalState() const;
|
||||
|
||||
// returns true if the platform should explicitly apply a theme border
|
||||
virtual bool CanApplyThemeBorder() const { return false; }
|
||||
|
||||
|
@@ -36,6 +36,12 @@ public:
|
||||
virtual void SetValue(bool state) = 0;
|
||||
virtual bool GetValue() const = 0;
|
||||
|
||||
// The current "normal" state for the toggle button depends upon its value.
|
||||
virtual State GetNormalState() const wxOVERRIDE
|
||||
{
|
||||
return GetValue() ? State_Pressed : State_Normal;
|
||||
}
|
||||
|
||||
void UpdateWindowUI(long flags) wxOVERRIDE
|
||||
{
|
||||
wxControl::UpdateWindowUI(flags);
|
||||
|
Reference in New Issue
Block a user