]>
git.saurik.com Git - wxWidgets.git/blob - src/common/framecmn.cpp
59e2c3c868b6a9afca270c0b6fc5992afd7fc8aa
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 /////////////////////////////////////////////////////////////////////////////
11 void wxFrame::OnIdle(wxIdleEvent
& event
)
17 void wxFrame::DoMenuUpdates()
19 wxMenuBar
* bar
= GetMenuBar();
21 int nCount
= bar
->GetMenuCount();
22 for (int n
= 0; n
< nCount
; n
++)
23 DoMenuUpdates(bar
->GetMenu(n
));
27 // update a menu and all submenus recursively
28 void wxFrame::DoMenuUpdates(wxMenu
* menu
)
30 wxNode
* node
= menu
->GetItems().First();
33 wxMenuItem
* item
= (wxMenuItem
*) node
->Data();
34 if ( !item
->IsSeparator() )
36 wxWindowID id
= item
->GetId();
37 wxUpdateUIEvent
event(id
);
38 event
.SetEventObject( this );
40 if (GetEventHandler()->ProcessEvent(event
))
42 if (event
.GetSetText())
43 menu
->SetLabel(id
, event
.GetText());
44 if (event
.GetSetChecked())
45 menu
->Check(id
, event
.GetChecked());
46 if (event
.GetSetEnabled())
47 menu
->Enable(id
, event
.GetEnabled());
50 if (item
->GetSubMenu())
51 DoMenuUpdates(item
->GetSubMenu());