]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/poem/wxpoem.h
don't eat all events if m_maxLength is 0: this means no limit according to the docs...
[wxWidgets.git] / demos / poem / wxpoem.h
index 2f65c220edffa514d7fcacd370247a4457fdad8c..6f84d621fe4258f624b785d1034f1cad4309f766 100644 (file)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma interface "wxpoem.h"
-#endif
-
 // Define a new application
 class MyApp: public wxApp
 {
-  public:
+public:
     bool OnInit();
     int OnExit();
 };
@@ -31,20 +27,24 @@ DECLARE_APP(MyApp)
 // Define a new canvas which can receive some events
 class MyCanvas: public wxWindow
 {
-  public:
-    MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size);
+public:
+    MyCanvas(wxFrame *frame);
+    ~MyCanvas();
 
     void OnPaint(wxPaintEvent& event);
     void OnMouseEvent(wxMouseEvent& event);
     void OnChar(wxKeyEvent& event);
 
+private:
+    wxMenu *m_popupMenu;
+
     DECLARE_EVENT_TABLE()
 };
 
 // Define a new frame
 class MainWindow: public wxFrame
 {
-  public:
+public:
     MyCanvas *canvas;
     MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
     ~MainWindow();
@@ -72,21 +72,38 @@ class MainWindow: public wxFrame
     void GetIndexLoadPoem(void);
     void Resize(void);
 
-DECLARE_EVENT_TABLE()
-};
+private:
 
-// Menu items
-#define         POEM_NEXT       100
-#define         POEM_PREVIOUS   101
-#define         POEM_COPY       102
-#define         POEM_SEARCH     103
-#define         POEM_NEXT_MATCH 104
-#define         POEM_ABOUT      105
-#define         POEM_EXIT       106
-#define         POEM_COMPILE    107
-#define         POEM_HELP_CONTENTS 108
-#define         POEM_BIGGER_TEXT 109
-#define         POEM_SMALLER_TEXT 110
-#define         POEM_MINIMIZE   111
+    wxString m_searchString;
+    wxString m_title;
+
+    // Preferences
+    void WritePreferences();
+    void ReadPreferences();
+
+    // Fonts
+    void CreateFonts();
+    wxFont *m_normalFont;
+    wxFont *m_boldFont;
+    wxFont *m_italicFont;
 
+    // Icons
+    wxIcon *m_corners[4];
 
+    DECLARE_EVENT_TABLE()
+};
+
+// Menu items
+enum
+{
+    POEM_ABOUT         = wxID_ABOUT,
+    POEM_EXIT          = wxID_EXIT,
+    POEM_PREVIOUS      = wxID_BACKWARD,
+    POEM_COPY          = wxID_COPY,
+    POEM_NEXT          = wxID_FORWARD,
+    POEM_NEXT_MATCH    = wxID_MORE,
+    POEM_BIGGER_TEXT   = wxID_ZOOM_IN,
+    POEM_SMALLER_TEXT  = wxID_ZOOM_OUT,
+    POEM_SEARCH        = wxID_FIND,
+    POEM_MINIMIZE      = wxID_ICONIZE_FRAME
+};