wxWinCE build fix and source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-10-25 23:18:15 +00:00
parent 0bab774ba3
commit 9a173d48f7

View File

@@ -436,33 +436,35 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
SetMenuBar(menuBar); SetMenuBar(menuBar);
// create a status bar just for fun (by default with 1 pane only) // create a status bar just for fun (by default with 1 pane only)
#if wxUSE_STATUSBAR
CreateStatusBar(2); CreateStatusBar(2);
SetStatusText(_T("Welcome to wxRichTextCtrl!")); SetStatusText(_T("Welcome to wxRichTextCtrl!"));
#endif
wxToolBar* toolBar = CreateToolBar(); wxToolBar* toolBar = CreateToolBar();
toolBar->AddTool(wxID_OPEN, wxBitmap(open_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Open")); toolBar->AddTool(wxID_OPEN, wxBitmap(open_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Open"));
toolBar->AddTool(wxID_SAVEAS, wxBitmap(save_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Save")); toolBar->AddTool(wxID_SAVEAS, wxBitmap(save_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Save"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_CUT, wxBitmap(cut_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Cut")); toolBar->AddTool(wxID_CUT, wxBitmap(cut_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Cut"));
toolBar->AddTool(wxID_COPY, wxBitmap(copy_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Copy")); toolBar->AddTool(wxID_COPY, wxBitmap(copy_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Copy"));
toolBar->AddTool(wxID_PASTE, wxBitmap(paste_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Paste")); toolBar->AddTool(wxID_PASTE, wxBitmap(paste_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Paste"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_UNDO, wxBitmap(undo_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Undo")); toolBar->AddTool(wxID_UNDO, wxBitmap(undo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Undo"));
toolBar->AddTool(wxID_REDO, wxBitmap(redo_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Redo")); toolBar->AddTool(wxID_REDO, wxBitmap(redo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Redo"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_BOLD, wxBitmap(bold_xpm), wxNullBitmap, TRUE, -1, -1, (wxObject *) NULL, _("Bold")); toolBar->AddTool(ID_FORMAT_BOLD, wxBitmap(bold_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Bold"));
toolBar->AddTool(ID_FORMAT_ITALIC, wxBitmap(italic_xpm), wxNullBitmap, TRUE, -1, -1, (wxObject *) NULL, _("Italic")); toolBar->AddTool(ID_FORMAT_ITALIC, wxBitmap(italic_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Italic"));
toolBar->AddTool(ID_FORMAT_UNDERLINE, wxBitmap(underline_xpm), wxNullBitmap, TRUE, -1, -1, (wxObject *) NULL, _("Underline")); toolBar->AddTool(ID_FORMAT_UNDERLINE, wxBitmap(underline_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Underline"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_ALIGN_LEFT, wxBitmap(alignleft_xpm), wxNullBitmap, TRUE, -1, -1, (wxObject *) NULL, _("Align Left")); toolBar->AddTool(ID_FORMAT_ALIGN_LEFT, wxBitmap(alignleft_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Left"));
toolBar->AddTool(ID_FORMAT_ALIGN_CENTRE, wxBitmap(centre_xpm), wxNullBitmap, TRUE, -1, -1, (wxObject *) NULL, _("Centre")); toolBar->AddTool(ID_FORMAT_ALIGN_CENTRE, wxBitmap(centre_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Centre"));
toolBar->AddTool(ID_FORMAT_ALIGN_RIGHT, wxBitmap(alignright_xpm), wxNullBitmap, TRUE, -1, -1, (wxObject *) NULL, _("Align Right")); toolBar->AddTool(ID_FORMAT_ALIGN_RIGHT, wxBitmap(alignright_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Right"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxBitmap(indentless_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Indent Less")); toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxBitmap(indentless_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent Less"));
toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxBitmap(indentmore_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Indent More")); toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxBitmap(indentmore_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent More"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_FONT, wxBitmap(font_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Font")); toolBar->AddTool(ID_FORMAT_FONT, wxBitmap(font_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Font"));
toolBar->Realize(); toolBar->Realize();
@@ -687,7 +689,7 @@ bool MyFrame::ProcessEvent(wxEvent& event)
//s_command = NULL; //s_command = NULL;
s_eventType = 0; s_eventType = 0;
s_id = 0; s_id = 0;
return TRUE; return true;
} }
s_eventType = 0; s_eventType = 0;
@@ -695,7 +697,7 @@ bool MyFrame::ProcessEvent(wxEvent& event)
} }
else else
{ {
return FALSE; return false;
} }
} }
@@ -704,12 +706,12 @@ bool MyFrame::ProcessEvent(wxEvent& event)
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{ {
wxString path = wxEmptyString; wxString path;
wxString filename = wxEmptyString; wxString filename;
wxArrayInt fileTypes; wxArrayInt fileTypes;
wxString filter = wxRichTextBuffer::GetExtWildcard(false, false, & fileTypes); wxString filter = wxRichTextBuffer::GetExtWildcard(false, false, & fileTypes);
if (!filter.IsEmpty()) if (!filter.empty())
filter += wxT("|"); filter += wxT("|");
filter += wxT("All files (*.*)|*.*"); filter += wxT("All files (*.*)|*.*");
@@ -724,7 +726,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{ {
wxString path = dialog.GetPath(); wxString path = dialog.GetPath();
if (!path.IsEmpty()) if (!path.empty())
{ {
int fileType = 0; int fileType = 0;
int filterIndex = dialog.GetFilterIndex(); int filterIndex = dialog.GetFilterIndex();
@@ -739,7 +741,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnSave(wxCommandEvent& event) void MyFrame::OnSave(wxCommandEvent& event)
{ {
if (m_richTextCtrl->GetFilename().IsEmpty()) if (m_richTextCtrl->GetFilename().empty())
{ {
OnSaveAs(event); OnSaveAs(event);
return; return;
@@ -750,8 +752,8 @@ void MyFrame::OnSave(wxCommandEvent& event)
void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event))
{ {
wxString filter = wxRichTextBuffer::GetExtWildcard(false, true); wxString filter = wxRichTextBuffer::GetExtWildcard(false, true);
wxString path = wxEmptyString; wxString path;
wxString filename = wxEmptyString; wxString filename;
wxFileDialog dialog(this, wxFileDialog dialog(this,
_("Choose a filename"), _("Choose a filename"),
@@ -764,7 +766,7 @@ void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event))
{ {
wxString path = dialog.GetPath(); wxString path = dialog.GetPath();
if (!path.IsEmpty()) if (!path.empty())
{ {
m_richTextCtrl->SaveFile(path); m_richTextCtrl->SaveFile(path);
} }
@@ -1023,4 +1025,3 @@ void MyFrame::OnViewHTML(wxCommandEvent& WXUNUSED(event))
dialog.ShowModal(); dialog.ShowModal();
} }