]>
git.saurik.com Git - wxWidgets.git/blob - samples/wxpoem/wxpoem.cpp
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"
39 #include "corner1.xpm"
40 #include "corner2.xpm"
41 #include "corner3.xpm"
42 #include "corner4.xpm"
50 #define buf_size 10000
51 #define DEFAULT_POETRY_DAT "wxpoem"
52 #define DEFAULT_POETRY_IND "wxpoem"
53 #define DEFAULT_CHAR_HEIGHT 18
54 #define DEFAULT_FONT "Swiss"
55 #define DEFAULT_X_POS 0
56 #define DEFAULT_Y_POS 0
57 #define BORDER_SIZE 30
58 #define THIN_LINE_BORDER 10
59 #define THICK_LINE_BORDER 16
60 #define THICK_LINE_WIDTH 2
61 #define SHADOW_OFFSET 1
65 static char *poem_buffer
; // Storage for each poem
66 static char line
[150]; // Storage for a line
67 static char title
[150]; // Remember the title
68 static char *search_string
= NULL
; // The search string
69 static int pages
[30]; // For multipage poems -
70 // store the start of each page
71 static long last_poem_start
= 0; // Start of last found poem
72 static long last_find
= -1; // Point in file of last found
74 static bool search_ok
= FALSE
; // Search was successful
75 static bool same_search
= FALSE
; // Searching on same string
77 static long poem_index
[600]; // Index of poem starts
78 static long nitems
= 0; // Number of poems
79 static int desired_char_height
= DEFAULT_CHAR_HEIGHT
; // Desired height
80 static char DesiredFont
[64]; // Chosen font
81 static int char_height
= DEFAULT_CHAR_HEIGHT
; // Actual height
82 static int index_ptr
= -1; // Pointer into index
83 static int poem_height
, poem_width
; // Size of poem
84 static int XPos
; // Startup X position
85 static int YPos
; // Startup Y position
86 static int pointSize
= 12; // Font size
88 static char *index_filename
= NULL
; // Index filename
89 static char *data_filename
= NULL
; // Data filename
90 static char error_buf
[300]; // Error message buffer
91 static bool loaded_ok
= FALSE
; // Poem loaded ok
92 static bool index_ok
= FALSE
; // Index loaded ok
94 static bool paging
= FALSE
; // Are we paging?
95 static int current_page
= 0; // Currently viewed page
97 wxIcon
*Corner1
= NULL
;
98 wxIcon
*Corner2
= NULL
;
99 wxIcon
*Corner3
= NULL
;
100 wxIcon
*Corner4
= NULL
;
103 wxFont
*NormalFont
= NULL
;
104 wxFont
*BoldFont
= NULL
;
105 wxFont
*ItalicFont
= NULL
;
108 wxPen
*GreyPen
= NULL
;
109 wxPen
*DarkGreyPen
= NULL
;
110 wxPen
*WhitePen
= NULL
;
113 wxBitmap
*backingBitmap
= NULL
;
115 void PoetryError(char *, char *caption
="wxPoem Error");
116 void PoetryNotify(char *Msg
, char *caption
="wxPoem");
118 bool LoadPoem(char *, long);
120 int LoadIndex(char *);
122 void WritePreferences();
123 void ReadPreferences();
124 void FindMax(int *max_thing
, int thing
);
127 void CopyToClipboard(HWND
, char *);
130 wxMenu
*popupMenu
= NULL
;
131 void PopupFunction(wxMenu
& menu
, wxCommandEvent
& event
);
133 wxHelpController
*HelpController
= NULL
;
135 // A macro needed for some compilers (AIX) that need 'main' to be defined
136 // in the application itself.
141 MainWindow
*TheMainWindow
= NULL
;
146 NormalFont
= wxTheFontList
->FindOrCreateFont(pointSize
, wxSWISS
, wxNORMAL
, wxNORMAL
);
147 BoldFont
= wxTheFontList
->FindOrCreateFont(pointSize
, wxSWISS
, wxNORMAL
, wxBOLD
);
148 ItalicFont
= wxTheFontList
->FindOrCreateFont(pointSize
, wxSWISS
, wxITALIC
, wxNORMAL
);
151 BEGIN_EVENT_TABLE(MainWindow
, wxFrame
)
152 EVT_CLOSE(MainWindow::OnCloseWindow
)
153 EVT_CHAR(MainWindow::OnChar
)
156 MainWindow::MainWindow(wxFrame
*frame
, wxWindowID id
, const wxString
& title
,
157 const wxPoint
& pos
, const wxSize
& size
, long style
):
158 wxFrame(frame
, id
, title
, pos
, size
, style
)
162 // Read the poetry buffer, either for finding the size
163 // or for writing to a bitmap (not to the window directly,
164 // since that displays messily)
165 // If DrawIt is true, we draw, otherwise we just determine the
166 // size the window should be.
167 void MainWindow::ScanBuffer(wxDC
*dc
, bool DrawIt
, int *max_x
, int *max_y
)
169 int i
= pages
[current_page
];
176 bool page_break
= FALSE
;
183 y
= (*max_y
- poem_height
)/2;
188 if (DrawIt
&& wxColourDisplay())
190 dc
->SetBrush(*wxLIGHT_GREY_BRUSH
);
191 dc
->SetPen(*GreyPen
);
192 dc
->DrawRectangle(0, 0, width
, height
);
193 dc
->SetBackgroundMode(wxTRANSPARENT
);
196 // See what ACTUAL char height is
197 dc
->SetFont(* NormalFont
);
200 dc
->GetTextExtent("X", &xx
, &yy
);
201 char_height
= (int)yy
;
203 if (current_page
== 0)
205 else if (title
[0] != 0)
207 dc
->SetFont(* BoldFont
);
208 dc
->GetTextExtent(title
, &xx
, &yy
);
209 FindMax(&curr_width
, (int)xx
);
214 dc
->SetFont(* BoldFont
);
216 // Change text to BLACK!
217 dc
->SetTextForeground(* wxBLACK
);
218 dc
->DrawText(title
, x
, y
);
219 // Change text to WHITE!
220 dc
->SetTextForeground(* wxWHITE
);
221 dc
->DrawText(title
, x
-SHADOW_OFFSET
, y
-SHADOW_OFFSET
);
227 while (ch
!= 0 && !page_break
)
231 while (((ch
= poem_buffer
[i
]) != 13) && (ch
!= 0))
233 while (((ch
= poem_buffer
[i
]) != 10) && (ch
!= 0))
250 // Add another to skip the linefeed
253 // If a single newline on its own, put a space in
275 dc
->SetFont(* BoldFont
);
278 strcpy(title
, line_ptr
);
279 strcat(title
, " (cont'd)");
281 dc
->GetTextExtent(line_ptr
, &xx
, &yy
);
282 FindMax(&curr_width
, (int)xx
);
287 dc
->SetFont(* BoldFont
);
289 // Change text to BLACK!
290 dc
->SetTextForeground(* wxBLACK
);
291 dc
->DrawText(line_ptr
, x
, y
);
293 // Change text to WHITE!
294 dc
->SetTextForeground(* wxWHITE
);
295 dc
->DrawText(line_ptr
, x
-SHADOW_OFFSET
, y
-SHADOW_OFFSET
);
296 dc
->SetTextForeground(* wxWHITE
);
302 dc
->SetFont(* ItalicFont
);
304 dc
->GetTextExtent(line_ptr
, &xx
, &yy
);
305 FindMax(&curr_width
, (int)xx
);
310 dc
->SetTextForeground(* wxBLACK
);
311 dc
->DrawText(line_ptr
, x
, y
);
315 // Default: just ignore this line
322 dc
->SetFont(* NormalFont
);
324 dc
->GetTextExtent(line
, &xx
, &yy
);
325 FindMax(&curr_width
, (int)xx
);
329 int x
= (int)((width
- xx
)/2.0);
330 dc
->SetFont(* NormalFont
);
331 dc
->SetTextForeground(* wxBLACK
);
332 dc
->DrawText(line
, x
, y
);
342 char *cont
= "(cont'd)";
344 dc
->SetFont(* NormalFont
);
346 dc
->GetTextExtent(cont
, &xx
, &yy
);
347 FindMax(&curr_width
, (int)xx
);
350 int x
= (int)((width
- xx
)/2.0);
351 dc
->SetFont(* NormalFont
);
352 dc
->SetTextForeground(* wxBLACK
);
353 dc
->DrawText(cont
, x
, y
);
358 *max_x
= (int)curr_width
;
359 *max_y
= (int)(y
-char_height
);
362 pages
[current_page
+1] = i
;
368 // Draw dark grey thick border
369 if (wxColourDisplay())
371 dc
->SetBrush(*wxGREY_BRUSH
);
372 dc
->SetPen(*wxGREY_PEN
);
375 dc
->DrawRectangle(0, 0, THIN_LINE_BORDER
, height
);
377 dc
->DrawRectangle(THIN_LINE_BORDER
, 0, width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
);
379 dc
->DrawRectangle(width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, width
, height
-THIN_LINE_BORDER
);
381 dc
->DrawRectangle(THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
, width
-THIN_LINE_BORDER
, height
);
384 // Have grey background, plus 3-d border -
385 // One black rectangle.
386 // Inside this, left and top sides - dark grey. Bottom and right -
389 // Change pen to black
390 dc
->SetPen(*wxBLACK_PEN
);
391 dc
->DrawLine(THIN_LINE_BORDER
, THIN_LINE_BORDER
, width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
);
392 dc
->DrawLine(width
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, width
-THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
);
393 dc
->DrawLine(width
-THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
);
394 dc
->DrawLine(THIN_LINE_BORDER
, height
-THIN_LINE_BORDER
, THIN_LINE_BORDER
, THIN_LINE_BORDER
);
396 // Right and bottom white lines - 'grey' (black!) if
397 // we're running on a mono display.
398 if (wxColourDisplay())
399 dc
->SetPen(*WhitePen
);
401 dc
->SetPen(*DarkGreyPen
);
403 dc
->DrawLine(width
-THICK_LINE_BORDER
, THICK_LINE_BORDER
,
404 width
-THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
);
405 dc
->DrawLine(width
-THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
,
406 THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
);
408 // Left and top grey lines
409 dc
->SetPen(*DarkGreyPen
);
410 dc
->DrawLine(THICK_LINE_BORDER
, height
-THICK_LINE_BORDER
,
411 THICK_LINE_BORDER
, THICK_LINE_BORDER
);
412 dc
->DrawLine(THICK_LINE_BORDER
, THICK_LINE_BORDER
,
413 width
-THICK_LINE_BORDER
, THICK_LINE_BORDER
);
417 dc
->DrawIcon(* Corner1
, 0, 0);
418 dc
->DrawIcon(* Corner2
, int(width
-32), 0);
420 int y2
= height
- 32;
422 dc
->DrawIcon(* Corner3
, 0, y2
);
423 dc
->DrawIcon(* Corner4
, x2
, y2
);
428 // Get an index (randomly generated) and load the poem
429 void MainWindow::GetIndexLoadPoem(void)
432 index_ptr
= GetIndex();
435 loaded_ok
= LoadPoem(data_filename
, -1);
438 // Find the size of the poem and resize the window accordingly
439 void MainWindow::Resize(void)
441 wxClientDC
dc(canvas
);
444 ScanBuffer(& dc
, FALSE
, &poem_width
, &poem_height
);
445 int x
= poem_width
+ (2*BORDER_SIZE
);
446 int y
= poem_height
+ (2*BORDER_SIZE
);
450 // In case client size isn't what we set it to...
452 GetClientSize(&xx
, &yy
);
455 if (backingBitmap
) delete backingBitmap
;
456 backingBitmap
= new wxBitmap(x
, yy
);
457 memDC
.SelectObject(* backingBitmap
);
460 TheMainWindow
->ScanBuffer(&memDC
, TRUE
, &xx
, &yy
);
464 void FindMax(int *max_thing
, int thing
)
466 if (thing
> *max_thing
)
471 void MainWindow::NextPage(void)
484 void MainWindow::PreviousPage(void)
486 if (current_page
> 0)
493 // Search for a string
494 void MainWindow::Search(bool ask
)
498 if (ask
|| !search_string
)
500 wxString s
= wxGetTextFromUser("Enter search string", "Search", (const char*) search_string
);
503 if (search_string
) delete[] search_string
;
504 search_string
= copystring(s
);
506 } else search_ok
= FALSE
;
514 if (search_string
&& search_ok
)
516 position
= DoSearch();
519 loaded_ok
= LoadPoem(data_filename
, position
);
525 PoetryNotify("Search string not found.");
530 // Copy a string to the clipboard
532 void CopyToClipboard(HWND handle
, char *s
)
534 int length
= strlen(s
);
535 HANDLE hGlobalMemory
= GlobalAlloc(GHND
, (DWORD
) length
+ 1);
538 #ifdef __WINDOWS_386__
539 LPSTR lpGlobalMemory
= MK_FP32(GlobalLock(hGlobalMemory
));
541 LPSTR lpGlobalMemory
= (LPSTR
)GlobalLock(hGlobalMemory
);
544 for (i
= 0; i
< length
; i
++)
562 lpGlobalMemory
[j
] = s
[i
];
567 GlobalUnlock(hGlobalMemory
);
568 OpenClipboard(handle
);
570 SetClipboardData(CF_TEXT
, hGlobalMemory
);
578 poem_buffer
= new char[buf_size
];
580 GreyPen
= new wxPen("LIGHT GREY", THICK_LINE_WIDTH
, wxSOLID
);
581 DarkGreyPen
= new wxPen("GREY", THICK_LINE_WIDTH
, wxSOLID
);
582 WhitePen
= new wxPen("WHITE", THICK_LINE_WIDTH
, wxSOLID
);
584 HelpController
= new wxHelpController();
585 HelpController
->Initialize("wxpoem");
591 // Seed the random number generator
594 (void)time(¤t_time
);
595 srand((unsigned int)current_time
);
600 TheMainWindow
= new MainWindow(NULL
, -1, "wxPoem", wxPoint(XPos
, YPos
), wxSize(100, 100), wxCAPTION
|wxMINIMIZE_BOX
|wxSYSTEM_MENU
);
603 TheMainWindow
->SetIcon(Icon("wxpoem"));
606 TheMainWindow
->canvas
= new MyCanvas(TheMainWindow
, -1, wxDefaultPosition
, wxDefaultSize
);
608 popupMenu
= new wxMenu("", (wxFunction
)PopupFunction
);
609 popupMenu
->Append(POEM_NEXT
, "Next poem/page");
610 popupMenu
->Append(POEM_PREVIOUS
, "Previous page");
611 popupMenu
->AppendSeparator();
612 popupMenu
->Append(POEM_SEARCH
, "Search");
613 popupMenu
->Append(POEM_NEXT_MATCH
, "Next match");
614 popupMenu
->Append(POEM_COPY
, "Copy to clipboard");
615 popupMenu
->Append(POEM_MINIMIZE
, "Minimize");
616 popupMenu
->AppendSeparator();
617 popupMenu
->Append(POEM_BIGGER_TEXT
, "Bigger text");
618 popupMenu
->Append(POEM_SMALLER_TEXT
, "Smaller text");
619 popupMenu
->AppendSeparator();
620 popupMenu
->Append(POEM_ABOUT
, "About wxPoem");
621 popupMenu
->AppendSeparator();
622 popupMenu
->Append(POEM_EXIT
, "Exit");
626 index_filename
= copystring(argv
[1]);
627 data_filename
= copystring(argv
[1]);
631 index_filename
= DEFAULT_POETRY_IND
;
632 data_filename
= DEFAULT_POETRY_DAT
;
637 Corner1
= new wxIcon("icon_1");
638 Corner2
= new wxIcon("icon_2");
639 Corner3
= new wxIcon("icon_3");
640 Corner4
= new wxIcon("icon_4");
643 Corner1
= new wxIcon( corner1_xpm
);
644 Corner2
= new wxIcon( corner2_xpm
);
645 Corner3
= new wxIcon( corner3_xpm
);
646 Corner4
= new wxIcon( corner4_xpm
);
649 TheMainWindow
->GetIndexLoadPoem();
650 TheMainWindow
->Resize();
651 TheMainWindow
->Show(TRUE
);
659 delete backingBitmap
;
660 delete HelpController
;
681 void MainWindow::OnCloseWindow(wxCloseEvent
& WXUNUSED(event
))
687 void MainWindow::OnChar(wxKeyEvent
& event
)
689 canvas
->OnChar(event
);
692 BEGIN_EVENT_TABLE(MyCanvas
, wxPanel
)
693 EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent
)
694 EVT_CHAR(MyCanvas::OnChar
)
695 EVT_PAINT(MyCanvas::OnPaint
)
698 // Define a constructor for my canvas
699 MyCanvas::MyCanvas(wxFrame
*frame
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
):
700 wxPanel(frame
, id
, pos
, size
)
704 // Define the repainting behaviour
705 void MyCanvas::OnPaint(wxPaintEvent
& WXUNUSED(event
))
712 TheMainWindow
->GetClientSize(&xx
, &yy
);
715 memDC
.SelectObject(* backingBitmap
);
716 dc
.Blit(0, 0, backingBitmap
->GetWidth(), backingBitmap
->GetHeight(), &memDC
, 0, 0);
720 void MyCanvas::OnMouseEvent(wxMouseEvent
& event
)
723 event
.Position(&x
, &y
);
724 static int startPosX
, startPosY
, startFrameX
, startFrameY
;
726 event
.Position(&x
, &y
);
728 if (event
.RightDown())
730 // Versions from wxWin 1.67 are probably OK
732 FakePopupMenu(popupMenu
, x
, y
);
734 PopupMenu(popupMenu
, (int)x
, (int)y
);
737 else if (event
.LeftDown())
739 this->CaptureMouse();
742 ClientToScreen(&x1
, &y1
);
745 GetParent()->GetPosition(&startFrameX
, &startFrameY
);
747 else if (event
.LeftUp())
748 this->ReleaseMouse();
749 else if (event
.Dragging() && event
.LeftIsDown())
753 ClientToScreen(&x1
, &y1
);
755 int dX
= x1
- startPosX
;
756 int dY
= y1
- startPosY
;
757 GetParent()->Move(startFrameX
+ dX
, startFrameY
+ dY
);
761 // Process characters
762 void MyCanvas::OnChar(wxKeyEvent
& event
)
764 switch (event
.KeyCode())
769 TheMainWindow
->Search(FALSE
);
774 TheMainWindow
->Search(TRUE
);
778 TheMainWindow
->NextPage();
781 TheMainWindow
->Close(TRUE
);
788 int LoadIndex(char *file_name
)
797 sprintf(buf
, "%s.idx", file_name
);
798 if (! (file_name
&& (index_file
= fopen(buf
, "r"))))
802 fscanf(index_file
, "%ld", &nitems
);
804 for (i
= 0; i
< nitems
; i
++)
806 fscanf(index_file
, "%ld", &data
);
807 poem_index
[i
] = data
;
820 indexn
= (int)(rand() % nitems
);
822 if ((indexn
< 0) || (indexn
> nitems
))
823 { PoetryError("No such poem!");
831 void ReadPreferences()
833 wxGetResource("wxPoem", "FontSize", &pointSize
);
834 wxGetResource("wxPoem", "X", &XPos
);
835 wxGetResource("wxPoem", "Y", &YPos
);
838 // Write preferences to disk
839 void WritePreferences()
842 TheMainWindow
->GetPosition(&XPos
, &YPos
);
843 wxWriteResource("wxPoem", "FontSize", pointSize
);
844 wxWriteResource("wxPoem", "X", XPos
);
845 wxWriteResource("wxPoem", "Y", YPos
);
849 // Load a poem from given file, at given point in file.
850 // If position is > -1, use this for the position in the
851 // file, otherwise use index[index_ptr] to find the correct position.
852 bool LoadPoem(char *file_name
, long position
)
866 sprintf(buf
, "%s.dat", file_name
);
868 if (! (file_name
&& (data_file
= fopen(buf
, "r"))))
870 sprintf(error_buf
, "Data file %s not found.", buf
);
871 PoetryError(error_buf
);
879 data
= poem_index
[index_ptr
];
881 fseek(data_file
, data
, SEEK_SET
);
885 while ((ch
!= EOF
) && (ch
!= '#'))
887 ch
= getc(data_file
);
888 // Add a linefeed so it will copy to the clipboard ok
900 sprintf(error_buf
, "%s", "Poetry buffer exceeded.");
901 PoetryError(error_buf
);
906 poem_buffer
[i
-1] = 0;
912 long MainWindow::DoSearch(void)
922 long previous_poem_start
;
925 int search_length
= strlen(search_string
);
929 find_start
= last_find
+ 1;
930 previous_poem_start
= last_poem_start
;
936 previous_poem_start
= -1;
940 sprintf(buf
, "%s.dat", data_filename
);
942 if (! (data_filename
&& (file
= fopen(buf
, "r"))))
944 sprintf(error_buf
, "Poetry data file %s not found\n", buf
);
945 PoetryError(error_buf
);
949 fseek(file
, find_start
, SEEK_SET
);
951 while ((ch
!= EOF
) && !found
)
954 ch
|= 0x0020; // Make lower case
956 // Only match if we're looking at a different poem
957 // (no point in displaying the same poem again)
958 if ((ch
== search_string
[i
]) && (last_poem_start
!= previous_poem_start
))
961 last_find
= ftell(file
);
962 if (i
== search_length
-1)
972 last_poem_start
= ftell(file
);
981 return last_poem_start
;
987 // Set up poetry filenames, preferences, load the index
988 // Load index (or compile it if none found)
991 index_ok
= LoadIndex(index_filename
);
992 if (!index_ok
|| (nitems
== 0))
994 PoetryError("Index file not found; will compile new one", "wxPoem");
995 index_ok
= Compile();
1000 void PoetryError(char *msg
, char *caption
)
1002 wxMessageBox(msg
, caption
, wxOK
|wxICON_EXCLAMATION
);
1005 // Notification (change icon to something appropriate!)
1006 void PoetryNotify(char *Msg
, char *caption
)
1008 wxMessageBox(Msg
, caption
, wxOK
| wxICON_INFORMATION
);
1011 // Build up and save an index into the poetry data file, for
1012 // rapid random access
1022 sprintf(buf
, "%s.dat", data_filename
);
1024 if (! (data_filename
&& (file
= fopen(buf
, "r"))))
1026 sprintf(error_buf
, "Poetry data file %s not found\n", buf
);
1027 PoetryError(error_buf
);
1034 poem_index
[nitems
] = 0;
1047 poem_index
[nitems
] = data
;
1054 sprintf(buf
, "%s.idx", index_filename
);
1055 if (! (data_filename
&& (file
= fopen(buf
, "w"))))
1057 sprintf(error_buf
, "Poetry index file %s cannot be created\n", buf
);
1058 PoetryError(error_buf
);
1062 fprintf(file
, "%ld\n\n", nitems
);
1063 for (j
= 0; j
< nitems
; j
++)
1064 fprintf(file
, "%ld\n", poem_index
[j
]);
1067 PoetryNotify("Poetry index compiled.");
1071 void PopupFunction(wxMenu
& /*menu*/, wxCommandEvent
& event
)
1073 switch (event
.m_commandInt
)
1076 // Another poem/page
1077 TheMainWindow
->NextPage();
1081 TheMainWindow
->PreviousPage();
1084 // Search - with dialog
1085 TheMainWindow
->Search(TRUE
);
1087 case POEM_NEXT_MATCH
:
1088 // Search - without dialog (next match)
1089 TheMainWindow
->Search(FALSE
);
1092 TheMainWindow
->Iconize(TRUE
);
1096 // Copy current poem to the clipboard
1097 CopyToClipboard((HWND
) TheMainWindow
->GetHWND(), poem_buffer
);
1104 case POEM_BIGGER_TEXT
:
1108 TheMainWindow
->Resize();
1111 case POEM_SMALLER_TEXT
:
1117 TheMainWindow
->Resize();
1121 case POEM_HELP_CONTENTS
:
1123 HelpController
->LoadFile("wxpoem");
1124 HelpController
->DisplayContents();
1129 (void)wxMessageBox("wxPoem Version 1.1\nJulian Smart (c) 1995",
1130 "About wxPoem", wxOK
, TheMainWindow
);
1135 TheMainWindow
->Close(TRUE
);