If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
- In need of some credit
- Posts: 1
- Joined: Sun Mar 20, 2005 1:58 pm
When I want to disable a menuitem, I use
The problem: The menuitem is not turning gray... but when I click the menuitem, I know that it is disabled. How can I make a menuitem turn gray when it is disabled?
I've searched the forum, and it seems like I have to use wxUpdateUIEvent, but I have really no idea how to use it
- Knows some wx things
- Posts: 35
- Joined: Fri Mar 11, 2005 3:43 am
Just a thought.. but you could set the text color using this, windows only though.
void wxMenuItem::SetTextColour(const wxColour& colour) const;
- Earned some good credits
- Posts: 120
- Joined: Sun Aug 29, 2004 3:09 pm
- Location: Grenoble, France
The wxUpdateUIEvent is used like any other event interception : you use the macro to intercept the update event for an specific ID or range of IDs :
EVT_UPDATE_UI_RANGE(id1, id2, func)
you just have to write an interception function :
void MyClass::OnUpdateMenuItem(wxUpdateUIEvent& event)
And the wxUpdateUIEvent class members are usefull to turn on/off a menu (or a toolbar tool, a button ... via the ID) or check it, changing its name ...