1 //////////////////////////////////////////////////////////////////////////////
2 // File: contrib/samples/stc/stctest.cpp
3 // Purpose: STC test application
4 // Maintainer: Otto Wyss
7 // Copyright: (c) wxGuide
8 // Licence: wxWindows licence
9 //////////////////////////////////////////////////////////////////////////////
11 //----------------------------------------------------------------------------
13 //----------------------------------------------------------------------------
15 // For compilers that support precompilation, includes "wx/wx.h".
16 #include "wx/wxprec.h"
22 // for all others, include the necessary headers (this file is usually all you
23 // need because it includes almost all 'standard' wxWidgets headers)
29 #include "wx/config.h" // configuration support
30 #include "wx/filedlg.h" // file dialog support
31 #include "wx/filename.h" // filename support
32 #include "wx/notebook.h" // notebook support
33 #include "wx/settings.h" // system settings
34 #include "wx/string.h" // strings support
35 #include "wx/image.h" // images support
37 //! application headers
38 #include "defsext.h" // Additional definitions
39 #include "edit.h" // Edit module
40 #include "prefs.h" // Prefs
43 //----------------------------------------------------------------------------
45 //----------------------------------------------------------------------------
47 // the application icon (under Windows and OS/2 it is in resources)
48 #if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
49 #include "mondrian.xpm"
52 //============================================================================
54 //============================================================================
56 #define APP_NAME _T("STC-Test")
57 #define APP_DESCR _("See http://wxguide.sourceforge.net/")
59 #define APP_MAINT _T("Otto Wyss")
60 #define APP_VENDOR _T("wxWidgets")
61 #define APP_COPYRIGTH _T("(C) 2003 Otto Wyss")
62 #define APP_LICENCE _T("wxWidgets")
64 #define APP_VERSION _T("0.1.alpha")
65 #define APP_BUILD __DATE__
67 #define APP_WEBSITE _T("http://www.wxWidgets.org")
68 #define APP_MAIL _T("mailto://???")
70 #define NONAME _("<untitled>")
75 //----------------------------------------------------------------------------
76 //! global application name
77 wxString
*g_appname
= NULL
;
79 #if wxUSE_PRINTING_ARCHITECTURE
81 //! global print data, to remember settings during the session
82 wxPrintData
*g_printData
= (wxPrintData
*) NULL
;
83 wxPageSetupData
*g_pageSetupData
= (wxPageSetupData
*) NULL
;
85 #endif // wxUSE_PRINTING_ARCHITECTURE
90 //----------------------------------------------------------------------------
91 //! application APP_VENDOR-APP_NAME.
92 class App
: public wxApp
{
93 friend class AppFrame
;
96 //! the main function called durning application start
97 virtual bool OnInit ();
99 //! application exit function
100 virtual int OnExit ();
108 // created dynamically by wxWidgets
111 //----------------------------------------------------------------------------
112 //! frame of the application APP_VENDOR-APP_NAME.
113 class AppFrame
: public wxFrame
{
115 friend class AppBook
;
116 friend class AppAbout
;
120 AppFrame (const wxString
&title
);
127 void OnClose (wxCloseEvent
&event
);
128 void OnAbout (wxCommandEvent
&event
);
129 void OnExit (wxCommandEvent
&event
);
130 void OnTimerEvent (wxTimerEvent
&event
);
132 void OnFileNew (wxCommandEvent
&event
);
133 void OnFileNewFrame (wxCommandEvent
&event
);
134 void OnFileOpen (wxCommandEvent
&event
);
135 void OnFileOpenFrame (wxCommandEvent
&event
);
136 void OnFileSave (wxCommandEvent
&event
);
137 void OnFileSaveAs (wxCommandEvent
&event
);
138 void OnFileClose (wxCommandEvent
&event
);
140 void OnProperties (wxCommandEvent
&event
);
142 void OnPrintSetup (wxCommandEvent
&event
);
143 void OnPrintPreview (wxCommandEvent
&event
);
144 void OnPrint (wxCommandEvent
&event
);
146 void OnEdit (wxCommandEvent
&event
);
151 void FileOpen (wxString fname
);
153 //! creates the application menu bar
154 wxMenuBar
*m_menuBar
;
157 // print preview position and size
158 wxRect
DeterminePrintSize ();
160 DECLARE_EVENT_TABLE()
163 //----------------------------------------------------------------------------
164 //! about box of the application APP_VENDOR-APP_NAME
165 class AppAbout
: public wxDialog
{
169 AppAbout (wxWindow
*parent
,
170 int milliseconds
= 0,
177 void OnTimerEvent (wxTimerEvent
&event
);
183 DECLARE_EVENT_TABLE()
187 //============================================================================
189 //============================================================================
193 //----------------------------------------------------------------------------
195 //----------------------------------------------------------------------------
197 bool App::OnInit () {
199 wxInitAllImageHandlers();
201 // set application and vendor name
202 SetAppName (APP_NAME
);
203 SetVendorName (APP_VENDOR
);
204 g_appname
= new wxString ();
205 g_appname
->Append (APP_VENDOR
);
206 g_appname
->Append (_T("-"));
207 g_appname
->Append (APP_NAME
);
209 #if wxUSE_PRINTING_ARCHITECTURE
210 // initialize print data and setup
211 g_printData
= new wxPrintData
;
212 g_pageSetupData
= new wxPageSetupDialogData
;
213 #endif // wxUSE_PRINTING_ARCHITECTURE
215 // create application frame
216 m_frame
= new AppFrame (*g_appname
);
218 // open application frame
220 m_frame
->Show (true);
221 SetTopWindow (m_frame
);
228 // delete global appname
231 #if wxUSE_PRINTING_ARCHITECTURE
232 // delete global print data and setup
233 if (g_printData
) delete g_printData
;
234 if (g_pageSetupData
) delete g_pageSetupData
;
235 #endif // wxUSE_PRINTING_ARCHITECTURE
240 //----------------------------------------------------------------------------
242 //----------------------------------------------------------------------------
244 BEGIN_EVENT_TABLE (AppFrame
, wxFrame
)
246 EVT_CLOSE ( AppFrame::OnClose
)
248 EVT_MENU (wxID_OPEN
, AppFrame::OnFileOpen
)
249 EVT_MENU (wxID_SAVE
, AppFrame::OnFileSave
)
250 EVT_MENU (wxID_SAVEAS
, AppFrame::OnFileSaveAs
)
251 EVT_MENU (wxID_CLOSE
, AppFrame::OnFileClose
)
253 EVT_MENU (myID_PROPERTIES
, AppFrame::OnProperties
)
255 EVT_MENU (wxID_PRINT_SETUP
, AppFrame::OnPrintSetup
)
256 EVT_MENU (wxID_PREVIEW
, AppFrame::OnPrintPreview
)
257 EVT_MENU (wxID_PRINT
, AppFrame::OnPrint
)
258 EVT_MENU (wxID_EXIT
, AppFrame::OnExit
)
260 EVT_MENU (wxID_CLEAR
, AppFrame::OnEdit
)
261 EVT_MENU (wxID_CUT
, AppFrame::OnEdit
)
262 EVT_MENU (wxID_COPY
, AppFrame::OnEdit
)
263 EVT_MENU (wxID_PASTE
, AppFrame::OnEdit
)
264 EVT_MENU (myID_INDENTINC
, AppFrame::OnEdit
)
265 EVT_MENU (myID_INDENTRED
, AppFrame::OnEdit
)
266 EVT_MENU (wxID_SELECTALL
, AppFrame::OnEdit
)
267 EVT_MENU (myID_SELECTLINE
, AppFrame::OnEdit
)
268 EVT_MENU (wxID_REDO
, AppFrame::OnEdit
)
269 EVT_MENU (wxID_UNDO
, AppFrame::OnEdit
)
271 EVT_MENU (wxID_FIND
, AppFrame::OnEdit
)
272 EVT_MENU (myID_FINDNEXT
, AppFrame::OnEdit
)
273 EVT_MENU (myID_REPLACE
, AppFrame::OnEdit
)
274 EVT_MENU (myID_REPLACENEXT
, AppFrame::OnEdit
)
275 EVT_MENU (myID_BRACEMATCH
, AppFrame::OnEdit
)
276 EVT_MENU (myID_GOTO
, AppFrame::OnEdit
)
278 EVT_MENU_RANGE (myID_HILIGHTFIRST
, myID_HILIGHTLAST
,
280 EVT_MENU (myID_DISPLAYEOL
, AppFrame::OnEdit
)
281 EVT_MENU (myID_INDENTGUIDE
, AppFrame::OnEdit
)
282 EVT_MENU (myID_LINENUMBER
, AppFrame::OnEdit
)
283 EVT_MENU (myID_LONGLINEON
, AppFrame::OnEdit
)
284 EVT_MENU (myID_WHITESPACE
, AppFrame::OnEdit
)
285 EVT_MENU (myID_FOLDTOGGLE
, AppFrame::OnEdit
)
286 EVT_MENU (myID_OVERTYPE
, AppFrame::OnEdit
)
287 EVT_MENU (myID_READONLY
, AppFrame::OnEdit
)
288 EVT_MENU (myID_WRAPMODEON
, AppFrame::OnEdit
)
290 EVT_MENU (myID_CHANGELOWER
, AppFrame::OnEdit
)
291 EVT_MENU (myID_CHANGEUPPER
, AppFrame::OnEdit
)
292 EVT_MENU (myID_CONVERTCR
, AppFrame::OnEdit
)
293 EVT_MENU (myID_CONVERTCRLF
, AppFrame::OnEdit
)
294 EVT_MENU (myID_CONVERTLF
, AppFrame::OnEdit
)
295 EVT_MENU (myID_CHARSETANSI
, AppFrame::OnEdit
)
296 EVT_MENU (myID_CHARSETMAC
, AppFrame::OnEdit
)
298 EVT_MENU (wxID_ABOUT
, AppFrame::OnAbout
)
301 AppFrame::AppFrame (const wxString
&title
)
302 : wxFrame ((wxFrame
*)NULL
, wxID_ANY
, title
, wxDefaultPosition
, wxSize(750,550),
303 wxDEFAULT_FRAME_STYLE
| wxNO_FULL_REPAINT_ON_RESIZE
) {
305 // intitialize important variables
308 // set icon and background
309 SetTitle (*g_appname
);
310 SetIcon (wxICON (mondrian
));
311 SetBackgroundColour (_T("WHITE"));
313 // about box shown for 1 seconds
314 AppAbout
dlg(this, 1000);
317 m_menuBar
= new wxMenuBar
;
321 m_edit
= new Edit (this, wxID_ANY
);
324 FileOpen (_T("stctest.cpp"));
327 AppFrame::~AppFrame () {
330 // common event handlers
331 void AppFrame::OnClose (wxCloseEvent
&event
) {
334 if (m_edit
&& m_edit
->Modified()) {
335 if (event
.CanVeto()) event
.Veto (true);
341 void AppFrame::OnAbout (wxCommandEvent
&WXUNUSED(event
)) {
345 void AppFrame::OnExit (wxCommandEvent
&WXUNUSED(event
)) {
349 // file event handlers
350 void AppFrame::OnFileOpen (wxCommandEvent
&WXUNUSED(event
)) {
354 wxFileDialog
dlg (this, _T("Open file"), wxEmptyString
, wxEmptyString
, _T("Any file (*)|*"),
355 wxOPEN
| wxFILE_MUST_EXIST
| wxCHANGE_DIR
);
356 if (dlg
.ShowModal() != wxID_OK
) return;
357 fname
= dlg
.GetPath ();
359 #endif // wxUSE_FILEDLG
362 void AppFrame::OnFileSave (wxCommandEvent
&WXUNUSED(event
)) {
364 if (!m_edit
->Modified()) {
365 wxMessageBox (_("There is nothing to save!"), _("Save file"),
366 wxOK
| wxICON_EXCLAMATION
);
372 void AppFrame::OnFileSaveAs (wxCommandEvent
&WXUNUSED(event
)) {
375 wxString filename
= wxEmptyString
;
376 wxFileDialog
dlg (this, _T("Save file"), wxEmptyString
, wxEmptyString
, _T("Any file (*)|*"), wxSAVE
|wxOVERWRITE_PROMPT
);
377 if (dlg
.ShowModal() != wxID_OK
) return;
378 filename
= dlg
.GetPath();
379 m_edit
->SaveFile (filename
);
380 #endif // wxUSE_FILEDLG
383 void AppFrame::OnFileClose (wxCommandEvent
&WXUNUSED(event
)) {
385 if (m_edit
->Modified()) {
386 if (wxMessageBox (_("Text is not saved, save before closing?"), _("Close"),
387 wxYES_NO
| wxICON_QUESTION
) == wxYES
) {
389 if (m_edit
->Modified()) {
390 wxMessageBox (_("Text could not be saved!"), _("Close abort"),
391 wxOK
| wxICON_EXCLAMATION
);
396 m_edit
->SetFilename (wxEmptyString
);
398 m_edit
->SetSavePoint();
401 // properties event handlers
402 void AppFrame::OnProperties (wxCommandEvent
&WXUNUSED(event
)) {
404 EditProperties
dlg(m_edit
, 0);
407 // print event handlers
408 void AppFrame::OnPrintSetup (wxCommandEvent
&WXUNUSED(event
)) {
409 #if wxUSE_PRINTING_ARCHITECTURE
410 (*g_pageSetupData
) = * g_printData
;
411 wxPageSetupDialog
pageSetupDialog(this, g_pageSetupData
);
412 pageSetupDialog
.ShowModal();
413 (*g_printData
) = pageSetupDialog
.GetPageSetupData().GetPrintData();
414 (*g_pageSetupData
) = pageSetupDialog
.GetPageSetupData();
415 #endif // wxUSE_PRINTING_ARCHITECTURE
418 void AppFrame::OnPrintPreview (wxCommandEvent
&WXUNUSED(event
)) {
419 #if wxUSE_PRINTING_ARCHITECTURE
420 wxPrintDialogData
printDialogData( *g_printData
);
421 wxPrintPreview
*preview
=
422 new wxPrintPreview (new EditPrint (m_edit
),
423 new EditPrint (m_edit
),
425 if (!preview
->Ok()) {
427 wxMessageBox (_("There was a problem with previewing.\n\
428 Perhaps your current printer is not correctly?"),
429 _("Previewing"), wxOK
);
432 wxRect rect
= DeterminePrintSize();
433 wxPreviewFrame
*frame
= new wxPreviewFrame (preview
, this, _("Print Preview"));
434 frame
->SetSize (rect
);
435 frame
->Centre(wxBOTH
);
438 #endif // wxUSE_PRINTING_ARCHITECTURE
441 void AppFrame::OnPrint (wxCommandEvent
&WXUNUSED(event
)) {
442 #if wxUSE_PRINTING_ARCHITECTURE
443 wxPrintDialogData
printDialogData( *g_printData
);
444 wxPrinter
printer (&printDialogData
);
445 EditPrint
printout (m_edit
);
446 if (!printer
.Print (this, &printout
, true)) {
447 if (wxPrinter::GetLastError() == wxPRINTER_ERROR
) {
448 wxMessageBox (_("There was a problem with printing.\n\
449 Perhaps your current printer is not correctly?"),
450 _("Previewing"), wxOK
);
454 (*g_printData
) = printer
.GetPrintDialogData().GetPrintData();
455 #endif // wxUSE_PRINTING_ARCHITECTURE
459 void AppFrame::OnEdit (wxCommandEvent
&event
) {
460 if (m_edit
) m_edit
->ProcessEvent (event
);
464 void AppFrame::CreateMenu ()
467 wxMenu
*menuFile
= new wxMenu
;
468 menuFile
->Append (wxID_OPEN
, _("&Open ..\tCtrl+O"));
469 menuFile
->Append (wxID_SAVE
, _("&Save\tCtrl+S"));
470 menuFile
->Append (wxID_SAVEAS
, _("Save &as ..\tCtrl+Shift+S"));
471 menuFile
->Append (wxID_CLOSE
, _("&Close\tCtrl+W"));
472 menuFile
->AppendSeparator();
473 menuFile
->Append (myID_PROPERTIES
, _("Proper&ties ..\tCtrl+I"));
474 menuFile
->AppendSeparator();
475 menuFile
->Append (wxID_PRINT_SETUP
, _("Print Set&up .."));
476 menuFile
->Append (wxID_PREVIEW
, _("Print Pre&view\tCtrl+Shift+P"));
477 menuFile
->Append (wxID_PRINT
, _("&Print ..\tCtrl+P"));
478 menuFile
->AppendSeparator();
479 menuFile
->Append (wxID_EXIT
, _("&Quit\tCtrl+Q"));
482 wxMenu
*menuEdit
= new wxMenu
;
483 menuEdit
->Append (wxID_UNDO
, _("&Undo\tCtrl+Z"));
484 menuEdit
->Append (wxID_REDO
, _("&Redo\tCtrl+Shift+Z"));
485 menuEdit
->AppendSeparator();
486 menuEdit
->Append (wxID_CUT
, _("Cu&t\tCtrl+X"));
487 menuEdit
->Append (wxID_COPY
, _("&Copy\tCtrl+C"));
488 menuEdit
->Append (wxID_PASTE
, _("&Paste\tCtrl+V"));
489 menuEdit
->Append (wxID_CLEAR
, _("&Delete\tDel"));
490 menuEdit
->AppendSeparator();
491 menuEdit
->Append (wxID_FIND
, _("&Find\tCtrl+F"));
492 menuEdit
->Enable (wxID_FIND
, false);
493 menuEdit
->Append (myID_FINDNEXT
, _("Find &next\tF3"));
494 menuEdit
->Enable (myID_FINDNEXT
, false);
495 menuEdit
->Append (myID_REPLACE
, _("&Replace\tCtrl+H"));
496 menuEdit
->Enable (myID_REPLACE
, false);
497 menuEdit
->Append (myID_REPLACENEXT
, _("Replace &again\tShift+F4"));
498 menuEdit
->Enable (myID_REPLACENEXT
, false);
499 menuEdit
->AppendSeparator();
500 menuEdit
->Append (myID_BRACEMATCH
, _("&Match brace\tCtrl+M"));
501 menuEdit
->Append (myID_GOTO
, _("&Goto\tCtrl+G"));
502 menuEdit
->Enable (myID_GOTO
, false);
503 menuEdit
->AppendSeparator();
504 menuEdit
->Append (myID_INDENTINC
, _("&Indent increase\tTab"));
505 menuEdit
->Append (myID_INDENTRED
, _("I&ndent reduce\tBksp"));
506 menuEdit
->AppendSeparator();
507 menuEdit
->Append (wxID_SELECTALL
, _("&Select all\tCtrl+A"));
508 menuEdit
->Append (myID_SELECTLINE
, _("Select &line\tCtrl+L"));
511 wxMenu
*menuHilight
= new wxMenu
;
513 for (Nr
= 0; Nr
< g_LanguagePrefsSize
; Nr
++) {
514 menuHilight
->Append (myID_HILIGHTFIRST
+ Nr
,
515 g_LanguagePrefs
[Nr
].name
);
519 wxMenu
*menuCharset
= new wxMenu
;
520 menuCharset
->Append (myID_CHARSETANSI
, _("&ANSI (Windows)"));
521 menuCharset
->Append (myID_CHARSETMAC
, _("&MAC (Macintosh)"));
524 wxMenu
*menuView
= new wxMenu
;
525 menuView
->Append (myID_HILIGHTLANG
, _("&Hilight language .."), menuHilight
);
526 menuView
->AppendSeparator();
527 menuView
->AppendCheckItem (myID_FOLDTOGGLE
, _("&Toggle current fold\tCtrl+T"));
528 menuView
->AppendCheckItem (myID_OVERTYPE
, _("&Overwrite mode\tIns"));
529 menuView
->AppendCheckItem (myID_WRAPMODEON
, _("&Wrap mode\tCtrl+U"));
530 menuView
->AppendSeparator();
531 menuView
->AppendCheckItem (myID_DISPLAYEOL
, _("Show line &endings"));
532 menuView
->AppendCheckItem (myID_INDENTGUIDE
, _("Show &indent guides"));
533 menuView
->AppendCheckItem (myID_LINENUMBER
, _("Show line &numbers"));
534 menuView
->AppendCheckItem (myID_LONGLINEON
, _("Show &long line marker"));
535 menuView
->AppendCheckItem (myID_WHITESPACE
, _("Show white&space"));
536 menuView
->AppendSeparator();
537 menuView
->Append (myID_USECHARSET
, _("Use &code page of .."), menuCharset
);
539 // change case submenu
540 wxMenu
*menuChangeCase
= new wxMenu
;
541 menuChangeCase
->Append (myID_CHANGEUPPER
, _("&Upper case"));
542 menuChangeCase
->Append (myID_CHANGELOWER
, _("&Lower case"));
544 // convert EOL submenu
545 wxMenu
*menuConvertEOL
= new wxMenu
;
546 menuConvertEOL
->Append (myID_CONVERTCR
, _("CR (&Linux)"));
547 menuConvertEOL
->Append (myID_CONVERTCRLF
, _("CR+LF (&Windows)"));
548 menuConvertEOL
->Append (myID_CONVERTLF
, _("LF (&Macintosh)"));
551 wxMenu
*menuExtra
= new wxMenu
;
552 menuExtra
->AppendCheckItem (myID_READONLY
, _("&Readonly mode"));
553 menuExtra
->AppendSeparator();
554 menuExtra
->Append (myID_CHANGECASE
, _("Change &case to .."), menuChangeCase
);
555 menuExtra
->AppendSeparator();
556 menuExtra
->Append (myID_CONVERTEOL
, _("Convert line &endings to .."), menuConvertEOL
);
559 wxMenu
*menuWindow
= new wxMenu
;
560 menuWindow
->Append (myID_PAGEPREV
, _("&Previous\tCtrl+Shift+Tab"));
561 menuWindow
->Append (myID_PAGENEXT
, _("&Next\tCtrl+Tab"));
564 wxMenu
*menuHelp
= new wxMenu
;
565 menuHelp
->Append (wxID_ABOUT
, _("&About ..\tShift+F1"));
568 m_menuBar
->Append (menuFile
, _("&File"));
569 m_menuBar
->Append (menuEdit
, _("&Edit"));
570 m_menuBar
->Append (menuView
, _("&View"));
571 m_menuBar
->Append (menuExtra
, _("E&xtra"));
572 m_menuBar
->Append (menuWindow
, _("&Window"));
573 m_menuBar
->Append (menuHelp
, _("&Help"));
574 SetMenuBar (m_menuBar
);
577 void AppFrame::FileOpen (wxString fname
)
579 wxFileName
w(fname
); w
.Normalize(); fname
= w
.GetFullPath();
580 m_edit
->LoadFile (fname
);
583 wxRect
AppFrame::DeterminePrintSize () {
585 wxSize scr
= wxGetDisplaySize();
587 // determine position and size (shifting 16 left and down)
588 wxRect rect
= GetRect();
591 rect
.width
= wxMin (rect
.width
, (scr
.x
- rect
.x
));
592 rect
.height
= wxMin (rect
.height
, (scr
.x
- rect
.y
));
598 //----------------------------------------------------------------------------
600 //----------------------------------------------------------------------------
602 BEGIN_EVENT_TABLE (AppAbout
, wxDialog
)
603 EVT_TIMER (myID_ABOUTTIMER
, AppAbout::OnTimerEvent
)
606 AppAbout::AppAbout (wxWindow
*parent
,
609 : wxDialog (parent
, wxID_ANY
, wxEmptyString
,
610 wxDefaultPosition
, wxDefaultSize
,
611 style
| wxDEFAULT_DIALOG_STYLE
| wxRESIZE_BORDER
) {
615 if (milliseconds
> 0) {
616 m_timer
= new wxTimer (this, myID_ABOUTTIMER
);
617 m_timer
->Start (milliseconds
, wxTIMER_ONE_SHOT
);
620 // sets the application title
621 SetTitle (_("About .."));
624 wxGridSizer
*aboutinfo
= new wxGridSizer (2, 0, 2);
625 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Written by: ")),
627 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_MAINT
),
628 1, wxEXPAND
| wxALIGN_LEFT
);
629 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Version: ")),
631 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_VERSION
),
632 1, wxEXPAND
| wxALIGN_LEFT
);
633 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Licence type: ")),
635 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_LICENCE
),
636 1, wxEXPAND
| wxALIGN_LEFT
);
637 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Copyright: ")),
639 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_COPYRIGTH
),
640 1, wxEXPAND
| wxALIGN_LEFT
);
642 // about icontitle//info
643 wxBoxSizer
*aboutpane
= new wxBoxSizer (wxHORIZONTAL
);
644 wxBitmap bitmap
= wxBitmap(wxICON (mondrian
));
645 aboutpane
->Add (new wxStaticBitmap (this, wxID_ANY
, bitmap
),
646 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxRIGHT
, 20);
647 aboutpane
->Add (aboutinfo
, 1, wxEXPAND
);
648 aboutpane
->Add (60, 0);
651 wxBoxSizer
*totalpane
= new wxBoxSizer (wxVERTICAL
);
652 totalpane
->Add (0, 20);
653 wxStaticText
*appname
= new wxStaticText(this, wxID_ANY
, *g_appname
);
654 appname
->SetFont (wxFont (24, wxDEFAULT
, wxNORMAL
, wxBOLD
));
655 totalpane
->Add (appname
, 0, wxALIGN_CENTER
| wxLEFT
| wxRIGHT
, 40);
656 totalpane
->Add (0, 10);
657 totalpane
->Add (aboutpane
, 0, wxEXPAND
| wxALL
, 4);
658 totalpane
->Add (new wxStaticText(this, wxID_ANY
, APP_DESCR
),
659 0, wxALIGN_CENTER
| wxALL
, 10);
660 wxButton
*okButton
= new wxButton (this, wxID_OK
, _("OK"));
661 okButton
->SetDefault();
662 totalpane
->Add (okButton
, 0, wxALIGN_CENTER
| wxLEFT
| wxRIGHT
| wxBOTTOM
, 10);
664 SetSizerAndFit (totalpane
);
670 AppAbout::~AppAbout () {
677 //----------------------------------------------------------------------------
679 void AppAbout::OnTimerEvent (wxTimerEvent
&WXUNUSED(event
)) {
680 if (m_timer
) delete m_timer
;