1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "frame.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
29 #include "wx/dialog.h"
30 #include "wx/settings.h"
31 #include "wx/dcclient.h"
34 #include "wx/msw/private.h"
35 #include "wx/statusbr.h"
36 #include "wx/menuitem.h"
38 #ifdef LoadAccelerators
39 #undef LoadAccelerators
42 #if USE_NATIVE_STATUSBAR
43 #include <wx/msw/statbr95.h>
46 extern wxList wxModelessWindows
;
47 extern wxList wxPendingDelete
;
48 extern char wxFrameClassName
[];
50 #if !USE_SHARED_LIBRARY
51 BEGIN_EVENT_TABLE(wxFrame
, wxWindow
)
52 EVT_SIZE(wxFrame::OnSize
)
53 EVT_ACTIVATE(wxFrame::OnActivate
)
54 EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight
)
55 EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged
)
56 EVT_IDLE(wxFrame::OnIdle
)
57 EVT_CLOSE(wxFrame::OnCloseWindow
)
60 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxWindow
)
63 #if USE_NATIVE_STATUSBAR
64 bool wxFrame::m_useNativeStatusBar
= TRUE
;
66 bool wxFrame::m_useNativeStatusBar
= FALSE
;
69 wxFrame::wxFrame(void)
71 m_frameToolBar
= NULL
;
72 m_frameMenuBar
= NULL
;
73 m_frameStatusBar
= NULL
;
75 m_windowParent
= NULL
;
79 bool wxFrame::Create(wxWindow
*parent
,
81 const wxString
& title
,
88 wxTopLevelWindows
.Append(this);
91 // m_modalShowing = FALSE;
92 m_windowStyle
= style
;
93 m_frameMenuBar
= NULL
;
94 m_frameToolBar
= NULL
;
95 m_frameStatusBar
= NULL
;
97 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
103 m_windowId
= (int)NewControlId();
105 if (parent
) parent
->AddChild(this);
113 MSWCreate(m_windowId
, (wxWindow
*)parent
, wxFrameClassName
, this, (char *)(const char *)title
,
114 x
, y
, width
, height
, style
);
116 wxModelessWindows
.Append(this);
120 wxFrame::~wxFrame(void)
122 m_isBeingDeleted
= TRUE
;
123 wxTopLevelWindows
.DeleteObject(this);
125 if (m_frameStatusBar
)
126 delete m_frameStatusBar
;
128 delete m_frameMenuBar
;
130 /* New behaviour March 1998: check if it's the last top-level window */
131 // if (wxTheApp && (this == wxTheApp->GetTopWindow()))
133 if (wxTheApp
&& (wxTopLevelWindows
.Number() == 0))
135 wxTheApp
->SetTopWindow(NULL
);
137 if (wxTheApp
->GetExitOnFrameDelete())
143 wxModelessWindows
.DeleteObject(this);
145 // For some reason, wxWindows can activate another task altogether
146 // when a frame is destroyed after a modal dialog has been invoked.
147 // Try to bring the parent to the top.
148 if (GetParent() && GetParent()->GetHWND())
149 ::BringWindowToTop((HWND
) GetParent()->GetHWND());
152 WXHMENU
wxFrame::GetWinMenu(void) const
157 // Get size *available for subwindows* i.e. excluding menu bar etc.
158 // For XView, this is the same as GetSize
159 void wxFrame::GetClientSize(int *x
, int *y
) const
162 GetClientRect((HWND
) GetHWND(), &rect
);
164 if ( m_frameStatusBar
)
166 int statusX
, statusY
;
167 m_frameStatusBar
->GetClientSize(&statusX
, &statusY
);
168 rect
.bottom
-= statusY
;
174 // Set the client size (i.e. leave the calculation of borders etc.
176 void wxFrame::SetClientSize(int width
, int height
)
178 HWND hWnd
= (HWND
) GetHWND();
181 GetClientRect(hWnd
, &rect
);
184 GetWindowRect(hWnd
, &rect2
);
186 // Find the difference between the entire window (title bar and all)
187 // and the client area; add this to the new client size to move the
189 int actual_width
= rect2
.right
- rect2
.left
- rect
.right
+ width
;
190 int actual_height
= rect2
.bottom
- rect2
.top
- rect
.bottom
+ height
;
192 if ( m_frameStatusBar
)
194 int statusX
, statusY
;
195 m_frameStatusBar
->GetClientSize(&statusX
, &statusY
);
196 actual_height
+= statusY
;
200 point
.x
= rect2
.left
;
203 MoveWindow(hWnd
, point
.x
, point
.y
, actual_width
, actual_height
, (BOOL
)TRUE
);
205 wxSizeEvent
event(wxSize(width
, height
), m_windowId
);
206 event
.SetEventObject( this );
207 GetEventHandler()->ProcessEvent(event
);
210 void wxFrame::GetSize(int *width
, int *height
) const
213 GetWindowRect((HWND
) GetHWND(), &rect
);
214 *width
= rect
.right
- rect
.left
;
215 *height
= rect
.bottom
- rect
.top
;
218 void wxFrame::GetPosition(int *x
, int *y
) const
221 GetWindowRect((HWND
) GetHWND(), &rect
);
230 void wxFrame::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
232 int currentX
, currentY
;
238 GetPosition(¤tX
, ¤tY
);
239 if (x
== -1 || (sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
241 if (y
== -1 || (sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
246 if (width
== -1) w1
= ww
;
247 if (height
==-1) h1
= hh
;
249 MoveWindow((HWND
) GetHWND(), x1
, y1
, w1
, h1
, (BOOL
)TRUE
);
251 wxSizeEvent
event(wxSize(width
, height
), m_windowId
);
252 event
.SetEventObject( this );
253 GetEventHandler()->ProcessEvent(event
);
256 bool wxFrame::Show(bool show
)
266 // Try to highlight the correct window (the parent)
270 hWndParent
= (HWND
) GetParent()->GetHWND();
272 ::BringWindowToTop(hWndParent
);
276 ShowWindow((HWND
) GetHWND(), (BOOL
)cshow
);
279 BringWindowToTop((HWND
) GetHWND());
281 wxActivateEvent
event(wxEVT_ACTIVATE
, TRUE
, m_windowId
);
282 event
.SetEventObject( this );
283 GetEventHandler()->ProcessEvent(event
);
288 void wxFrame::Iconize(bool iconize
)
298 ShowWindow((HWND
) GetHWND(), (BOOL
)cshow
);
299 m_iconized
= iconize
;
302 // Equivalent to maximize/restore in Windows
303 void wxFrame::Maximize(bool maximize
)
311 ShowWindow((HWND
) GetHWND(), cshow
);
315 bool wxFrame::IsIconized(void) const
317 ((wxFrame
*)this)->m_iconized
= (::IsIconic((HWND
) GetHWND()) != 0);
321 void wxFrame::SetTitle(const wxString
& title
)
323 SetWindowText((HWND
) GetHWND(), (const char *)title
);
326 wxString
wxFrame::GetTitle(void) const
328 GetWindowText((HWND
) GetHWND(), wxBuffer
, 1000);
329 return wxString(wxBuffer
);
332 void wxFrame::SetIcon(const wxIcon
& icon
)
335 #if defined(__WIN95__)
337 SendMessage((HWND
) GetHWND(), WM_SETICON
,
338 (WPARAM
)TRUE
, (LPARAM
)(HICON
) m_icon
.GetHICON());
342 wxStatusBar
*wxFrame::OnCreateStatusBar(int number
)
344 wxStatusBar
*statusBar
= NULL
;
346 #if USE_NATIVE_STATUSBAR
347 if (UsesNativeStatusBar())
349 statusBar
= new wxStatusBar95(this);
354 statusBar
= new wxStatusBar(this, -1, wxPoint(0, 0), wxSize(100, 20));
356 // Set the height according to the font and the border size
357 wxClientDC
dc(statusBar
);
358 dc
.SetFont(* statusBar
->GetFont());
361 dc
.GetTextExtent("X", &x
, &y
);
363 int height
= (int)( (y
* 1.1) + 2* statusBar
->GetBorderY());
365 statusBar
->SetSize(-1, -1, 100, height
);
368 statusBar
->SetFieldsCount(number
);
372 bool wxFrame::CreateStatusBar(int number
)
374 // VZ: calling CreateStatusBar twice is an error - why anyone would do it?
375 wxCHECK_MSG( m_frameStatusBar
== NULL
, FALSE
,
376 "recreating status bar in wxFrame" );
378 m_frameStatusBar
= OnCreateStatusBar(number
);
379 if ( m_frameStatusBar
)
388 void wxFrame::SetStatusText(const wxString
& text
, int number
)
390 wxCHECK_RET( m_frameStatusBar
!= NULL
, "no statusbar to set text for" );
392 m_frameStatusBar
->SetStatusText(text
, number
);
395 void wxFrame::SetStatusWidths(int n
, const int widths_field
[])
397 wxCHECK_RET( m_frameStatusBar
!= NULL
, "no statusbar to set widths for" );
399 m_frameStatusBar
->SetStatusWidths(n
, widths_field
);
403 void wxFrame::PositionStatusBar(void)
405 // native status bar positions itself
407 #if USE_NATIVE_STATUSBAR
408 && !m_frameStatusBar
->IsKindOf(CLASSINFO(wxStatusBar95
))
413 GetClientSize(&w
, &h
);
415 m_frameStatusBar
->GetSize(&sw
, &sh
);
416 m_frameStatusBar
->SetSize(0, h
, w
, sh
);
420 void wxFrame::SetMenuBar(wxMenuBar
*menu_bar
)
424 m_frameMenuBar
= NULL
;
428 if (menu_bar
->m_menuBarFrame
)
432 HMENU menu
= CreateMenu();
434 for (i
= 0; i
< menu_bar
->m_menuCount
; i
++)
436 HMENU popup
= (HMENU
)menu_bar
->m_menus
[i
]->m_hMenu
;
438 // After looking Bounds Checker result, it seems that all
439 // menus must be individually destroyed. So, don't reset m_hMenu,
440 // to allow ~wxMenu to do the job.
442 menu_bar
->m_menus
[i
]->m_savehMenu
= (WXHMENU
) popup
;
443 // Uncommenting for the moment... JACS
444 menu_bar
->m_menus
[i
]->m_hMenu
= 0;
445 AppendMenu(menu
, MF_POPUP
| MF_STRING
, (UINT
)popup
, menu_bar
->m_titles
[i
]);
448 menu_bar
->m_hMenu
= (WXHMENU
)menu
;
450 delete m_frameMenuBar
;
452 this->m_hMenu
= (WXHMENU
) menu
;
455 if (!SetMenu((HWND
) GetHWND(), menu
))
458 err
= GetLastError();
462 m_frameMenuBar
= menu_bar
;
463 menu_bar
->m_menuBarFrame
= this;
466 bool wxFrame::LoadAccelerators(const wxString
& table
)
468 m_acceleratorTable
= (WXHANDLE
)
471 ::LoadAcceleratorsW(wxGetInstance(), (const char *)table
);
473 ::LoadAcceleratorsA(wxGetInstance(), (const char *)table
);
476 ::LoadAccelerators(wxGetInstance(), (const char *)table
);
479 // The above is necessary because LoadAccelerators is a macro
480 // which we have undefed earlier in the file to avoid confusion
481 // with wxFrame::LoadAccelerators. Ugh!
483 return (m_acceleratorTable
!= (WXHANDLE
) NULL
);
486 void wxFrame::Fit(void)
488 // Work out max. size
489 wxNode
*node
= GetChildren()->First();
494 // Find a child that's a subwindow, but not a dialog box.
495 wxWindow
*win
= (wxWindow
*)node
->Data();
497 if (!win
->IsKindOf(CLASSINFO(wxFrame
)) &&
498 !win
->IsKindOf(CLASSINFO(wxDialog
)))
502 win
->GetSize(&width
, &height
);
503 win
->GetPosition(&x
, &y
);
505 if ((x
+ width
) > max_width
)
506 max_width
= x
+ width
;
507 if ((y
+ height
) > max_height
)
508 max_height
= y
+ height
;
512 SetClientSize(max_width
, max_height
);
515 // Responds to colour changes, and passes event on to children.
516 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent
& event
)
518 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
521 if ( m_frameStatusBar
)
523 wxSysColourChangedEvent event2
;
524 event2
.SetEventObject( m_frameStatusBar
);
525 m_frameStatusBar
->ProcessEvent(event2
);
528 // Propagate the event to the non-top-level children
529 wxWindow::OnSysColourChanged(event
);
537 void wxFrame::MSWCreate(int id
, wxWindow
*parent
, const char *wclass
, wxWindow
*wx_win
, const char *title
,
538 int x
, int y
, int width
, int height
, long style
)
541 m_defaultIcon
= (WXHICON
) (wxSTD_FRAME_ICON
? wxSTD_FRAME_ICON
: wxDEFAULT_FRAME_ICON
);
543 // If child windows aren't properly drawn initially, WS_CLIPCHILDREN
544 // could be the culprit. But without it, you can get a lot of flicker.
547 if ((style
& wxCAPTION
) == wxCAPTION
)
548 msflags
= WS_OVERLAPPED
;
552 if (style
& wxMINIMIZE_BOX
)
553 msflags
|= WS_MINIMIZEBOX
;
554 if (style
& wxMAXIMIZE_BOX
)
555 msflags
|= WS_MAXIMIZEBOX
;
556 if (style
& wxTHICK_FRAME
)
557 msflags
|= WS_THICKFRAME
;
558 if (style
& wxSYSTEM_MENU
)
559 msflags
|= WS_SYSMENU
;
560 if ((style
& wxMINIMIZE
) || (style
& wxICONIZE
))
561 msflags
|= WS_MINIMIZE
;
562 if (style
& wxMAXIMIZE
)
563 msflags
|= WS_MAXIMIZE
;
564 if (style
& wxCAPTION
)
565 msflags
|= WS_CAPTION
;
566 if (style
& wxCLIP_CHILDREN
)
567 msflags
|= WS_CLIPCHILDREN
;
569 // Keep this in wxFrame because it saves recoding this function
572 if (style
& wxTINY_CAPTION_VERT
)
573 msflags
|= IBS_VERTCAPTION
;
574 if (style
& wxTINY_CAPTION_HORIZ
)
575 msflags
|= IBS_HORZCAPTION
;
577 if (style
& wxTINY_CAPTION_VERT
)
578 msflags
|= WS_CAPTION
;
579 if (style
& wxTINY_CAPTION_HORIZ
)
580 msflags
|= WS_CAPTION
;
582 if ((style
& wxTHICK_FRAME
) == 0)
583 msflags
|= WS_BORDER
;
585 WXDWORD extendedStyle
= MakeExtendedStyle(style
);
587 if (style
& wxSTAY_ON_TOP
)
588 extendedStyle
|= WS_EX_TOPMOST
;
591 wxWindow::MSWCreate(id
, parent
, wclass
, wx_win
, title
, x
, y
, width
, height
,
592 msflags
, NULL
, extendedStyle
);
593 // Seems to be necessary if we use WS_POPUP
594 // style instead of WS_OVERLAPPED
595 if (width
> -1 && height
> -1)
596 ::PostMessage((HWND
) GetHWND(), WM_SIZE
, SIZE_RESTORED
, MAKELPARAM(width
, height
));
599 bool wxFrame::MSWOnPaint(void)
602 wxDebugMsg("wxFrameWnd::OnPaint %d\n", handle
);
605 if (GetUpdateRect((HWND
) GetHWND(), &rect
, FALSE
))
611 the_icon
= (HICON
) m_icon
.GetHICON();
613 the_icon
= (HICON
) m_defaultIcon
;
616 // Hold a pointer to the dc so long as the OnPaint() message
617 // is being processed
618 HDC cdc
= BeginPaint((HWND
) GetHWND(), &ps
);
620 // Erase background before painting or we get white background
621 this->MSWDefWindowProc(WM_ICONERASEBKGND
,(WORD
)ps
.hdc
,0L);
626 GetClientRect((HWND
) GetHWND(), &rect
);
628 int icon_height
= 32;
629 int icon_x
= (int)((rect
.right
- icon_width
)/2);
630 int icon_y
= (int)((rect
.bottom
- icon_height
)/2);
631 DrawIcon(cdc
, icon_x
, icon_y
, the_icon
);
634 EndPaint((HWND
) GetHWND(), &ps
);
638 wxPaintEvent
event(m_windowId
);
639 event
.m_eventObject
= this;
640 if (!GetEventHandler()->ProcessEvent(event
))
648 WXHICON
wxFrame::MSWOnQueryDragIcon(void)
650 if (m_icon
.Ok() && (m_icon
.GetHICON() != 0))
651 return m_icon
.GetHICON();
653 return m_defaultIcon
;
656 void wxFrame::MSWOnSize(int x
, int y
, WXUINT id
)
659 wxDebugMsg("wxFrameWnd::OnSize %d\n", m_hWnd
);
674 // forward WM_SIZE to status bar control
675 #if USE_NATIVE_STATUSBAR
676 if (m_frameStatusBar
&& m_frameStatusBar
->IsKindOf(CLASSINFO(wxStatusBar95
)))
678 wxSizeEvent
event(wxSize(x
, y
), m_frameStatusBar
->GetId());
679 event
.SetEventObject( m_frameStatusBar
);
681 ((wxStatusBar95
*)m_frameStatusBar
)->OnSize(event
);
686 wxSizeEvent
event(wxSize(x
, y
), m_windowId
);
687 event
.SetEventObject( this );
688 if (!GetEventHandler()->ProcessEvent(event
))
693 bool wxFrame::MSWOnClose(void)
696 wxDebugMsg("wxFrameWnd::OnClose %d\n", handle
);
701 bool wxFrame::MSWOnCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
704 wxDebugMsg("wxFrameWnd::OnCommand %d\n", handle
);
706 if (cmd
== 0 || cmd
== 1 ) // Can be either a menu command or an accelerator.
708 // In case it's e.g. a toolbar.
709 wxWindow
*win
= wxFindWinFromHandle(control
);
711 return win
->MSWCommand(cmd
, id
);
713 if (GetMenuBar() && GetMenuBar()->FindItemForId(id
))
725 void wxFrame::MSWOnMenuHighlight(WXWORD nItem
, WXWORD nFlags
, WXHMENU hSysMenu
)
727 if (nFlags
== 0xFFFF && hSysMenu
== 0)
729 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, -1);
730 event
.SetEventObject( this );
731 GetEventHandler()->ProcessEvent(event
);
733 else if (nFlags
!= MF_SEPARATOR
)
735 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, nItem
);
736 event
.SetEventObject( this );
737 GetEventHandler()->ProcessEvent(event
);
741 bool wxFrame::MSWProcessMessage(WXMSG
* pMsg
)
743 if (m_acceleratorTable
!= 0 &&
744 ::TranslateAccelerator((HWND
) GetHWND(), (HACCEL
) m_acceleratorTable
, (MSG
*)pMsg
))
750 // Default resizing behaviour - if only ONE subwindow,
751 // resize to client rectangle size
752 void wxFrame::OnSize(wxSizeEvent
& event
)
754 // if we're using constraints - do use them
756 if ( GetAutoLayout() ) {
762 // do we have _exactly_ one child?
763 wxWindow
*child
= NULL
;
764 for ( wxNode
*node
= GetChildren()->First(); node
; node
= node
->Next() )
766 wxWindow
*win
= (wxWindow
*)node
->Data();
767 if ( !win
->IsKindOf(CLASSINFO(wxFrame
)) &&
768 !win
->IsKindOf(CLASSINFO(wxDialog
)) &&
769 (win
!= GetStatusBar()) &&
770 (win
!= GetToolBar()) )
773 return; // it's our second subwindow - nothing to do
779 // we have exactly one child - set it's size to fill the whole frame
780 int clientW
, clientH
;
781 GetClientSize(&clientW
, &clientH
);
786 // Manage the toolbar if there is one
790 GetToolBar()->GetSize(&wt
, &ht
);
793 GetToolBar()->SetSize(0, 0, clientW
, ht
);
796 child
->SetSize(x
, y
, clientW
, clientH
);
800 // Default activation behaviour - set the focus for the first child
802 void wxFrame::OnActivate(wxActivateEvent
& event
)
804 for(wxNode
*node
= GetChildren()->First(); node
; node
= node
->Next())
806 // Find a child that's a subwindow, but not a dialog box.
807 wxWindow
*child
= (wxWindow
*)node
->Data();
808 if (!child
->IsKindOf(CLASSINFO(wxFrame
)) &&
809 !child
->IsKindOf(CLASSINFO(wxDialog
)))
812 wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
820 // The default implementation for the close window event - calls
821 // OnClose for backward compatibility.
823 void wxFrame::OnCloseWindow(wxCloseEvent
& event
)
826 if ( GetEventHandler()->OnClose() || event
.GetForce())
832 bool wxFrame::OnClose(void)
837 // Destroy the window (delayed, if a managed window)
838 bool wxFrame::Destroy(void)
840 if (!wxPendingDelete
.Member(this))
841 wxPendingDelete
.Append(this);
845 // Default menu selection behaviour - display a help string
846 void wxFrame::OnMenuHighlight(wxMenuEvent
& event
)
850 if (event
.GetMenuId() == -1)
854 wxMenuBar
*menuBar
= GetMenuBar();
857 wxString
helpString(menuBar
->GetHelpString(event
.GetMenuId()));
858 if (helpString
!= "")
859 SetStatusText(helpString
);
865 wxMenuBar
*wxFrame::GetMenuBar(void) const
867 return m_frameMenuBar
;
870 void wxFrame::Centre(int direction
)
872 int display_width
, display_height
, width
, height
, x
, y
;
873 wxDisplaySize(&display_width
, &display_height
);
875 GetSize(&width
, &height
);
878 if (direction
& wxHORIZONTAL
)
879 x
= (int)((display_width
- width
)/2);
880 if (direction
& wxVERTICAL
)
881 y
= (int)((display_height
- height
)/2);
883 SetSize(x
, y
, width
, height
);
886 // Call this to simulate a menu command
887 void wxFrame::Command(int id
)
892 void wxFrame::ProcessCommand(int id
)
894 wxCommandEvent
commandEvent(wxEVENT_TYPE_MENU_COMMAND
, id
);
895 commandEvent
.SetInt( id
);
896 commandEvent
.SetEventObject( this );
898 wxMenuBar
*bar
= GetMenuBar() ;
902 wxMenuItem
*item
= bar
->FindItemForId(id
) ;
903 if (item
&& item
->IsCheckable())
905 bar
->Check(id
,!bar
->Checked(id
)) ;
907 GetEventHandler()->ProcessEvent(commandEvent
);
910 void wxFrame::OnIdle(wxIdleEvent
& event
)
915 // Query app for menu item updates (called from OnIdle)
916 void wxFrame::DoMenuUpdates(void)
918 wxMenuBar
* bar
= GetMenuBar();
923 for (i
= 0; i
< bar
->m_menuCount
; i
++)
925 wxMenu
* menu
= bar
->m_menus
[i
];
931 void wxFrame::DoMenuUpdates(wxMenu
* menu
)
933 wxNode
* node
= menu
->m_menuItems
.First();
936 wxMenuItem
* item
= (wxMenuItem
*) node
->Data();
937 if ( !item
->IsSeparator() )
939 wxWindowID id
= item
->GetId();
940 wxUpdateUIEvent
event(id
);
941 event
.SetEventObject( this );
943 if (GetEventHandler()->ProcessEvent(event
))
945 if (event
.GetSetText())
946 menu
->SetLabel(id
, event
.GetText());
947 if (event
.GetSetChecked())
948 menu
->Check(id
, event
.GetChecked());
949 if (event
.GetSetEnabled())
950 menu
->Enable(id
, event
.GetEnabled());
953 if (item
->GetSubMenu())
954 DoMenuUpdates(item
->GetSubMenu());