1 //////////////////////////////////////////////////////////////////////////////
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
88 //----------------------------------------------------------------------------
89 //! application APP_VENDOR-APP_NAME.
90 class App
: public wxApp
{
91 friend class AppFrame
;
94 //! the main function called durning application start
95 virtual bool OnInit ();
97 //! application exit function
98 virtual int OnExit ();
106 // created dynamically by wxWidgets
109 //----------------------------------------------------------------------------
110 //! frame of the application APP_VENDOR-APP_NAME.
111 class AppFrame
: public wxFrame
{
113 friend class AppBook
;
114 friend class AppAbout
;
118 AppFrame (const wxString
&title
);
125 void OnClose (wxCloseEvent
&event
);
126 void OnAbout (wxCommandEvent
&event
);
127 void OnExit (wxCommandEvent
&event
);
128 void OnTimerEvent (wxTimerEvent
&event
);
130 void OnFileNew (wxCommandEvent
&event
);
131 void OnFileNewFrame (wxCommandEvent
&event
);
132 void OnFileOpen (wxCommandEvent
&event
);
133 void OnFileOpenFrame (wxCommandEvent
&event
);
134 void OnFileSave (wxCommandEvent
&event
);
135 void OnFileSaveAs (wxCommandEvent
&event
);
136 void OnFileClose (wxCommandEvent
&event
);
138 void OnProperties (wxCommandEvent
&event
);
140 void OnPrintSetup (wxCommandEvent
&event
);
141 void OnPrintPreview (wxCommandEvent
&event
);
142 void OnPrint (wxCommandEvent
&event
);
144 void OnEdit (wxCommandEvent
&event
);
149 void FileOpen (wxString fname
);
151 //! creates the application menu bar
152 wxMenuBar
*m_menuBar
;
155 // print preview position and size
156 wxRect
DeterminePrintSize ();
158 DECLARE_EVENT_TABLE()
161 //----------------------------------------------------------------------------
162 //! about box of the application APP_VENDOR-APP_NAME
163 class AppAbout
: public wxDialog
{
167 AppAbout (wxWindow
*parent
,
168 int milliseconds
= 0,
175 void OnTimerEvent (wxTimerEvent
&event
);
181 DECLARE_EVENT_TABLE()
185 //============================================================================
187 //============================================================================
191 //----------------------------------------------------------------------------
193 //----------------------------------------------------------------------------
195 bool App::OnInit () {
197 wxInitAllImageHandlers();
199 // set application and vendor name
200 SetAppName (APP_NAME
);
201 SetVendorName (APP_VENDOR
);
202 g_appname
= new wxString ();
203 g_appname
->Append (APP_VENDOR
);
204 g_appname
->Append (_T("-"));
205 g_appname
->Append (APP_NAME
);
207 #if wxUSE_PRINTING_ARCHITECTURE
208 // initialize print data and setup
209 g_printData
= new wxPrintData
;
210 g_pageSetupData
= new wxPageSetupDialogData
;
211 #endif // wxUSE_PRINTING_ARCHITECTURE
213 // create application frame
214 m_frame
= new AppFrame (*g_appname
);
216 // open application frame
218 m_frame
->Show (true);
219 SetTopWindow (m_frame
);
226 // delete global appname
229 #if wxUSE_PRINTING_ARCHITECTURE
230 // delete global print data and setup
231 if (g_printData
) delete g_printData
;
232 if (g_pageSetupData
) delete g_pageSetupData
;
233 #endif // wxUSE_PRINTING_ARCHITECTURE
238 //----------------------------------------------------------------------------
240 //----------------------------------------------------------------------------
242 BEGIN_EVENT_TABLE (AppFrame
, wxFrame
)
244 EVT_CLOSE ( AppFrame::OnClose
)
246 EVT_MENU (wxID_OPEN
, AppFrame::OnFileOpen
)
247 EVT_MENU (wxID_SAVE
, AppFrame::OnFileSave
)
248 EVT_MENU (wxID_SAVEAS
, AppFrame::OnFileSaveAs
)
249 EVT_MENU (wxID_CLOSE
, AppFrame::OnFileClose
)
251 EVT_MENU (myID_PROPERTIES
, AppFrame::OnProperties
)
253 EVT_MENU (wxID_PRINT_SETUP
, AppFrame::OnPrintSetup
)
254 EVT_MENU (wxID_PREVIEW
, AppFrame::OnPrintPreview
)
255 EVT_MENU (wxID_PRINT
, AppFrame::OnPrint
)
256 EVT_MENU (wxID_EXIT
, AppFrame::OnExit
)
258 EVT_MENU (wxID_CLEAR
, AppFrame::OnEdit
)
259 EVT_MENU (wxID_CUT
, AppFrame::OnEdit
)
260 EVT_MENU (wxID_COPY
, AppFrame::OnEdit
)
261 EVT_MENU (wxID_PASTE
, AppFrame::OnEdit
)
262 EVT_MENU (myID_INDENTINC
, AppFrame::OnEdit
)
263 EVT_MENU (myID_INDENTRED
, AppFrame::OnEdit
)
264 EVT_MENU (wxID_SELECTALL
, AppFrame::OnEdit
)
265 EVT_MENU (myID_SELECTLINE
, AppFrame::OnEdit
)
266 EVT_MENU (wxID_REDO
, AppFrame::OnEdit
)
267 EVT_MENU (wxID_UNDO
, AppFrame::OnEdit
)
269 EVT_MENU (wxID_FIND
, AppFrame::OnEdit
)
270 EVT_MENU (myID_FINDNEXT
, AppFrame::OnEdit
)
271 EVT_MENU (myID_REPLACE
, AppFrame::OnEdit
)
272 EVT_MENU (myID_REPLACENEXT
, AppFrame::OnEdit
)
273 EVT_MENU (myID_BRACEMATCH
, AppFrame::OnEdit
)
274 EVT_MENU (myID_GOTO
, AppFrame::OnEdit
)
276 EVT_MENU_RANGE (myID_HILIGHTFIRST
, myID_HILIGHTLAST
,
278 EVT_MENU (myID_DISPLAYEOL
, AppFrame::OnEdit
)
279 EVT_MENU (myID_INDENTGUIDE
, AppFrame::OnEdit
)
280 EVT_MENU (myID_LINENUMBER
, AppFrame::OnEdit
)
281 EVT_MENU (myID_LONGLINEON
, AppFrame::OnEdit
)
282 EVT_MENU (myID_WHITESPACE
, AppFrame::OnEdit
)
283 EVT_MENU (myID_FOLDTOGGLE
, AppFrame::OnEdit
)
284 EVT_MENU (myID_OVERTYPE
, AppFrame::OnEdit
)
285 EVT_MENU (myID_READONLY
, AppFrame::OnEdit
)
286 EVT_MENU (myID_WRAPMODEON
, AppFrame::OnEdit
)
288 EVT_MENU (myID_CHANGELOWER
, AppFrame::OnEdit
)
289 EVT_MENU (myID_CHANGEUPPER
, AppFrame::OnEdit
)
290 EVT_MENU (myID_CONVERTCR
, AppFrame::OnEdit
)
291 EVT_MENU (myID_CONVERTCRLF
, AppFrame::OnEdit
)
292 EVT_MENU (myID_CONVERTLF
, AppFrame::OnEdit
)
293 EVT_MENU (myID_CHARSETANSI
, AppFrame::OnEdit
)
294 EVT_MENU (myID_CHARSETMAC
, AppFrame::OnEdit
)
296 EVT_MENU (wxID_ABOUT
, AppFrame::OnAbout
)
299 AppFrame::AppFrame (const wxString
&title
)
300 : wxFrame ((wxFrame
*)NULL
, wxID_ANY
, title
, wxDefaultPosition
, wxSize(750,550),
301 wxDEFAULT_FRAME_STYLE
| wxNO_FULL_REPAINT_ON_RESIZE
) {
303 // intitialize important variables
306 // set icon and background
307 SetTitle (*g_appname
);
308 SetIcon (wxICON (mondrian
));
309 SetBackgroundColour (_T("WHITE"));
311 // about box shown for 1 seconds
312 AppAbout
dlg(this, 1000);
315 m_menuBar
= new wxMenuBar
;
319 m_edit
= new Edit (this, wxID_ANY
);
322 FileOpen (_T("stctest.cpp"));
325 AppFrame::~AppFrame () {
328 // common event handlers
329 void AppFrame::OnClose (wxCloseEvent
&event
) {
332 if (m_edit
&& m_edit
->Modified()) {
333 if (event
.CanVeto()) event
.Veto (true);
339 void AppFrame::OnAbout (wxCommandEvent
&WXUNUSED(event
)) {
343 void AppFrame::OnExit (wxCommandEvent
&WXUNUSED(event
)) {
347 // file event handlers
348 void AppFrame::OnFileOpen (wxCommandEvent
&WXUNUSED(event
)) {
352 wxFileDialog
dlg (this, _T("Open file"), wxEmptyString
, wxEmptyString
, _T("Any file (*)|*"),
353 wxOPEN
| wxFILE_MUST_EXIST
| wxCHANGE_DIR
);
354 if (dlg
.ShowModal() != wxID_OK
) return;
355 fname
= dlg
.GetPath ();
357 #endif // wxUSE_FILEDLG
360 void AppFrame::OnFileSave (wxCommandEvent
&WXUNUSED(event
)) {
362 if (!m_edit
->Modified()) {
363 wxMessageBox (_("There is nothing to save!"), _("Save file"),
364 wxOK
| wxICON_EXCLAMATION
);
370 void AppFrame::OnFileSaveAs (wxCommandEvent
&WXUNUSED(event
)) {
373 wxString filename
= wxEmptyString
;
374 wxFileDialog
dlg (this, _T("Save file"), wxEmptyString
, wxEmptyString
, _T("Any file (*)|*"), wxSAVE
|wxOVERWRITE_PROMPT
);
375 if (dlg
.ShowModal() != wxID_OK
) return;
376 filename
= dlg
.GetPath();
377 m_edit
->SaveFile (filename
);
378 #endif // wxUSE_FILEDLG
381 void AppFrame::OnFileClose (wxCommandEvent
&WXUNUSED(event
)) {
383 if (m_edit
->Modified()) {
384 if (wxMessageBox (_("Text is not saved, save before closing?"), _("Close"),
385 wxYES_NO
| wxICON_QUESTION
) == wxYES
) {
387 if (m_edit
->Modified()) {
388 wxMessageBox (_("Text could not be saved!"), _("Close abort"),
389 wxOK
| wxICON_EXCLAMATION
);
394 m_edit
->SetFilename (wxEmptyString
);
396 m_edit
->SetSavePoint();
399 // properties event handlers
400 void AppFrame::OnProperties (wxCommandEvent
&WXUNUSED(event
)) {
402 EditProperties
dlg(m_edit
, 0);
405 // print event handlers
406 void AppFrame::OnPrintSetup (wxCommandEvent
&WXUNUSED(event
)) {
407 #if wxUSE_PRINTING_ARCHITECTURE
408 (*g_pageSetupData
) = * g_printData
;
409 wxPageSetupDialog
pageSetupDialog(this, g_pageSetupData
);
410 pageSetupDialog
.ShowModal();
411 (*g_printData
) = pageSetupDialog
.GetPageSetupData().GetPrintData();
412 (*g_pageSetupData
) = pageSetupDialog
.GetPageSetupData();
413 #endif // wxUSE_PRINTING_ARCHITECTURE
416 void AppFrame::OnPrintPreview (wxCommandEvent
&WXUNUSED(event
)) {
417 #if wxUSE_PRINTING_ARCHITECTURE
418 wxPrintDialogData
printDialogData( *g_printData
);
419 wxPrintPreview
*preview
=
420 new wxPrintPreview (new EditPrint (m_edit
),
421 new EditPrint (m_edit
),
423 if (!preview
->Ok()) {
425 wxMessageBox (_("There was a problem with previewing.\n\
426 Perhaps your current printer is not correctly?"),
427 _("Previewing"), wxOK
);
430 wxRect rect
= DeterminePrintSize();
431 wxPreviewFrame
*frame
= new wxPreviewFrame (preview
, this, _("Print Preview"));
432 frame
->SetSize (rect
);
433 frame
->Centre(wxBOTH
);
436 #endif // wxUSE_PRINTING_ARCHITECTURE
439 void AppFrame::OnPrint (wxCommandEvent
&WXUNUSED(event
)) {
440 #if wxUSE_PRINTING_ARCHITECTURE
441 wxPrintDialogData
printDialogData( *g_printData
);
442 wxPrinter
printer (&printDialogData
);
443 EditPrint
printout (m_edit
);
444 if (!printer
.Print (this, &printout
, true)) {
445 if (wxPrinter::GetLastError() == wxPRINTER_ERROR
) {
446 wxMessageBox (_("There was a problem with printing.\n\
447 Perhaps your current printer is not correctly?"),
448 _("Previewing"), wxOK
);
452 (*g_printData
) = printer
.GetPrintDialogData().GetPrintData();
453 #endif // wxUSE_PRINTING_ARCHITECTURE
457 void AppFrame::OnEdit (wxCommandEvent
&event
) {
458 if (m_edit
) m_edit
->ProcessEvent (event
);
462 void AppFrame::CreateMenu ()
465 wxMenu
*menuFile
= new wxMenu
;
466 menuFile
->Append (wxID_OPEN
, _("&Open ..\tCtrl+O"));
467 menuFile
->Append (wxID_SAVE
, _("&Save\tCtrl+S"));
468 menuFile
->Append (wxID_SAVEAS
, _("Save &as ..\tCtrl+Shift+S"));
469 menuFile
->Append (wxID_CLOSE
, _("&Close\tCtrl+W"));
470 menuFile
->AppendSeparator();
471 menuFile
->Append (myID_PROPERTIES
, _("Proper&ties ..\tCtrl+I"));
472 menuFile
->AppendSeparator();
473 menuFile
->Append (wxID_PRINT_SETUP
, _("Print Set&up .."));
474 menuFile
->Append (wxID_PREVIEW
, _("Print Pre&view\tCtrl+Shift+P"));
475 menuFile
->Append (wxID_PRINT
, _("&Print ..\tCtrl+P"));
476 menuFile
->AppendSeparator();
477 menuFile
->Append (wxID_EXIT
, _("&Quit\tCtrl+Q"));
480 wxMenu
*menuEdit
= new wxMenu
;
481 menuEdit
->Append (wxID_UNDO
, _("&Undo\tCtrl+Z"));
482 menuEdit
->Append (wxID_REDO
, _("&Redo\tCtrl+Shift+Z"));
483 menuEdit
->AppendSeparator();
484 menuEdit
->Append (wxID_CUT
, _("Cu&t\tCtrl+X"));
485 menuEdit
->Append (wxID_COPY
, _("&Copy\tCtrl+C"));
486 menuEdit
->Append (wxID_PASTE
, _("&Paste\tCtrl+V"));
487 menuEdit
->Append (wxID_CLEAR
, _("&Delete\tDel"));
488 menuEdit
->AppendSeparator();
489 menuEdit
->Append (wxID_FIND
, _("&Find\tCtrl+F"));
490 menuEdit
->Enable (wxID_FIND
, false);
491 menuEdit
->Append (myID_FINDNEXT
, _("Find &next\tF3"));
492 menuEdit
->Enable (myID_FINDNEXT
, false);
493 menuEdit
->Append (myID_REPLACE
, _("&Replace\tCtrl+H"));
494 menuEdit
->Enable (myID_REPLACE
, false);
495 menuEdit
->Append (myID_REPLACENEXT
, _("Replace &again\tShift+F4"));
496 menuEdit
->Enable (myID_REPLACENEXT
, false);
497 menuEdit
->AppendSeparator();
498 menuEdit
->Append (myID_BRACEMATCH
, _("&Match brace\tCtrl+M"));
499 menuEdit
->Append (myID_GOTO
, _("&Goto\tCtrl+G"));
500 menuEdit
->Enable (myID_GOTO
, false);
501 menuEdit
->AppendSeparator();
502 menuEdit
->Append (myID_INDENTINC
, _("&Indent increase\tTab"));
503 menuEdit
->Append (myID_INDENTRED
, _("I&ndent reduce\tBksp"));
504 menuEdit
->AppendSeparator();
505 menuEdit
->Append (wxID_SELECTALL
, _("&Select all\tCtrl+A"));
506 menuEdit
->Append (myID_SELECTLINE
, _("Select &line\tCtrl+L"));
509 wxMenu
*menuHilight
= new wxMenu
;
511 for (Nr
= 0; Nr
< g_LanguagePrefsSize
; Nr
++) {
512 menuHilight
->Append (myID_HILIGHTFIRST
+ Nr
,
513 g_LanguagePrefs
[Nr
].name
);
517 wxMenu
*menuCharset
= new wxMenu
;
518 menuCharset
->Append (myID_CHARSETANSI
, _("&ANSI (Windows)"));
519 menuCharset
->Append (myID_CHARSETMAC
, _("&MAC (Macintosh)"));
522 wxMenu
*menuView
= new wxMenu
;
523 menuView
->Append (myID_HILIGHTLANG
, _("&Hilight language .."), menuHilight
);
524 menuView
->AppendSeparator();
525 menuView
->AppendCheckItem (myID_FOLDTOGGLE
, _("&Toggle current fold\tCtrl+T"));
526 menuView
->AppendCheckItem (myID_OVERTYPE
, _("&Overwrite mode\tIns"));
527 menuView
->AppendCheckItem (myID_WRAPMODEON
, _("&Wrap mode\tCtrl+U"));
528 menuView
->AppendSeparator();
529 menuView
->AppendCheckItem (myID_DISPLAYEOL
, _("Show line &endings"));
530 menuView
->AppendCheckItem (myID_INDENTGUIDE
, _("Show &indent guides"));
531 menuView
->AppendCheckItem (myID_LINENUMBER
, _("Show line &numbers"));
532 menuView
->AppendCheckItem (myID_LONGLINEON
, _("Show &long line marker"));
533 menuView
->AppendCheckItem (myID_WHITESPACE
, _("Show white&space"));
534 menuView
->AppendSeparator();
535 menuView
->Append (myID_USECHARSET
, _("Use &code page of .."), menuCharset
);
537 // change case submenu
538 wxMenu
*menuChangeCase
= new wxMenu
;
539 menuChangeCase
->Append (myID_CHANGEUPPER
, _("&Upper case"));
540 menuChangeCase
->Append (myID_CHANGELOWER
, _("&Lower case"));
542 // convert EOL submenu
543 wxMenu
*menuConvertEOL
= new wxMenu
;
544 menuConvertEOL
->Append (myID_CONVERTCR
, _("CR (&Linux)"));
545 menuConvertEOL
->Append (myID_CONVERTCRLF
, _("CR+LF (&Windows)"));
546 menuConvertEOL
->Append (myID_CONVERTLF
, _("LF (&Macintosh)"));
549 wxMenu
*menuExtra
= new wxMenu
;
550 menuExtra
->AppendCheckItem (myID_READONLY
, _("&Readonly mode"));
551 menuExtra
->AppendSeparator();
552 menuExtra
->Append (myID_CHANGECASE
, _("Change &case to .."), menuChangeCase
);
553 menuExtra
->AppendSeparator();
554 menuExtra
->Append (myID_CONVERTEOL
, _("Convert line &endings to .."), menuConvertEOL
);
557 wxMenu
*menuWindow
= new wxMenu
;
558 menuWindow
->Append (myID_PAGEPREV
, _("&Previous\tCtrl+Shift+Tab"));
559 menuWindow
->Append (myID_PAGENEXT
, _("&Next\tCtrl+Tab"));
562 wxMenu
*menuHelp
= new wxMenu
;
563 menuHelp
->Append (wxID_ABOUT
, _("&About ..\tShift+F1"));
566 m_menuBar
->Append (menuFile
, _("&File"));
567 m_menuBar
->Append (menuEdit
, _("&Edit"));
568 m_menuBar
->Append (menuView
, _("&View"));
569 m_menuBar
->Append (menuExtra
, _("E&xtra"));
570 m_menuBar
->Append (menuWindow
, _("&Window"));
571 m_menuBar
->Append (menuHelp
, _("&Help"));
572 SetMenuBar (m_menuBar
);
575 void AppFrame::FileOpen (wxString fname
)
577 wxFileName
w(fname
); w
.Normalize(); fname
= w
.GetFullPath();
578 m_edit
->LoadFile (fname
);
581 wxRect
AppFrame::DeterminePrintSize () {
583 wxSize scr
= wxGetDisplaySize();
585 // determine position and size (shifting 16 left and down)
586 wxRect rect
= GetRect();
589 rect
.width
= wxMin (rect
.width
, (scr
.x
- rect
.x
));
590 rect
.height
= wxMin (rect
.height
, (scr
.x
- rect
.y
));
596 //----------------------------------------------------------------------------
598 //----------------------------------------------------------------------------
600 BEGIN_EVENT_TABLE (AppAbout
, wxDialog
)
601 EVT_TIMER (myID_ABOUTTIMER
, AppAbout::OnTimerEvent
)
604 AppAbout::AppAbout (wxWindow
*parent
,
607 : wxDialog (parent
, wxID_ANY
, wxEmptyString
,
608 wxDefaultPosition
, wxDefaultSize
,
609 style
| wxDEFAULT_DIALOG_STYLE
| wxRESIZE_BORDER
) {
613 if (milliseconds
> 0) {
614 m_timer
= new wxTimer (this, myID_ABOUTTIMER
);
615 m_timer
->Start (milliseconds
, wxTIMER_ONE_SHOT
);
618 // sets the application title
619 SetTitle (_("About .."));
622 wxGridSizer
*aboutinfo
= new wxGridSizer (2, 0, 2);
623 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Written by: ")),
625 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_MAINT
),
626 1, wxEXPAND
| wxALIGN_LEFT
);
627 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Version: ")),
629 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_VERSION
),
630 1, wxEXPAND
| wxALIGN_LEFT
);
631 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Licence type: ")),
633 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_LICENCE
),
634 1, wxEXPAND
| wxALIGN_LEFT
);
635 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, _("Copyright: ")),
637 aboutinfo
->Add (new wxStaticText(this, wxID_ANY
, APP_COPYRIGTH
),
638 1, wxEXPAND
| wxALIGN_LEFT
);
640 // about icontitle//info
641 wxBoxSizer
*aboutpane
= new wxBoxSizer (wxHORIZONTAL
);
642 wxBitmap bitmap
= wxBitmap(wxICON (mondrian
));
643 aboutpane
->Add (new wxStaticBitmap (this, wxID_ANY
, bitmap
),
644 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxRIGHT
, 20);
645 aboutpane
->Add (aboutinfo
, 1, wxEXPAND
);
646 aboutpane
->Add (60, 0);
649 wxBoxSizer
*totalpane
= new wxBoxSizer (wxVERTICAL
);
650 totalpane
->Add (0, 20);
651 wxStaticText
*appname
= new wxStaticText(this, wxID_ANY
, *g_appname
);
652 appname
->SetFont (wxFont (24, wxDEFAULT
, wxNORMAL
, wxBOLD
));
653 totalpane
->Add (appname
, 0, wxALIGN_CENTER
| wxLEFT
| wxRIGHT
, 40);
654 totalpane
->Add (0, 10);
655 totalpane
->Add (aboutpane
, 0, wxEXPAND
| wxALL
, 4);
656 totalpane
->Add (new wxStaticText(this, wxID_ANY
, APP_DESCR
),
657 0, wxALIGN_CENTER
| wxALL
, 10);
658 wxButton
*okButton
= new wxButton (this, wxID_OK
, _("OK"));
659 okButton
->SetDefault();
660 totalpane
->Add (okButton
, 0, wxALIGN_CENTER
| wxLEFT
| wxRIGHT
| wxBOTTOM
, 10);
662 SetSizerAndFit (totalpane
);
668 AppAbout::~AppAbout () {
675 //----------------------------------------------------------------------------
677 void AppAbout::OnTimerEvent (wxTimerEvent
&WXUNUSED(event
)) {
678 if (m_timer
) delete m_timer
;