mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
GRAPHICS: MACGUI: introduce checkBoxAccess to determines what happens when user clicks the checkbox or radio button
This commit is contained in:
parent
601696ab1e
commit
36abd91264
@ -43,6 +43,7 @@ MacButton::MacButton(MacButtonType buttonType, TextAlign textAlignment, MacWidge
|
||||
void MacButton::init() {
|
||||
_invertInner = false;
|
||||
_checkBoxType = 0;
|
||||
_checkBoxAccess = 0;
|
||||
|
||||
switch (_buttonType) {
|
||||
case kCheckBox:
|
||||
@ -193,7 +194,22 @@ bool MacButton::processEvent(Common::Event &event) {
|
||||
break;
|
||||
case Common::EVENT_LBUTTONUP:
|
||||
setActive(false);
|
||||
_invertInner = !_invertInner;
|
||||
|
||||
switch (_checkBoxAccess) {
|
||||
case 0:
|
||||
_invertInner = !_invertInner;
|
||||
break;
|
||||
case 1:
|
||||
_invertInner = true;
|
||||
break;
|
||||
case 2:
|
||||
// no op, type 2 will prevent user from setting checkboxes
|
||||
break;
|
||||
default:
|
||||
warning("MacButton::processEvent can not handle checkBoxAccess with type %d", _checkBoxAccess);
|
||||
break;
|
||||
}
|
||||
|
||||
_wm->_hilitingWidget = false;
|
||||
break;
|
||||
default:
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
|
||||
void setHilite(bool hilite);
|
||||
void setCheckBoxType(int type);
|
||||
void setCheckBoxAccess(int type) { _checkBoxAccess = type; }
|
||||
|
||||
virtual bool draw(ManagedSurface *g, bool forceRedraw = false) override;
|
||||
virtual bool draw(bool forceRedraw = false) override;
|
||||
@ -70,6 +71,7 @@ private:
|
||||
MacPlotData _pd;
|
||||
bool _invertInner;
|
||||
int _checkBoxType;
|
||||
int _checkBoxAccess;
|
||||
};
|
||||
|
||||
} // End of namespace Graphics
|
||||
|
Loading…
Reference in New Issue
Block a user