-//! wxWindows headers
-#include <wx/config.h> // configuration support
-#include <wx/filedlg.h> // file dialog support
-#include <wx/filename.h> // filename support
-#include <wx/notebook.h> // notebook support
-#include <wx/settings.h> // system settings
-#include <wx/string.h> // strings support
-#include <wx/image.h> // images support
+//! wxWidgets headers
+#include "wx/config.h" // configuration support
+#include "wx/filedlg.h" // file dialog support
+#include "wx/filename.h" // filename support
+#include "wx/notebook.h" // notebook support
+#include "wx/settings.h" // system settings
+#include "wx/string.h" // strings support
+#include "wx/image.h" // images support
//! global print data, to remember settings during the session
wxPrintData *g_printData = (wxPrintData*) NULL;
wxPageSetupData *g_pageSetupData = (wxPageSetupData*) NULL;
//! global print data, to remember settings during the session
wxPrintData *g_printData = (wxPrintData*) NULL;
wxPageSetupData *g_pageSetupData = (wxPageSetupData*) NULL;
//----------------------------------------------------------------------------
//! application APP_VENDOR-APP_NAME.
//----------------------------------------------------------------------------
//! application APP_VENDOR-APP_NAME.
// initialize print data and setup
g_printData = new wxPrintData;
g_pageSetupData = new wxPageSetupDialogData;
// initialize print data and setup
g_printData = new wxPrintData;
g_pageSetupData = new wxPageSetupDialogData;
// delete global print data and setup
if (g_printData) delete g_printData;
if (g_pageSetupData) delete g_pageSetupData;
// delete global print data and setup
if (g_printData) delete g_printData;
if (g_pageSetupData) delete g_pageSetupData;
- : wxFrame ((wxFrame *)NULL, -1, title, wxDefaultPosition, wxSize(750,550),
+ : wxFrame ((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750,550),
- wxFileDialog dlg (this, _T("Open file"), _T(""), _T(""), _T("Any file (*)|*"),
- wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
+ wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
- wxFileDialog dlg (this, _T("Save file"), _T(""), _T(""), _T("Any file (*)|*"), wxSAVE|wxOVERWRITE_PROMPT);
+ wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dlg.ShowModal() != wxID_OK) return;
filename = dlg.GetPath();
m_edit->SaveFile (filename);
if (dlg.ShowModal() != wxID_OK) return;
filename = dlg.GetPath();
m_edit->SaveFile (filename);
(*g_pageSetupData) = * g_printData;
wxPageSetupDialog pageSetupDialog(this, g_pageSetupData);
pageSetupDialog.ShowModal();
(*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
(*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
(*g_pageSetupData) = * g_printData;
wxPageSetupDialog pageSetupDialog(this, g_pageSetupData);
pageSetupDialog.ShowModal();
(*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
(*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
wxPrintDialogData printDialogData( *g_printData);
wxPrintPreview *preview =
new wxPrintPreview (new EditPrint (m_edit),
wxPrintDialogData printDialogData( *g_printData);
wxPrintPreview *preview =
new wxPrintPreview (new EditPrint (m_edit),
wxPrintDialogData printDialogData( *g_printData);
wxPrinter printer (&printDialogData);
EditPrint printout (m_edit);
wxPrintDialogData printDialogData( *g_printData);
wxPrinter printer (&printDialogData);
EditPrint printout (m_edit);
// File menu
wxMenu *menuFile = new wxMenu;
menuFile->Append (wxID_OPEN, _("&Open ..\tCtrl+O"));
// File menu
wxMenu *menuFile = new wxMenu;
menuFile->Append (wxID_OPEN, _("&Open ..\tCtrl+O"));
menuEdit->Enable (myID_GOTO, false);
menuEdit->AppendSeparator();
menuEdit->Append (myID_INDENTINC, _("&Indent increase\tTab"));
menuEdit->Enable (myID_GOTO, false);
menuEdit->AppendSeparator();
menuEdit->Append (myID_INDENTINC, _("&Indent increase\tTab"));
menuEdit->AppendSeparator();
menuEdit->Append (wxID_SELECTALL, _("&Select all\tCtrl+A"));
menuEdit->Append (myID_SELECTLINE, _("Select &line\tCtrl+L"));
menuEdit->AppendSeparator();
menuEdit->Append (wxID_SELECTALL, _("&Select all\tCtrl+A"));
menuEdit->Append (myID_SELECTLINE, _("Select &line\tCtrl+L"));
m_menuBar->Append (menuWindow, _("&Window"));
m_menuBar->Append (menuHelp, _("&Help"));
SetMenuBar (m_menuBar);
m_menuBar->Append (menuWindow, _("&Window"));
m_menuBar->Append (menuHelp, _("&Help"));
SetMenuBar (m_menuBar);
- : wxDialog (parent, -1, wxEmptyString,
+ : wxDialog (parent, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
wxDefaultPosition, wxDefaultSize,
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
- aboutinfo->Add (new wxStaticText(this, -1, _("Written by: ")),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Written by: ")),
- aboutinfo->Add (new wxStaticText(this, -1, APP_MAINT),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_MAINT),
- aboutinfo->Add (new wxStaticText(this, -1, _("Version: ")),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Version: ")),
- aboutinfo->Add (new wxStaticText(this, -1, APP_VERSION),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_VERSION),
- aboutinfo->Add (new wxStaticText(this, -1, _("Licence type: ")),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Licence type: ")),
- aboutinfo->Add (new wxStaticText(this, -1, APP_LICENCE),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_LICENCE),
- aboutinfo->Add (new wxStaticText(this, -1, _("Copyright: ")),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Copyright: ")),
- aboutinfo->Add (new wxStaticText(this, -1, APP_COPYRIGTH),
+ aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_COPYRIGTH),
1, wxEXPAND | wxALIGN_LEFT);
// about icontitle//info
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
wxBitmap bitmap = wxBitmap(wxICON (mondrian));
1, wxEXPAND | wxALIGN_LEFT);
// about icontitle//info
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
wxBitmap bitmap = wxBitmap(wxICON (mondrian));
- aboutpane->Add (new wxStaticBitmap (this, -1, bitmap),
+ aboutpane->Add (new wxStaticBitmap (this, wxID_ANY, bitmap),
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
aboutpane->Add (aboutinfo, 1, wxEXPAND);
aboutpane->Add (60, 0);
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
aboutpane->Add (aboutinfo, 1, wxEXPAND);
aboutpane->Add (60, 0);
appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
totalpane->Add (0, 10);
totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
totalpane->Add (0, 10);
totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
- totalpane->Add (new wxStaticText(this, -1, APP_DESCR),
+ totalpane->Add (new wxStaticText(this, wxID_ANY, APP_DESCR),
0, wxALIGN_CENTER | wxALL, 10);
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
okButton->SetDefault();
0, wxALIGN_CENTER | wxALL, 10);
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
okButton->SetDefault();