]>
git.saurik.com Git - wxWidgets.git/blob - samples/wxpoem/wxpoem.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: A small C++ program which displays a random poem on
4 // execution. It also allows search for poems containing a
6 // It requires winpoem.dat and creates winpoem.idx.
7 // Original version (WinPoem) written in 1994.
8 // This has not been rewritten in a long time so
9 // beware, inelegant code!
10 // Author: Julian Smart
13 // Copyright: (c) 1998 Julian Smart
14 // Licence: wxWindows licence
15 /////////////////////////////////////////////////////////////////////////////
18 #pragma interface "wxpoem.h"
21 // Define a new application
22 class MyApp
: public wxApp
31 // Define a new canvas which can receive some events
32 class MyCanvas
: public wxPanel
35 MyCanvas(wxFrame
*frame
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
);
37 void OnPaint(wxPaintEvent
& event
);
38 void OnMouseEvent(wxMouseEvent
& event
);
39 void OnChar(wxKeyEvent
& event
);
45 class MainWindow
: public wxFrame
49 MainWindow(wxFrame
*frame
, wxWindowID id
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
, long style
);
51 void OnCloseWindow(wxCloseEvent
& event
);
52 void OnChar(wxKeyEvent
& event
);
54 // Display next page or poem
57 // Display previous page
58 void PreviousPage(void);
63 // Look in file for string
66 // Do the actual drawing of text (or just calculate size needed)
67 void ScanBuffer(wxDC
*dc
, bool DrawIt
, int *max_x
, int *max_y
);
70 void GetIndexLoadPoem(void);
78 #define POEM_PREVIOUS 101
80 #define POEM_SEARCH 103
81 #define POEM_NEXT_MATCH 104
82 #define POEM_ABOUT 105
84 #define POEM_COMPILE 107
85 #define POEM_HELP_CONTENTS 108
86 #define POEM_BIGGER_TEXT 109
87 #define POEM_SMALLER_TEXT 110
88 #define POEM_MINIMIZE 111