]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/mdi/mdi.h
For wxGTK2, link with X11 explicitly, since we use many X11 functions directly.
[wxWidgets.git] / samples / mdi / mdi.h
index 48f18dbf58a6446b3cacb2f5f60603e56c81a11a..4d84f6cf494290eaed91465ae161b6778fc0f731 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/toolbar.h"
@@ -45,6 +45,8 @@ public:
     MyFrame();
     virtual ~MyFrame();
 
+    static wxMenuBar *CreateMainMenubar();
+
 private:
     void InitToolBar(wxToolBar* toolBar);
 
@@ -53,6 +55,8 @@ private:
     void OnNewWindow(wxCommandEvent& event);
     void OnFullScreen(wxCommandEvent& event);
     void OnQuit(wxCommandEvent& event);
+    void OnCloseAll(wxCommandEvent& event);
+
     void OnClose(wxCloseEvent& event);
 
     wxTextCtrl *m_textWindow;
@@ -90,13 +94,33 @@ private:
 
     MyCanvas *m_canvas;
 
+    // simple test event handler class
+    class EventHandler : public wxEvtHandler
+    {
+    public:
+        EventHandler(unsigned numChild) : m_numChild(numChild) { }
+
+    private:
+        void OnRefresh(wxCommandEvent& event)
+        {
+            wxLogMessage("Child #%u refreshed.", m_numChild);
+            event.Skip();
+        }
+
+        const unsigned m_numChild;
+
+        DECLARE_EVENT_TABLE()
+
+        wxDECLARE_NO_COPY_CLASS(EventHandler);
+    };
+
     DECLARE_EVENT_TABLE()
 };
 
 // menu items ids
 enum
 {
-    MDI_FULLSCREEN,
+    MDI_FULLSCREEN = 100,
     MDI_REFRESH,
     MDI_CHANGE_TITLE,
     MDI_CHANGE_POSITION,