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 implementation "wxpoem.h"
21 // For compilers that support precompilation, includes "wx.h".
22 #include "wx/wxprec.h"
43 #define buf_size 10000
44 #define DEFAULT_POETRY_DAT "wxpoem"
45 #define DEFAULT_POETRY_IND "wxpoem"
46 #define DEFAULT_CHAR_HEIGHT 18
47 #define DEFAULT_FONT "Swiss"
48 #define DEFAULT_X_POS 0
49 #define DEFAULT_Y_POS 0
50 #define BORDER_SIZE 30
51 #define THIN_LINE_BORDER 10
52 #define THICK_LINE_BORDER 16
53 #define THICK_LINE_WIDTH 2
54 #define SHADOW_OFFSET 1
58 static char *poem_buffer
; // Storage for each poem
59 static char line
[150]; // Storage for a line
60 static char title
[150]; // Remember the title
61 static char *search_string
= NULL
; // The search string
62 static int pages
[30]; // For multipage poems -
63 // store the start of each page
64 static long last_poem_start
= 0; // Start of last found poem
65 static long last_find
= -1; // Point in file of last found
67 static bool search_ok
= FALSE
; // Search was successful
68 static bool same_search
= FALSE
; // Searching on same string
70 static long poem_index
[600]; // Index of poem starts
71 static long nitems
= 0; // Number of poems
72 static int desired_char_height
= DEFAULT_CHAR_HEIGHT
; // Desired height
73 static char DesiredFont
[64]; // Chosen font
74 static int char_height
= DEFAULT_CHAR_HEIGHT
; // Actual height
75 static int index_ptr
= -1; // Pointer into index
76 static int poem_height
, poem_width
; // Size of poem
77 static int XPos
; // Startup X position
78 static int YPos
; // Startup Y position
79 static int pointSize
= 12; // Font size
81 static char *index_filename
= NULL
; // Index filename
82 static char *data_filename
= NULL
; // Data filename
83 static char error_buf
[300]; // Error message buffer
84 static bool loaded_ok
= FALSE
; // Poem loaded ok
85 static bool index_ok
= FALSE
; // Index loaded ok
87 static bool paging
= FALSE
; // Are we paging?
88 static int current_page
= 0; // Currently viewed page
90 wxIcon
*Corner1
= NULL
;
91 wxIcon
*Corner2
= NULL
;
92 wxIcon
*Corner3
= NULL
;
93 wxIcon
*Corner4
= NULL
;
96 wxFont
*NormalFont
= NULL
;
97 wxFont
*BoldFont
= NULL
;
98 wxFont
*ItalicFont
= NULL
;
101 wxPen
*GreyPen
= NULL
;
102 wxPen
*DarkGreyPen
= NULL
;
103 wxPen
*WhitePen
= NULL
;
106 wxBitmap
*backingBitmap
= NULL
;
108 void PoetryError(char *, char *caption
="wxPoem Error");
109 void PoetryNotify(char *Msg
, char *caption
="wxPoem");
111 bool LoadPoem(char *, long);
113 int LoadIndex(char *);
115 void WritePreferences();
116 void ReadPreferences();
117 void FindMax(int *max_thing
, int thing
);
120 void CopyToClipboard(HWND
, char *);
123 wxMenu
*popupMenu
= NULL
;
124 void PopupFunction(wxMenu
& menu
, wxCommandEvent
& event
);
126 wxHelpController
*HelpController
= NULL
;
128 // A macro needed for some compilers (AIX) that need 'main' to be defined
129 // in the application itself.
134 MainWindow
*TheMainWindow
= NULL
;
139 NormalFont
= wxTheFontList
->FindOrCreateFont(pointSize
, wxSWISS
, wxNORMAL
, wxNORMAL
);
140 BoldFont
= wxTheFontList
->FindOrCreateFont(pointSize
, wxSWISS
, wxNORMAL
, wxBOLD
);
141 ItalicFont
= wxTheFontList
->FindOrCreateFont(pointSize
, wxSWISS
, wxITALIC
, wxNORMAL
);
144 BEGIN_EVENT_TABLE(MainWindow
, wxFrame
)
145 EVT_CLOSE(MainWindow
::OnCloseWindow
)
146 EVT_CHAR(MainWindow
::OnChar
)
149 MainWindow
::MainWindow(wxFrame
*frame
, wxWindowID id
, const wxString
& title
,
150 const wxPoint
& pos
, const wxSize
& size
, long style
):
151 wxFrame(frame
, id
, title
, pos
, size
, style
)
155 // Read the poetry buffer, either for finding the size
156 // or for writing to a bitmap (not to the window directly,
157 // since that displays messily)
158 // If DrawIt is true, we draw, otherwise we just determine the
159 // size the window should be.
160 void MainWindow
::ScanBuffer(wxDC
*dc
, bool DrawIt
, int *max_x
, int *max_y
)
162 int i
= pages
[current_page
];
169 bool page_break
= FALSE
;
176 y
= (*max_y
- poem_height
)/2;
181 if (DrawIt
&& wxColourDisplay())
183 dc
->SetBrush(*wxLIGHT_GREY_BRUSH
);
184 dc
->SetPen(*GreyPen
);
185 dc
->DrawRectangle(0, 0, width
, height
);
186 dc
->SetBackgroundMode(wxTRANSPARENT
);
189 // See what ACTUAL char height is
190 dc
->SetFont(* NormalFont
);
193 dc
->GetTextExtent("X", &xx
, &yy
);
194 char_height
= (int)yy
;
196 if (current_page
== 0)
198 else if (title
[0] != 0)
200 dc
->SetFont(* BoldFont
);
201 dc
->GetTextExtent(title
, &xx
, &yy
);
202 FindMax(&curr_width
, (int)xx
);
207 dc
->SetFont(* BoldFont
);
209 // Change text to BLACK!
210 dc
->SetTextForeground(* wxBLACK
);
211 dc
->DrawText(title
, x
, y
);
212 // Change text to WHITE!
213 dc
->SetTextForeground(* wxWHITE
);
214 dc
->DrawText(title
, x
-SHADOW_OFFSET
, y
-SHADOW_OFFSET
);
220 while (ch
!= 0 && !page_break
)
224 while (((ch
= poem_buffer
[i
]) != 13) && (ch
!= 0))
226 while (((ch
= poem_buffer
[i
]) != 10) && (ch
!= 0))
243 // Add another to skip the linefeed
246 // If a single newline on its own, put a space in
268 dc
->SetFont(* BoldFont
);
271 strcpy(title
, line_ptr
);
272 strcat(title
, " (cont'd)");
274 dc
->GetTextExtent(line_ptr
, &xx
, &yy
);
275 FindMax(&curr_width
, (int)xx
);
280 dc
->SetFont(* BoldFont
);
282 // Change text to BLACK!
283 dc
->SetTextForeground(* wxBLACK
);
284 dc
->DrawText(line_ptr
, x
, y
);
286 // Change text to WHITE!
287 dc
->SetTextForeground(* wxWHITE
);
288 dc
->DrawText(line_ptr
, x
-SHADOW_OFFSET
, y
-SHADOW_OFFSET
);
289 dc
->SetTextForeground(* wxWHITE
);
295 dc
->SetFont(* ItalicFont
);
297 dc
->GetTextExtent(line_ptr
, &xx
, &yy
);
298 FindMax(&curr_width
, (int)xx
);
303 dc
->SetTextForeground(* wxBLACK
);
304 dc
->DrawText(line_ptr
, x
, y
);
308 // Default: just ignore this line
315 dc
->SetFont(* NormalFont
);
317 dc
->GetTextExtent(line
, &xx
, &yy
);
318 FindMax(&curr_width
, (int)xx
);
322 int x
= (int)((width
- xx
)/2.0);
323 dc
->SetFont(* NormalFont
);
324 dc
->SetTextForeground(* wxBLACK
);
325 dc
->DrawText(line
, (float)x
, (float)y
);
335 char *cont
= "(cont'd)";
337 dc
->SetFont(* NormalFont
);
339 dc
->GetTextExtent(cont
, &xx
, &yy
);
340 FindMax(&curr_width
, (int)xx
);
343 int x
= (int)((width
- xx
)/2.0);
344 dc
->SetFont(* NormalFont
);
345 dc
->SetTextForeground(* wxBLACK
);
346 dc
->DrawText(cont
, (float)x
, (float)y
);
351 *max_x
= (int)curr_width
;
352 *max_y
= (int)(y
-char_height
);
355 pages
[current_page
+1] = i
;
361 // Draw dark grey thick border
362 if (wxColourDisplay())
364 dc
->SetBrush(*wxGREY_BRUSH
);
365 dc
->SetPen(*wxGREY_PEN
);
368 dc
->DrawRectangle(0, 0, THIN_LINE_BORDER
, height
);
370 dc
->DrawRectangle(THIN_LINE_BORDER
, 0, width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
);
372 dc
->DrawRectangle(width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, width
, height
-THIN_LINE_BORDER
);
374 dc
->DrawRectangle(THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
, width
-THIN_LINE_BORDER
, height
);
377 // Have grey background, plus 3-d border -
378 // One black rectangle.
379 // Inside this, left and top sides - dark grey. Bottom and right -
382 // Change pen to black
383 dc
->SetPen(*wxBLACK_PEN
);
384 dc
->DrawLine(THIN_LINE_BORDER
, THIN_LINE_BORDER
, width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
);
385 dc
->DrawLine(width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, width
-THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
);
386 dc
->DrawLine(width
-THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
);
387 dc
->DrawLine(THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, THIN_LINE_BORDER
);
389 // Right and bottom white lines - 'grey' (black!) if
390 // we're running on a mono display.
391 if (wxColourDisplay())
392 dc
->SetPen(*WhitePen
);
394 dc
->SetPen(*DarkGreyPen
);
396 dc
->DrawLine(width
-THICK_LINE_BORDER
, THICK_LINE_BORDER
,
397 width
-THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
);
398 dc
->DrawLine(width
-THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
,
399 THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
);
401 // Left and top grey lines
402 dc
->SetPen(*DarkGreyPen
);
403 dc
->DrawLine(THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
,
404 THICK_LINE_BORDER
, THICK_LINE_BORDER
);
405 dc
->DrawLine(THICK_LINE_BORDER
, THICK_LINE_BORDER
,
406 width
-THICK_LINE_BORDER
, THICK_LINE_BORDER
);
410 dc
->DrawIcon(* Corner1
, 0.0, 0.0);
411 dc
->DrawIcon(* Corner2
, (float)(width
-32.0), 0.0);
413 int y2
= height
- 32;
415 dc
->DrawIcon(* Corner3
, 0.0, (float)y2
);
416 dc
->DrawIcon(* Corner4
, (float)x2
, (float)y2
);
421 // Get an index (randomly generated) and load the poem
422 void MainWindow
::GetIndexLoadPoem(void)
425 index_ptr
= GetIndex();
428 loaded_ok
= LoadPoem(data_filename
, -1);
431 // Find the size of the poem and resize the window accordingly
432 void MainWindow
::Resize(void)
434 wxClientDC
dc(canvas
);
437 ScanBuffer(& dc
, FALSE
, &poem_width
, &poem_height
);
438 int x
= poem_width
+ (2*BORDER_SIZE
);
439 int y
= poem_height
+ (2*BORDER_SIZE
);
443 // In case client size isn't what we set it to...
445 GetClientSize(&xx
, &yy
);
448 if (backingBitmap
) delete backingBitmap
;
449 backingBitmap
= new wxBitmap(x
, yy
);
450 memDC
.SelectObject(* backingBitmap
);
453 TheMainWindow
->ScanBuffer(&memDC
, TRUE
, &xx
, &yy
);
457 void FindMax(int *max_thing
, int thing
)
459 if (thing
> *max_thing
)
464 void MainWindow
::NextPage(void)
477 void MainWindow
::PreviousPage(void)
479 if (current_page
> 0)
486 // Search for a string
487 void MainWindow
::Search(bool ask
)
491 if (ask
|| !search_string
)
493 wxString s
= wxGetTextFromUser("Enter search string", "Search", (const char*) search_string
);
496 if (search_string
) delete[] search_string
;
497 search_string
= copystring(s
);
499 } else search_ok
= FALSE
;
507 if (search_string
&& search_ok
)
509 position
= DoSearch();
512 loaded_ok
= LoadPoem(data_filename
, position
);
518 PoetryNotify("Search string not found.");
523 // Copy a string to the clipboard
525 void CopyToClipboard(HWND handle
, char *s
)
527 int length
= strlen(s
);
528 HANDLE hGlobalMemory
= GlobalAlloc(GHND
, (DWORD
) length
+ 1);
531 #ifdef __WINDOWS_386__
532 LPSTR lpGlobalMemory
= MK_FP32(GlobalLock(hGlobalMemory
));
534 LPSTR lpGlobalMemory
= (LPSTR
)GlobalLock(hGlobalMemory
);
537 for (i
= 0; i
< length
; i
++)
555 lpGlobalMemory
[j
] = s
[i
];
560 GlobalUnlock(hGlobalMemory
);
561 OpenClipboard(handle
);
563 SetClipboardData(CF_TEXT
, hGlobalMemory
);
571 poem_buffer
= new char[buf_size
];
573 GreyPen
= new wxPen("LIGHT GREY", THICK_LINE_WIDTH
, wxSOLID
);
574 DarkGreyPen
= new wxPen("GREY", THICK_LINE_WIDTH
, wxSOLID
);
575 WhitePen
= new wxPen("WHITE", THICK_LINE_WIDTH
, wxSOLID
);
577 HelpController
= new wxHelpController();
578 HelpController
->Initialize("wxpoem");
584 // Seed the random number generator
587 (void)time(¤t_time
);
588 srand((unsigned int)current_time
);
593 TheMainWindow
= new MainWindow(NULL
, -1, "wxPoem", wxPoint(XPos
, YPos
), wxSize(100, 100), wxCAPTION
|wxMINIMIZE_BOX
|wxSYSTEM_MENU
);
596 TheMainWindow
->SetIcon(Icon("wxpoem"));
599 TheMainWindow
->canvas
= new MyCanvas(TheMainWindow
, -1, wxDefaultPosition
, wxDefaultSize
);
601 popupMenu
= new wxMenu("", (wxFunction
)PopupFunction
);
602 popupMenu
->Append(POEM_NEXT
, "Next poem/page");
603 popupMenu
->Append(POEM_PREVIOUS
, "Previous page");
604 popupMenu
->AppendSeparator();
605 popupMenu
->Append(POEM_SEARCH
, "Search");
606 popupMenu
->Append(POEM_NEXT_MATCH
, "Next match");
607 popupMenu
->Append(POEM_COPY
, "Copy to clipboard");
608 popupMenu
->Append(POEM_MINIMIZE
, "Minimize");
609 popupMenu
->AppendSeparator();
610 popupMenu
->Append(POEM_BIGGER_TEXT
, "Bigger text");
611 popupMenu
->Append(POEM_SMALLER_TEXT
, "Smaller text");
612 popupMenu
->AppendSeparator();
613 popupMenu
->Append(POEM_ABOUT
, "About wxPoem");
614 popupMenu
->AppendSeparator();
615 popupMenu
->Append(POEM_EXIT
, "Exit");
619 index_filename
= copystring(argv
[1]);
620 data_filename
= copystring(argv
[1]);
624 index_filename
= DEFAULT_POETRY_IND
;
625 data_filename
= DEFAULT_POETRY_DAT
;
630 Corner1
= new wxIcon("icon_1");
631 Corner2
= new wxIcon("icon_2");
632 Corner3
= new wxIcon("icon_3");
633 Corner4
= new wxIcon("icon_4");
636 TheMainWindow
->GetIndexLoadPoem();
637 TheMainWindow
->Resize();
638 TheMainWindow
->Show(TRUE
);
646 delete backingBitmap
;
647 delete HelpController
;
667 void MainWindow
::OnCloseWindow(wxCloseEvent
& event
)
673 void MainWindow
::OnChar(wxKeyEvent
& event
)
675 canvas
->OnChar(event
);
678 BEGIN_EVENT_TABLE(MyCanvas
, wxPanel
)
679 EVT_MOUSE_EVENTS(MyCanvas
::OnMouseEvent
)
680 EVT_CHAR(MyCanvas
::OnChar
)
681 EVT_PAINT(MyCanvas
::OnPaint
)
684 // Define a constructor for my canvas
685 MyCanvas
::MyCanvas(wxFrame
*frame
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
):
686 wxPanel(frame
, id
, pos
, size
)
690 // Define the repainting behaviour
691 void MyCanvas
::OnPaint(wxPaintEvent
& event
)
698 TheMainWindow
->GetClientSize(&xx
, &yy
);
701 memDC
.SelectObject(* backingBitmap
);
702 dc
.Blit(0, 0, backingBitmap
->GetWidth(), backingBitmap
->GetHeight(), &memDC
, 0, 0);
706 void MyCanvas
::OnMouseEvent(wxMouseEvent
& event
)
709 event
.Position(&x
, &y
);
710 static int startPosX
, startPosY
, startFrameX
, startFrameY
;
712 event
.Position(&x
, &y
);
714 if (event
.RightDown())
716 // Versions from wxWin 1.67 are probably OK
718 FakePopupMenu(popupMenu
, x
, y
);
720 PopupMenu(popupMenu
, x
, y
);
723 else if (event
.LeftDown())
725 this->CaptureMouse();
728 ClientToScreen(&x1
, &y1
);
731 GetParent()->GetPosition(&startFrameX
, &startFrameY
);
733 else if (event
.LeftUp())
734 this->ReleaseMouse();
735 else if (event
.Dragging() && event
.LeftIsDown())
739 ClientToScreen(&x1
, &y1
);
741 int dX
= x1
- startPosX
;
742 int dY
= y1
- startPosY
;
743 GetParent()->Move(startFrameX
+ dX
, startFrameY
+ dY
);
747 // Process characters
748 void MyCanvas
::OnChar(wxKeyEvent
& event
)
750 switch (event
.KeyCode())
755 TheMainWindow
->Search(FALSE
);
760 TheMainWindow
->Search(TRUE
);
764 TheMainWindow
->NextPage();
767 TheMainWindow
->Close(TRUE
);
774 int LoadIndex(char *file_name
)
783 sprintf(buf
, "%s.idx", file_name
);
784 if (! (file_name
&& (index_file
= fopen(buf
, "r"))))
788 fscanf(index_file
, "%ld", &nitems
);
790 for (i
= 0; i
< nitems
; i
++)
792 fscanf(index_file
, "%ld", &data
);
793 poem_index
[i
] = data
;
806 indexn
= (int)(rand() % nitems
);
808 if ((indexn
< 0) || (indexn
> nitems
))
809 { PoetryError("No such poem!");
817 void ReadPreferences()
819 wxGetResource("wxPoem", "FontSize", &pointSize
);
820 wxGetResource("wxPoem", "X", &XPos
);
821 wxGetResource("wxPoem", "Y", &YPos
);
824 // Write preferences to disk
825 void WritePreferences()
828 TheMainWindow
->GetPosition(&XPos
, &YPos
);
829 wxWriteResource("wxPoem", "FontSize", pointSize
);
830 wxWriteResource("wxPoem", "X", XPos
);
831 wxWriteResource("wxPoem", "Y", YPos
);
835 // Load a poem from given file, at given point in file.
836 // If position is > -1, use this for the position in the
837 // file, otherwise use index[index_ptr] to find the correct position.
838 bool LoadPoem(char *file_name
, long position
)
852 sprintf(buf
, "%s.dat", file_name
);
854 if (! (file_name
&& (data_file
= fopen(buf
, "r"))))
856 sprintf(error_buf
, "Data file %s not found.", buf
);
857 PoetryError(error_buf
);
865 data
= poem_index
[index_ptr
];
867 fseek(data_file
, data
, SEEK_SET
);
871 while ((ch
!= EOF
) && (ch
!= '#'))
873 ch
= getc(data_file
);
874 // Add a linefeed so it will copy to the clipboard ok
886 sprintf(error_buf
, "%s", "Poetry buffer exceeded.");
887 PoetryError(error_buf
);
892 poem_buffer
[i
-1] = 0;
898 long MainWindow
::DoSearch(void)
908 long previous_poem_start
;
911 int search_length
= strlen(search_string
);
915 find_start
= last_find
+ 1;
916 previous_poem_start
= last_poem_start
;
922 previous_poem_start
= -1;
926 sprintf(buf
, "%s.dat", data_filename
);
928 if (! (data_filename
&& (file
= fopen(buf
, "r"))))
930 sprintf(error_buf
, "Poetry data file %s not found\n", buf
);
931 PoetryError(error_buf
);
935 fseek(file
, find_start
, SEEK_SET
);
937 while ((ch
!= EOF
) && !found
)
940 ch
|= 0x0020; // Make lower case
942 // Only match if we're looking at a different poem
943 // (no point in displaying the same poem again)
944 if ((ch
== search_string
[i
]) && (last_poem_start
!= previous_poem_start
))
947 last_find
= ftell(file
);
948 if (i
== search_length
-1)
958 last_poem_start
= ftell(file
);
967 return last_poem_start
;
973 // Set up poetry filenames, preferences, load the index
974 // Load index (or compile it if none found)
977 index_ok
= LoadIndex(index_filename
);
978 if (!index_ok
|| (nitems
== 0))
980 PoetryError("Index file not found; will compile new one", "wxPoem");
981 index_ok
= Compile();
986 void PoetryError(char *msg
, char *caption
)
988 wxMessageBox(msg
, caption
, wxOK
|wxICON_EXCLAMATION
);
991 // Notification (change icon to something appropriate!)
992 void PoetryNotify(char *Msg
, char *caption
)
994 wxMessageBox(Msg
, caption
, wxOK
| wxICON_INFORMATION
);
997 // Build up and save an index into the poetry data file, for
998 // rapid random access
1008 sprintf(buf
, "%s.dat", data_filename
);
1010 if (! (data_filename
&& (file
= fopen(buf
, "r"))))
1012 sprintf(error_buf
, "Poetry data file %s not found\n", buf
);
1013 PoetryError(error_buf
);
1020 poem_index
[nitems
] = 0;
1033 poem_index
[nitems
] = data
;
1040 sprintf(buf
, "%s.idx", index_filename
);
1041 if (! (data_filename
&& (file
= fopen(buf
, "w"))))
1043 sprintf(error_buf
, "Poetry index file %s cannot be created\n", buf
);
1044 PoetryError(error_buf
);
1048 fprintf(file
, "%ld\n\n", nitems
);
1049 for (j
= 0; j
< nitems
; j
++)
1050 fprintf(file
, "%ld\n", poem_index
[j
]);
1053 PoetryNotify("Poetry index compiled.");
1057 void PopupFunction(wxMenu
& menu
, wxCommandEvent
& event
)
1059 switch (event
.m_commandInt
)
1062 // Another poem/page
1063 TheMainWindow
->NextPage();
1067 TheMainWindow
->PreviousPage();
1070 // Search - with dialog
1071 TheMainWindow
->Search(TRUE
);
1073 case POEM_NEXT_MATCH
:
1074 // Search - without dialog (next match)
1075 TheMainWindow
->Search(FALSE
);
1078 TheMainWindow
->Iconize(TRUE
);
1082 // Copy current poem to the clipboard
1083 CopyToClipboard((HWND
) TheMainWindow
->GetHWND(), poem_buffer
);
1090 case POEM_BIGGER_TEXT
:
1094 TheMainWindow
->Resize();
1097 case POEM_SMALLER_TEXT
:
1103 TheMainWindow
->Resize();
1107 case POEM_HELP_CONTENTS
:
1109 HelpController
->LoadFile("wxpoem");
1110 HelpController
->DisplayContents();
1115 (void)wxMessageBox("wxPoem Version 1.1\nJulian Smart (c) 1995",
1116 "About wxPoem", wxOK
, TheMainWindow
);
1121 TheMainWindow
->Close(TRUE
);