#endif //WX_PRECOMP
#include "wx/stockitem.h"
+#include "wx/aui/dockart.h"
enum MDI_MENU_ID
{
BEGIN_EVENT_TABLE(wxAuiMDIParentFrame, wxFrame)
#if wxUSE_MENUS
EVT_MENU (wxID_ANY, wxAuiMDIParentFrame::DoHandleMenu)
+ EVT_UPDATE_UI (wxID_ANY, wxAuiMDIParentFrame::DoHandleUpdateUI)
#endif
END_EVENT_TABLE()
event.Skip();
}
}
+
+void wxAuiMDIParentFrame::DoHandleUpdateUI(wxUpdateUIEvent& event)
+{
+ switch (event.GetId())
+ {
+ case wxWINDOWCLOSE:
+ case wxWINDOWCLOSEALL:
+ {
+ wxAuiMDIClientWindow* client_window = GetClientWindow();
+ wxCHECK_RET(client_window, wxS("Missing MDI Client Window"));
+ size_t pages = client_window->GetPageCount();
+ event.Enable(pages >= 1);
+ break;
+ }
+
+ case wxWINDOWNEXT:
+ case wxWINDOWPREV:
+ {
+ wxAuiMDIClientWindow* client_window = GetClientWindow();
+ wxCHECK_RET(client_window, wxS("Missing MDI Client Window"));
+ size_t pages = client_window->GetPageCount();
+ event.Enable(pages >= 2);
+ break;
+ }
+
+ default:
+ event.Skip();
+ }
+}
#endif // wxUSE_MENUS
void wxAuiMDIParentFrame::DoGetClientSize(int* width, int* height) const