]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/poem/wxpoem.h
Remove USE_GDIPLUS setting from bakefiles.
[wxWidgets.git] / demos / poem / wxpoem.h
index 6809d1d97e376902dd8b246dd71e3e9ba35be18b..c8975779c2957828bced312519daa49e48730430 100644 (file)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(__APPLE__)
-#pragma interface "wxpoem.h"
-#endif
+#ifndef _WXPOEM_H_
+#define _WXPOEM_H_
+
 
 // Define a new application
 class MyApp: public wxApp
 {
-  public:
+public:
     bool OnInit();
     int OnExit();
 };
@@ -31,25 +31,28 @@ 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);
-    ~MyCanvas();
+public:
+    MyCanvas(wxFrame *frame);
+    virtual ~MyCanvas();
 
     void OnPaint(wxPaintEvent& event);
     void OnMouseEvent(wxMouseEvent& event);
     void OnChar(wxKeyEvent& event);
 
+private:
+    wxMenu *m_popupMenu;
+
     DECLARE_EVENT_TABLE()
-  private:
-    wxMenu *popupMenu;
 };
 
 // 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(wxFrame *frame, wxWindowID id, const wxString& title,
+               const wxPoint& pos, const wxSize& size, long style);
+    virtual ~MainWindow();
 
     void OnCloseWindow(wxCloseEvent& event);
     void OnChar(wxKeyEvent& event);
@@ -74,21 +77,40 @@ class MainWindow: public wxFrame
     void GetIndexLoadPoem(void);
     void Resize(void);
 
+private:
+
+    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_NEXT = wxID_HIGHEST,
-    POEM_PREVIOUS,
-    POEM_COPY,
-    POEM_SEARCH,
-    POEM_NEXT_MATCH,
-    POEM_ABOUT,
-    POEM_EXIT,
-    POEM_COMPILE,
-    POEM_BIGGER_TEXT,
-    POEM_SMALLER_TEXT,
-    POEM_MINIMIZE
+    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
 };
+
+#endif      // _WXPOEM_H_