]>
git.saurik.com Git - wxWidgets.git/blob - src/common/framecmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: common (for all platforms) wxFrame functions
4 // Author: Julian Smart, Vadim Zeitlin
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
13 void wxFrame::OnIdle(wxIdleEvent
& WXUNUSED(event
) )
19 void wxFrame::DoMenuUpdates()
21 wxMenuBar
* bar
= GetMenuBar();
23 int nCount
= bar
->GetMenuCount();
24 for (int n
= 0; n
< nCount
; n
++)
25 DoMenuUpdates(bar
->GetMenu(n
));
29 // update a menu and all submenus recursively
30 void wxFrame::DoMenuUpdates(wxMenu
* menu
)
32 wxNode
* node
= menu
->GetItems().First();
35 wxMenuItem
* item
= (wxMenuItem
*) node
->Data();
36 if ( !item
->IsSeparator() )
38 wxWindowID id
= item
->GetId();
39 wxUpdateUIEvent
event(id
);
40 event
.SetEventObject( this );
42 if (GetEventHandler()->ProcessEvent(event
))
44 if (event
.GetSetText())
45 menu
->SetLabel(id
, event
.GetText());
46 if (event
.GetSetChecked())
47 menu
->Check(id
, event
.GetChecked());
48 if (event
.GetSetEnabled())
49 menu
->Enable(id
, event
.GetEnabled());
52 if (item
->GetSubMenu())
53 DoMenuUpdates(item
->GetSubMenu());