From dabbc6a5a1795d169f26ce95927f3e4f1a5e7b7e Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Sat, 12 Jun 2004 23:44:08 +0000 Subject: [PATCH] removed SetAutoLayout(true) calls when a corresponding SetSizer() was also called (the latter already calls SetAutoLayout(true) in case of a non-NULL window); usual cleanup: removing tabs and end of line whitespace, TRUE->true, FALSE->false, -1->wxID_ANY, Enable(false)->Disable(), ""->wxEmptyString git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- .../samples/deprecated/proplist/proplist.cpp | 6 +- contrib/samples/gizmos/editlbox/test.cpp | 13 +- contrib/samples/mmedia/mmboard.cpp | 202 +++++++------- contrib/src/deprecated/propform.cpp | 2 +- contrib/src/deprecated/proplist.cpp | 126 +++++---- contrib/src/gizmos/editlbox.cpp | 10 +- contrib/src/xrc/xh_sizer.cpp | 1 - contrib/src/xrc/xh_unkwn.cpp | 1 - contrib/utils/wxrcedit/editor.cpp | 5 +- contrib/utils/wxrcedit/pe_adv.cpp | 5 +- contrib/utils/wxrcedit/propedit.cpp | 1 - demos/dbbrowse/dlguser.cpp | 36 +-- include/wx/file.h | 2 +- include/wx/fontenum.h | 30 +- include/wx/generic/logg.h | 8 +- include/wx/generic/progdlgg.h | 4 +- include/wx/gtk/font.h | 6 +- include/wx/gtk1/font.h | 6 +- include/wx/html/helpfrm.h | 8 +- include/wx/motif/frame.h | 6 +- include/wx/msw/font.h | 6 +- include/wx/msw/treectrl.h | 28 +- include/wx/os2/font.h | 6 +- samples/artprov/artbrows.cpp | 19 +- samples/dialogs/dialogs.cpp | 32 +-- samples/grid/griddemo.cpp | 37 ++- samples/help/demo.cpp | 3 +- samples/html/about/about.cpp | 5 +- samples/listbox/lboxtest.cpp | 5 +- samples/notebook/notebook.cpp | 2 - samples/statbar/statbar.cpp | 3 +- src/generic/fontdlgg.cpp | 32 +-- src/generic/logg.cpp | 57 ++-- src/generic/progdlgg.cpp | 28 +- src/generic/tipdlg.cpp | 53 ++-- src/html/helpfrm.cpp | 261 +++++++++--------- src/xrc/xh_sizer.cpp | 1 - src/xrc/xh_unkwn.cpp | 1 - utils/configtool/src/configbrowser.cpp | 8 +- utils/configtool/src/configitemselector.cpp | 3 +- utils/configtool/src/custompropertydialog.cpp | 7 +- utils/configtool/src/propeditor.cpp | 32 +-- utils/configtool/src/settingsdialog.cpp | 11 +- utils/helpview/src/client.cpp | 3 +- wxPython/contrib/dllwidget/dllwidget.cpp | 13 +- wxPython/contrib/dllwidget/dllwidget.h | 8 +- wxPython/demo/dllwidget/test_dll.cpp | 2 +- 47 files changed, 560 insertions(+), 584 deletions(-) diff --git a/contrib/samples/deprecated/proplist/proplist.cpp b/contrib/samples/deprecated/proplist/proplist.cpp index f2f710453e..37b931a031 100644 --- a/contrib/samples/deprecated/proplist/proplist.cpp +++ b/contrib/samples/deprecated/proplist/proplist.cpp @@ -75,7 +75,7 @@ bool MyApp::OnInit(void) m_mainFrame->Show(true); SetTopWindow(m_mainFrame); - + return true; } @@ -266,7 +266,7 @@ void MyApp::PropertyFormTest(bool useDialog) panel->SetConstraints(c); } #endif - + // Add items to the panel wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxDefaultPosition, wxSize(80, 26), 0, wxDefaultValidator, _T("ok")); @@ -306,7 +306,7 @@ void MyApp::PropertyFormTest(bool useDialog) okButton->SetConstraints(c); // The name of this text item matches the "fred" property - wxTextCtrl *text = new wxTextCtrl(panel, wxID_ANY, _T("Fred"), wxDefaultPosition, + wxTextCtrl *text = new wxTextCtrl(panel, wxID_ANY, _T("Fred"), wxDefaultPosition, wxSize( 200, wxDefaultSize.y), 0, wxDefaultValidator, _T("fred")); c = new wxLayoutConstraints; diff --git a/contrib/samples/gizmos/editlbox/test.cpp b/contrib/samples/gizmos/editlbox/test.cpp index f3a612df32..3620a451de 100644 --- a/contrib/samples/gizmos/editlbox/test.cpp +++ b/contrib/samples/gizmos/editlbox/test.cpp @@ -29,13 +29,13 @@ bool MyApp::OnInit() wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); wxSizer *sizer = new wxBoxSizer(wxVERTICAL); - sizer->Add(new wxEditableListBox(&dlg, wxID_ANY, _("Match these wildcards:"), + sizer->Add(new wxEditableListBox(&dlg, wxID_ANY, _("Match these wildcards:"), wxDefaultPosition,wxSize(300,200)), 1, wxEXPAND|wxALL, 10); - + sizer->Add(5,5); - wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"), + wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"), wxDefaultPosition,wxSize(300,200)); wxArrayString ar; ar.Add(_T("*.cpp")); @@ -46,13 +46,12 @@ bool MyApp::OnInit() sizer->Add(lb, 1, wxEXPAND|wxALL, 10); sizer->Add(5,5); - + sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10); - dlg.SetAutoLayout(true); dlg.SetSizer(sizer); sizer->Fit(&dlg); dlg.Centre(); - + dlg.ShowModal(); wxString res = _("'Except' contains these strings:\n\n"); @@ -60,6 +59,6 @@ bool MyApp::OnInit() for (size_t i = 0; i < ar.GetCount(); i++) res << ar[i] << _T("\n"); wxMessageBox(res); - + return false; } diff --git a/contrib/samples/mmedia/mmboard.cpp b/contrib/samples/mmedia/mmboard.cpp index 3064f67c24..cb430f5fa8 100644 --- a/contrib/samples/mmedia/mmboard.cpp +++ b/contrib/samples/mmedia/mmboard.cpp @@ -75,7 +75,7 @@ public: MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size); // dtor ~MMBoardFrame(); - + // event handlers void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); @@ -86,28 +86,28 @@ public: void OnEject(wxCommandEvent& event); void OnRefreshInfo(wxEvent& event); void OnSetPosition(wxCommandEvent& event); - + void OpenVideoWindow(); void CloseVideoWindow(); - + private: // any class wishing to process wxWidgets events must use this macro DECLARE_EVENT_TABLE() private: - void UpdateMMedInfo(); + void UpdateMMedInfo(); void UpdateInfoText(); - + MMBoardFile *m_opened_file; - + wxSlider *m_positionSlider; wxBitmapButton *m_playButton, *m_pauseButton, *m_stopButton, *m_ejectButton; wxStaticText *m_fileType, *m_infoText; wxWindow *m_video_window; - + wxPanel *m_panel; wxSizer *m_sizer; - + wxTimer *m_refreshTimer; }; @@ -142,7 +142,7 @@ BEGIN_EVENT_TABLE(MMBoardFrame, wxFrame) EVT_BUTTON(MMBoard_PlayButton, MMBoardFrame::OnPlay) EVT_BUTTON(MMBoard_StopButton, MMBoardFrame::OnStop) EVT_BUTTON(MMBoard_PauseButton, MMBoardFrame::OnPause) - EVT_BUTTON(MMBoard_EjectButton, MMBoardFrame::OnEject) + EVT_BUTTON(MMBoard_EjectButton, MMBoardFrame::OnEject) EVT_SLIDER(MMBoard_PositionSlider, MMBoardFrame::OnSetPosition) EVT_CUSTOM(wxEVT_TIMER, MMBoard_RefreshInfo, MMBoardFrame::OnRefreshInfo) END_EVENT_TABLE() @@ -169,43 +169,43 @@ bool MMBoardApp::OnInit() // and show it (the frames, unlike simple controls, are not shown when // created initially) - frame->Show(TRUE); + frame->Show(); m_caps = TestMultimediaCaps(); if (!m_caps) { wxMessageBox(_T("Your system has no multimedia capabilities. We are exiting now."), _T("Major error !"), wxOK | wxICON_ERROR, NULL); - return FALSE; + return false; } wxString msg; msg.Printf(_T("Detected : %s%s%s"), (m_caps & MM_SOUND_OSS) ? _T("OSS ") : _T(""), - (m_caps & MM_SOUND_ESD) ? _T("ESD ") : _T(""), - (m_caps & MM_SOUND_WIN) ? _T("WIN") : _T("")); + (m_caps & MM_SOUND_ESD) ? _T("ESD ") : _T(""), + (m_caps & MM_SOUND_WIN) ? _T("WIN") : _T("")); wxMessageBox(msg, _T("Good !"), wxOK | wxICON_INFORMATION, NULL); // success: wxApp::OnRun() will be called which will enter the main message - // loop and the application will run. If we returned FALSE here, the + // loop and the application will run. If we returned false here, the // application would exit immediately. - return TRUE; + return true; } wxUint8 MMBoardApp::TestMultimediaCaps() { wxSoundStream *dev; wxUint8 caps; - + caps = 0; - + #ifdef __UNIX__ // We now test the ESD support - + dev = new wxSoundStreamESD(); - if (dev->GetError() == wxSOUND_NOERROR) + if (dev->GetError() == wxSOUND_NOERROR) caps |= MM_SOUND_ESD; delete dev; - + // We test the OSS (Open Sound System) support. // WARNING: There is a conflict between ESD and ALSA. We may be interrested // in disabling the auto detection of OSS is ESD has been detected. @@ -222,7 +222,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps() #endif #endif - + #ifdef __WIN32__ // We test the Windows sound support. @@ -231,7 +231,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps() caps |= MM_SOUND_WIN; delete dev; #endif - + return caps; } @@ -241,7 +241,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps() // frame constructor MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size) - : wxFrame((wxFrame *)NULL, -1, title, pos, size) + : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size) { #ifdef __WXMAC__ // we need this in order to allow the about menu relocation, since ABOUT is @@ -253,7 +253,7 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi SetIcon(wxICON(mondrian)); // create a menu bar - wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF); + wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF); // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; @@ -280,68 +280,66 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi // Misc variables m_opened_file = NULL; - m_panel = new wxPanel(this, -1); + m_panel = new wxPanel(this, wxID_ANY); // Initialize main slider m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60, - wxDefaultPosition, wxSize(300, -1), - wxSL_HORIZONTAL | wxSL_AUTOTICKS); + wxDefaultPosition, wxSize(300, -1), + wxSL_HORIZONTAL | wxSL_AUTOTICKS); m_positionSlider->SetPageSize(60); // 60 secs - m_positionSlider->Enable(FALSE); - + m_positionSlider->Disable(); + // Initialize info panel - wxPanel *infoPanel = new wxPanel( m_panel, -1); + wxPanel *infoPanel = new wxPanel( m_panel, wxID_ANY); infoPanel->SetBackgroundColour(*wxBLACK); infoPanel->SetForegroundColour(*wxWHITE); wxBoxSizer *infoSizer = new wxBoxSizer(wxVERTICAL); - m_fileType = new wxStaticText(infoPanel, -1, wxT("")); - wxStaticLine *line = new wxStaticLine(infoPanel, -1); - m_infoText = new wxStaticText(infoPanel, -1, _T("")); + m_fileType = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString); + wxStaticLine *line = new wxStaticLine(infoPanel, wxID_ANY); + m_infoText = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString); UpdateInfoText(); infoSizer->Add(m_fileType, 0, wxGROW | wxALL, 1); infoSizer->Add(line, 0, wxGROW | wxCENTRE, 20); infoSizer->Add(m_infoText, 0, wxGROW | wxALL, 1); - + infoPanel->SetSizer(infoSizer); - infoPanel->SetAutoLayout(TRUE); // Bitmap button panel wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - + wxBitmap play_bmp(play_back_xpm); wxBitmap stop_bmp(stop_back_xpm); wxBitmap eject_bmp(eject_xpm); wxBitmap pause_bmp(pause_xpm); m_playButton = new wxBitmapButton(m_panel, MMBoard_PlayButton, play_bmp); - m_playButton->Enable(FALSE); + m_playButton->Disable(); m_pauseButton = new wxBitmapButton(m_panel, MMBoard_PauseButton, pause_bmp); - m_pauseButton->Enable(FALSE); + m_pauseButton->Disable(); m_stopButton = new wxBitmapButton(m_panel, MMBoard_StopButton, stop_bmp); - m_stopButton->Enable(FALSE); + m_stopButton->Disable(); m_ejectButton = new wxBitmapButton(m_panel, MMBoard_EjectButton, eject_bmp); - m_ejectButton->Enable(FALSE); - + m_ejectButton->Disable(); + buttonSizer->Add(m_playButton, 0, wxALL, 2); - buttonSizer->Add(m_pauseButton, 0, wxALL, 2); + buttonSizer->Add(m_pauseButton, 0, wxALL, 2); buttonSizer->Add(m_stopButton, 0, wxALL, 2); buttonSizer->Add(m_ejectButton, 0, wxALL, 2); // Top sizer m_sizer = new wxBoxSizer(wxVERTICAL); - m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0); + m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0); m_sizer->Add(m_positionSlider, 0, wxCENTRE | wxGROW | wxALL, 2); - m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0); + m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0); m_sizer->Add(buttonSizer, 0, wxALL, 0); - m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0); + m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0); m_sizer->Add(infoPanel, 1, wxCENTRE | wxGROW, 0); - + m_panel->SetSizer(m_sizer); - m_panel->SetAutoLayout(TRUE); m_sizer->Fit(this); m_sizer->SetSizeHints(this); @@ -359,7 +357,7 @@ MMBoardFrame::~MMBoardFrame() { if (m_opened_file) delete m_opened_file; - + delete m_refreshTimer; } @@ -368,7 +366,7 @@ void MMBoardFrame::OpenVideoWindow() if (m_video_window) return; - m_video_window = new wxWindow(m_panel, -1, wxDefaultPosition, wxSize(200, 200)); + m_video_window = new wxWindow(m_panel, wxID_ANY, wxDefaultPosition, wxSize(200, 200)); m_video_window->SetBackgroundColour(*wxBLACK); m_sizer->Prepend(m_video_window, 2, wxGROW | wxSHRINK | wxCENTRE, 1); @@ -391,8 +389,8 @@ void MMBoardFrame::CloseVideoWindow() void MMBoardFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - // TRUE is to force the frame to close - Close(TRUE); + // true is to force the frame to close + Close(true); } void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) @@ -400,15 +398,15 @@ void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxString msg; msg.Printf( wxT("wxWidgets Multimedia board v1.0a, wxMMedia v2.0a:\n") wxT("an example of the capabilities of the wxWidgets multimedia classes.\n") - wxT("Copyright 1999, 2000, Guilhem Lavaux.\n")); - + wxT("Copyright 1999, 2000, Guilhem Lavaux.\n")); + wxMessageBox(msg, _T("About MMBoard"), wxOK | wxICON_INFORMATION, this); } void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) { wxString selected_file; - + if (m_opened_file) { if (!m_opened_file->IsStopped()) { wxCommandEvent event2; @@ -416,33 +414,33 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) } delete m_opened_file; } - + // select a file to be opened selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this); if (selected_file.IsNull()) return; - + m_opened_file = MMBoardManager::Open(selected_file); - + // Change the range values of the slider. MMBoardTime length; - + length = m_opened_file->GetLength(); m_positionSlider->SetRange(0, length.hours * 3600 + length.minutes * 60 + length.seconds); - + // Update misc info UpdateMMedInfo(); - + SetStatusText(selected_file, 2); - + // Update info text UpdateInfoText(); - + // Enable a few buttons - m_playButton->Enable(TRUE); - m_ejectButton->Enable(TRUE); - m_positionSlider->Enable(TRUE); - + m_playButton->Enable(); + m_ejectButton->Enable(); + m_positionSlider->Enable(); + if (m_opened_file->NeedWindow()) { OpenVideoWindow(); m_opened_file->SetWindow(m_video_window); @@ -453,18 +451,18 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) void MMBoardFrame::UpdateInfoText() { wxString infotext1, infotext2; - + if (m_opened_file) { infotext1 = wxT("File type:\n\t"); infotext1 += m_opened_file->GetStringType() + wxT("\n"); - + infotext2 = wxT("File informations:\n\n"); infotext2 += m_opened_file->GetStringInformation(); } else { infotext1 = wxT("File type: \n\tNo file opened"); infotext2 = wxT("File informations:\nNo information\n\n\n\n\n"); } - + m_fileType->SetLabel(infotext1); m_infoText->SetLabel(infotext2); } @@ -473,7 +471,7 @@ void MMBoardFrame::UpdateMMedInfo() { wxString temp_string; MMBoardTime current, length; - + if (m_opened_file) { current = m_opened_file->GetPosition(); length = m_opened_file->GetLength(); @@ -486,7 +484,7 @@ void MMBoardFrame::UpdateMMedInfo() temp_string.Printf(wxT("%02d:%02d / %02d:%02d"), current.hours * 60 + current.minutes, current.seconds, length.hours * 60 + length.minutes, length.seconds); SetStatusText(temp_string, 1); - + // We set the slider position m_positionSlider->SetValue(current.hours * 3600 + current.minutes * 60 + current.seconds); } @@ -497,33 +495,35 @@ void MMBoardFrame::UpdateMMedInfo() void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event)) { UpdateMMedInfo(); - - if (m_opened_file->IsStopped()) { + + if (m_opened_file->IsStopped()) + { m_refreshTimer->Stop(); - m_playButton->Enable(TRUE); - m_stopButton->Enable(FALSE); - m_pauseButton->Enable(FALSE); + m_playButton->Enable(); + m_stopButton->Disable(); + m_pauseButton->Disable(); } } void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) { - m_stopButton->Enable(TRUE); - m_pauseButton->Enable(TRUE); - m_playButton->Enable(FALSE); - - if (m_opened_file->IsPaused()) { + m_stopButton->Enable(); + m_pauseButton->Enable(); + m_playButton->Disable(); + + if (m_opened_file->IsPaused()) + { m_opened_file->Resume(); return; } - - m_refreshTimer->Start(1000, FALSE); - + + m_refreshTimer->Start(1000, false); + m_opened_file->Play(); - - m_stopButton->Enable(TRUE); - m_pauseButton->Enable(TRUE); - m_playButton->Enable(FALSE); + + m_stopButton->Enable(); + m_pauseButton->Enable(); + m_playButton->Disable(); } void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event)) @@ -531,18 +531,18 @@ void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event)) m_opened_file->Stop(); m_refreshTimer->Stop(); - m_stopButton->Enable(FALSE); - m_playButton->Enable(TRUE); - + m_stopButton->Disable(); + m_playButton->Enable(); + UpdateMMedInfo(); } void MMBoardFrame::OnPause(wxCommandEvent& WXUNUSED(event)) { m_opened_file->Pause(); - - m_playButton->Enable(TRUE); - m_pauseButton->Enable(FALSE); + + m_playButton->Enable(); + m_pauseButton->Disable(); } void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event)) @@ -551,12 +551,12 @@ void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event)) delete m_opened_file; m_opened_file = NULL; - - m_playButton->Enable(FALSE); - m_pauseButton->Enable(FALSE); - m_stopButton->Enable(FALSE); - m_ejectButton->Enable(FALSE); - m_positionSlider->Enable(FALSE); + + m_playButton->Disable(); + m_pauseButton->Disable(); + m_stopButton->Disable(); + m_ejectButton->Disable(); + m_positionSlider->Disable(); UpdateInfoText(); UpdateMMedInfo(); @@ -566,7 +566,7 @@ void MMBoardFrame::OnSetPosition(wxCommandEvent& WXUNUSED(event)) { wxUint32 itime; MMBoardTime btime; - + itime = m_positionSlider->GetValue(); btime.seconds = itime % 60; btime.minutes = (itime / 60) % 60; diff --git a/contrib/src/deprecated/propform.cpp b/contrib/src/deprecated/propform.cpp index e7730d4281..2395e564c5 100644 --- a/contrib/src/deprecated/propform.cpp +++ b/contrib/src/deprecated/propform.cpp @@ -218,7 +218,7 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event) if (!m_propertySheet) return; - if (win.GetName() == wxT("")) + if (win.GetName().empty()) return; if (wxStrcmp(win.GetName(), wxT("ok")) == 0) diff --git a/contrib/src/deprecated/proplist.cpp b/contrib/src/deprecated/proplist.cpp index 98f4853ebd..10a3e9fa8f 100644 --- a/contrib/src/deprecated/proplist.cpp +++ b/contrib/src/deprecated/proplist.cpp @@ -156,7 +156,7 @@ bool wxPropertyListView::UpdatePropertyList(bool clearEditArea) if (clearEditArea) { m_valueList->Clear(); - m_valueText->SetValue( wxT("") ); + m_valueText->SetValue(wxEmptyString); } wxNode *node = m_propertySheet->GetProperties().GetFirst(); @@ -248,7 +248,7 @@ bool wxPropertyListView::ShowProperty(wxProperty *property, bool select) } m_valueList->Clear(); - m_valueText->SetValue( wxT("") ); + m_valueText->SetValue(wxEmptyString); if (property) { @@ -464,15 +464,15 @@ bool wxPropertyListView::CreateControls() topsizer->Add( m_cancelButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder ); } - m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, _T(""), + m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, wxEmptyString, wxDefaultPosition, wxSize(wxDefaultSize.x, smallButtonSize.y), wxPROCESS_ENTER); - m_valueText->Enable(false); + m_valueText->Disable(); topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder ); if (m_buttonFlags & wxPROP_PULLDOWN) { m_editButton = new wxButton(panel, wxID_PROP_EDIT, _T("..."), wxDefaultPosition, smallButtonSize); - m_editButton->Enable(false); + m_editButton->Disable(); topsizer->Add( m_editButton, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder ); } @@ -826,7 +826,7 @@ bool wxPropertyListValidator::OnSelect(bool select, wxProperty *property, wxProp bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { wxString s(view->GetValueList()->GetStringSelection()); - if (s != wxT("")) + if ( !s.empty() ) { view->GetValueText()->SetValue(s); view->RetrieveProperty(property); @@ -864,11 +864,11 @@ void wxPropertyListValidator::OnEdit(wxProperty *WXUNUSED(property), wxPropertyL bool wxPropertyListValidator::OnClearControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(false); + view->GetConfirmButton()->Disable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(false); + view->GetCancelButton()->Disable(); if (view->GetEditButton()) - view->GetEditButton()->Enable(false); + view->GetEditButton()->Disable(); return true; } @@ -929,13 +929,13 @@ bool wxRealListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi bool wxRealListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(true); + view->GetConfirmButton()->Enable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(true); + view->GetCancelButton()->Enable(); if (view->GetEditButton()) - view->GetEditButton()->Enable(false); + view->GetEditButton()->Disable(); if (view->GetValueText()) - view->GetValueText()->Enable(true); + view->GetValueText()->Enable(); return true; } @@ -991,13 +991,13 @@ bool wxIntegerListValidator::OnRetrieveValue(wxProperty *property, wxPropertyLis bool wxIntegerListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(true); + view->GetConfirmButton()->Enable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(true); + view->GetCancelButton()->Enable(); if (view->GetEditButton()) - view->GetEditButton()->Enable(false); + view->GetEditButton()->Disable(); if (view->GetValueText()) - view->GetValueText()->Enable(true); + view->GetValueText()->Enable(); return true; } @@ -1054,13 +1054,13 @@ bool wxBoolListValidator::OnDisplayValue(wxProperty *property, wxPropertyListVie bool wxBoolListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(false); + view->GetConfirmButton()->Disable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(false); + view->GetCancelButton()->Disable(); if (view->GetEditButton()) - view->GetEditButton()->Enable(true); + view->GetEditButton()->Enable(); if (view->GetValueText()) - view->GetValueText()->Enable(false); + view->GetValueText()->Disable(); return true; } @@ -1069,7 +1069,7 @@ bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property) if (view->GetValueList()) { view->ShowListBoxControl(true); - view->GetValueList()->Enable(true); + view->GetValueList()->Enable(); view->GetValueList()->Append(wxT("True")); view->GetValueList()->Append(wxT("False")); @@ -1086,7 +1086,7 @@ bool wxBoolListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property), { view->GetValueList()->Clear(); view->ShowListBoxControl(false); - view->GetValueList()->Enable(false); + view->GetValueList()->Disable(); } return true; } @@ -1175,27 +1175,27 @@ bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wx if (!m_strings) { if (view->GetEditButton()) - view->GetEditButton()->Enable(false); + view->GetEditButton()->Disable(); if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(true); + view->GetConfirmButton()->Enable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(true); + view->GetCancelButton()->Enable(); if (view->GetValueText()) - view->GetValueText()->Enable(true); + view->GetValueText()->Enable(); return true; } // Constrained if (view->GetValueText()) - view->GetValueText()->Enable(false); + view->GetValueText()->Disable(); if (view->GetEditButton()) - view->GetEditButton()->Enable(true); + view->GetEditButton()->Enable(); if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(false); + view->GetConfirmButton()->Disable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(false); + view->GetCancelButton()->Disable(); return true; } @@ -1206,7 +1206,7 @@ bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property, if (view->GetValueList()) { view->ShowListBoxControl(true); - view->GetValueList()->Enable(true); + view->GetValueList()->Enable(); wxStringList::Node *node = m_strings->GetFirst(); while (node) { @@ -1231,7 +1231,7 @@ bool wxStringListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property) { view->GetValueList()->Clear(); view->ShowListBoxControl(false); - view->GetValueList()->Enable(false); + view->GetValueList()->Disable(); } return true; } @@ -1326,11 +1326,11 @@ bool wxFilenameListValidator::OnDoubleClick(wxProperty *property, wxPropertyList bool wxFilenameListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(true); + view->GetConfirmButton()->Enable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(true); + view->GetCancelButton()->Enable(); if (view->GetEditButton()) - view->GetEditButton()->Enable(true); + view->GetEditButton()->Enable(); if (view->GetValueText()) view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING); return true; @@ -1349,7 +1349,7 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v m_filenameWildCard.GetData(), 0, parentWindow); - if (s != wxT("")) + if ( !s.empty() ) { property->GetValue() = s; view->DisplayProperty(property); @@ -1414,15 +1414,19 @@ bool wxColourListValidator::OnDoubleClick(wxProperty *property, wxPropertyListVi bool wxColourListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { - if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(true); - if (view->GetCancelButton()) - view->GetCancelButton()->Enable(true); - if (view->GetEditButton()) - view->GetEditButton()->Enable(true); - if (view->GetValueText()) - view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING); - return true; + if (view->GetConfirmButton()) + view->GetConfirmButton()->Enable(); + + if (view->GetCancelButton()) + view->GetCancelButton()->Enable(); + + if (view->GetEditButton()) + view->GetEditButton()->Enable(); + + if (view->GetValueText()) + view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING); + + return true; } void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) @@ -1509,14 +1513,14 @@ bool wxListOfStringsListValidator::OnDisplayValue(wxProperty *property, wxProper bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetEditButton()) - view->GetEditButton()->Enable(true); + view->GetEditButton()->Enable(); if (view->GetValueText()) - view->GetValueText()->Enable(false); + view->GetValueText()->Disable(); if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(false); + view->GetConfirmButton()->Disable(); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(false); + view->GetCancelButton()->Disable(); return true; } @@ -1651,9 +1655,9 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE); dialog->m_stringText = new wxPropertyStringListEditorText(dialog, - wxID_PROP_SL_TEXT, wxT(""), wxPoint(5, 240), + wxID_PROP_SL_TEXT, wxEmptyString, wxPoint(5, 240), wxSize(300, wxDefaultSize.y), wxPROCESS_ENTER); - dialog->m_stringText->Enable(false); + dialog->m_stringText->Disable(); wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); @@ -1665,15 +1669,15 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList #endif wxBoxSizer *m_bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); - m_bottom_sizer->Add(addButton, 0, wxALL | wxALIGN_LEFT, 2 ); - m_bottom_sizer->Add(deleteButton, 0, wxALL | wxALIGN_LEFT, 2 ); + m_bottom_sizer->Add(addButton, 0, wxALL | wxALIGN_LEFT, 2 ); + m_bottom_sizer->Add(deleteButton, 0, wxALL | wxALIGN_LEFT, 2 ); m_bottom_sizer->Add(1, 1, 1, wxEXPAND | wxALL); - m_bottom_sizer->Add(cancelButton, 0, wxALL | wxALIGN_RIGHT, 2 ); - m_bottom_sizer->Add(okButton, 0, wxALL | wxALIGN_RIGHT, 2 ); + m_bottom_sizer->Add(cancelButton, 0, wxALL | wxALIGN_RIGHT, 2 ); + m_bottom_sizer->Add(okButton, 0, wxALL | wxALIGN_RIGHT, 2 ); wxBoxSizer *m_sizer = new wxBoxSizer( wxVERTICAL ); - m_sizer->Add(dialog->m_listBox, 1, wxEXPAND | wxALL, 2 ); - m_sizer->Add(dialog->m_stringText, 0, wxEXPAND | wxALL, 2 ); + m_sizer->Add(dialog->m_listBox, 1, wxEXPAND | wxALL, 2 ); + m_sizer->Add(dialog->m_stringText, 0, wxEXPAND | wxALL, 2 ); m_sizer->Add(m_bottom_sizer, 0, wxEXPAND | wxALL , 0 ); dialog->SetSizer( m_sizer ); @@ -1729,7 +1733,7 @@ void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event)) delete[] (wxChar *)node->GetData(); delete node; m_currentSelection = -1; - m_stringText->SetValue(_T("")); + m_stringText->SetValue(wxEmptyString); } void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event)) @@ -1798,13 +1802,13 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection() { if (m_currentSelection == -1) { - m_stringText->SetValue(wxT("")); + m_stringText->SetValue(wxEmptyString); return; } wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection); wxChar *txt = (wxChar *)node->GetData(); m_stringText->SetValue(txt); - m_stringText->Enable(true); + m_stringText->Enable(); } diff --git a/contrib/src/gizmos/editlbox.cpp b/contrib/src/gizmos/editlbox.cpp index 14c7b90831..b8b1e8cb3b 100644 --- a/contrib/src/gizmos/editlbox.cpp +++ b/contrib/src/gizmos/editlbox.cpp @@ -115,7 +115,7 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id, : wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name) { m_style = style; - m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL; + m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL; wxSizer *sizer = new wxBoxSizer(wxVERTICAL); @@ -165,7 +165,6 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id, m_bDown->SetToolTip(_("Move down")); #endif - subp->SetAutoLayout(true); subp->SetSizer(subsizer); subsizer->Fit(subp); @@ -181,7 +180,6 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id, sizer->Add(m_listCtrl, 1, wxEXPAND); - SetAutoLayout(true); SetSizer(sizer); Layout(); } @@ -194,7 +192,7 @@ void wxEditableListBox::SetStrings(const wxArrayString& strings) for (i = 0; i < strings.GetCount(); i++) m_listCtrl->InsertItem(i, strings[i]); - m_listCtrl->InsertItem(strings.GetCount(), _T("")); + m_listCtrl->InsertItem(strings.GetCount(), wxEmptyString); m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } @@ -226,13 +224,13 @@ void wxEditableListBox::OnNewItem(wxCommandEvent& WXUNUSED(event)) void wxEditableListBox::OnEndLabelEdit(wxListEvent& event) { - if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 && + if ( event.GetIndex() == m_listCtrl->GetItemCount()-1 && !event.GetText().IsEmpty() ) { // The user edited last (empty) line, i.e. added new entry. We have to // add new empty line here so that adding one more line is still // possible: - m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), _T("")); + m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxEmptyString); } } diff --git a/contrib/src/xrc/xh_sizer.cpp b/contrib/src/xrc/xh_sizer.cpp index 1163ab619f..ba6c799f25 100644 --- a/contrib/src/xrc/xh_sizer.cpp +++ b/contrib/src/xrc/xh_sizer.cpp @@ -223,7 +223,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer() if (m_parentSizer == NULL) // setup window: { - m_parentAsWindow->SetAutoLayout(true); m_parentAsWindow->SetSizer(sizer); wxXmlNode *nd = m_node; diff --git a/contrib/src/xrc/xh_unkwn.cpp b/contrib/src/xrc/xh_unkwn.cpp index d8b615cf6e..84c0158ff1 100644 --- a/contrib/src/xrc/xh_unkwn.cpp +++ b/contrib/src/xrc/xh_unkwn.cpp @@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child) wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add((wxWindow*)child, 1, wxEXPAND); SetSizer(sizer); - SetAutoLayout(true); Layout(); } diff --git a/contrib/utils/wxrcedit/editor.cpp b/contrib/utils/wxrcedit/editor.cpp index c41c44d9a6..c148ccc0dd 100644 --- a/contrib/utils/wxrcedit/editor.cpp +++ b/contrib/utils/wxrcedit/editor.cpp @@ -255,7 +255,6 @@ EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename) m_TreeCtrl->AssignImageList(imgList); sizer->Add(m_TreeCtrl, 1, wxEXPAND); - SetAutoLayout(true); SetSizer(sizer); // Load file: @@ -533,7 +532,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event) case ID_OPEN : { wxString cwd = wxGetCwd(); // workaround for 2.2 - wxString name = wxFileSelector(_("Open XML resource"), _T(""), _T(""), _T(""), _("XML resources (*.xrc)|*.xrc"), wxOPEN | wxFILE_MUST_EXIST); + wxString name = wxFileSelector(_("Open XML resource"), wxEmptyString, wxEmptyString, wxEmptyString, _("XML resources (*.xrc)|*.xrc"), wxOPEN | wxFILE_MUST_EXIST); wxSetWorkingDirectory(cwd); if (!name.IsEmpty()) LoadFile(name); @@ -547,7 +546,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event) case ID_SAVEAS : { wxString cwd = wxGetCwd(); // workaround for 2.2 - wxString name = wxFileSelector(_("Save as"), _T(""), m_FileName, _T(""), _("XML resources (*.xrc)|*.xrc"), wxSAVE | wxOVERWRITE_PROMPT); + wxString name = wxFileSelector(_("Save as"), wxEmptyString, m_FileName, wxEmptyString, _("XML resources (*.xrc)|*.xrc"), wxSAVE | wxOVERWRITE_PROMPT); wxSetWorkingDirectory(cwd); if (!name.IsEmpty()) SaveFile((m_FileName = name)); diff --git a/contrib/utils/wxrcedit/pe_adv.cpp b/contrib/utils/wxrcedit/pe_adv.cpp index d463b1adbc..02b5e5dd62 100644 --- a/contrib/utils/wxrcedit/pe_adv.cpp +++ b/contrib/utils/wxrcedit/pe_adv.cpp @@ -36,7 +36,7 @@ wxWindow* PropEditCtrlFont::CreateEditCtrl() { PropEditCtrlTxt::CreateEditCtrl(); - m_TextCtrl->Enable(false); + m_TextCtrl->Disable(); return m_TextCtrl; } @@ -165,7 +165,6 @@ void PropEditCtrlFlags::OnDetails() sz->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10); dlg.SetSizer(sz); - dlg.SetAutoLayout(true); dlg.Layout(); for (i = 0; i < arr.GetCount(); i++) @@ -219,7 +218,7 @@ void PropEditCtrlFile::OnDetails() wxString name = wxFileSelector(_("Choose file"), wxPathOnly(txt), wxFileNameFromPath(txt), - _T(""), + wxEmptyString, GetFileTypes(), wxOPEN | wxFILE_MUST_EXIST); if (!name) return; diff --git a/contrib/utils/wxrcedit/propedit.cpp b/contrib/utils/wxrcedit/propedit.cpp index f6c78716a6..294d908811 100644 --- a/contrib/utils/wxrcedit/propedit.cpp +++ b/contrib/utils/wxrcedit/propedit.cpp @@ -66,7 +66,6 @@ void PropEditCtrl::BeginEdit(const wxRect& rect, wxTreeItemId ti) if (HasClearButton()) sz->Add(new wxButton(this, ID_CLEAR, _T("X"), wxDefaultPosition, wxSize(16,wxDefaultSize.y))); - SetAutoLayout(true); SetSizer(sz); m_Created = true; } diff --git a/demos/dbbrowse/dlguser.cpp b/demos/dbbrowse/dlguser.cpp index 98b4c0d1ba..9c2f60bff7 100644 --- a/demos/dbbrowse/dlguser.cpp +++ b/demos/dbbrowse/dlguser.cpp @@ -37,17 +37,17 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : wxDialog(parent, ID_DIALOG_DSN, title) { int chSize; // Height of Font * 1.4 = Height of wxTextCtrl - + float ratio = (float)1.4; #ifdef __WXMOTIF__ ratio = (float)2.1; #endif - + SetBackgroundColour(_T("wheat")); pDoc = p_Doc; wxLayoutConstraints* layout; SetAutoLayout(true); - + m_Label1 = new wxStaticText(this, wxID_ANY, _("User ID:")); m_Label1->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; @@ -56,14 +56,14 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : layout->height.AsIs(); layout->width.Absolute(75); m_Label1->SetConstraints(layout); - + int w; - m_Label1->GetSize(&w, &chSize); - - m_UserName = new wxTextCtrl(this, wxID_ANY, _T("")); + m_Label1->GetSize(&w, &chSize); + + m_UserName = new wxTextCtrl(this, wxID_ANY, wxEmptyString); m_UserName->SetFont(* pDoc->ft_Doc); chSize = (int) (m_UserName->GetCharHeight()*ratio); - + layout = new wxLayoutConstraints; layout->left.SameAs(m_Label1, wxRight, 10); layout->centreY.SameAs(m_Label1,wxCentreY); @@ -71,8 +71,8 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : layout->height.Absolute(chSize); // layout->height.AsIs(); m_UserName->SetConstraints(layout); - - + + m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:")); m_Label2->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; @@ -81,8 +81,8 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : layout->height.AsIs(); layout->width.SameAs(m_Label1, wxWidth); m_Label2->SetConstraints(layout); - - m_Password = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); + + m_Password = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); m_Password->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; layout->left.SameAs(m_UserName, wxLeft); @@ -91,7 +91,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : layout->height.Absolute(chSize); //layout->height.AsIs(); m_Password->SetConstraints(layout); - + m_OK = new wxButton(this, wxID_OK, _("OK")); m_OK->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; @@ -100,7 +100,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : layout->height.AsIs(); layout->width.Absolute(75); m_OK->SetConstraints(layout); - + m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel")); m_Cancel->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; @@ -109,12 +109,12 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : layout->height.AsIs(); layout->width.SameAs(m_OK, wxWidth); m_Cancel->SetConstraints(layout); - + m_OK->SetDefault(); m_UserName->SetFocus(); - - s_User = _T(""); - s_Password = _T(""); + + s_User = wxEmptyString; + s_Password = wxEmptyString; Layout(); } diff --git a/include/wx/file.h b/include/wx/file.h index 1bf63024eb..8bfcb465b6 100644 --- a/include/wx/file.h +++ b/include/wx/file.h @@ -82,7 +82,7 @@ public: // open/close // create a new file (with the default value of bOverwrite, it will fail if // the file already exists, otherwise it will overwrite it and succeed) - bool Create(const wxChar *szFileName, bool bOverwrite = FALSE, + bool Create(const wxChar *szFileName, bool bOverwrite = false, int access = wxS_DEFAULT); bool Open(const wxChar *szFileName, OpenMode mode = read, int access = wxS_DEFAULT); diff --git a/include/wx/fontenum.h b/include/wx/fontenum.h index 6da6a74784..01af35089f 100644 --- a/include/wx/fontenum.h +++ b/include/wx/fontenum.h @@ -33,11 +33,11 @@ public: // start enumerating font facenames (either all of them or those which // support the given encoding) - will result in OnFacename() being // called for each available facename (until they are exhausted or - // OnFacename returns FALSE) + // OnFacename returns false) virtual bool EnumerateFacenames ( wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all - bool fixedWidthOnly = FALSE + bool fixedWidthOnly = false ); // enumerate the different encodings either for given font facename or for @@ -46,43 +46,43 @@ public: virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString); // callbacks which are called after one of EnumerateXXX() functions from - // above is invoked - all of them may return FALSE to stop enumeration or - // TRUE to continue with it + // above is invoked - all of them may return false to stop enumeration or + // true to continue with it // called by EnumerateFacenames virtual bool OnFacename(const wxString& facename) - { + { if (m_Facenames == NULL) m_Facenames = new wxArrayString; m_Facenames -> Add(facename); - return TRUE; + return true; } // called by EnumerateEncodings virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), const wxString& encoding) - { + { if (m_Encodings == NULL) m_Encodings = new wxArrayString; m_Encodings -> Add(encoding); - return TRUE; + return true; } - + // convenience function that returns array of facenames. Cannot be called // before EnumerateFacenames. - wxArrayString *GetFacenames() + wxArrayString *GetFacenames() { return m_Facenames; } // convenience function that returns array of encodings. // Cannot be called before EnumerateEncodings. - wxArrayString *GetEncodings() + wxArrayString *GetEncodings() { return m_Encodings; } - + // virtual dtor for the base class - virtual ~wxFontEnumerator() - { + virtual ~wxFontEnumerator() + { if (m_Facenames) delete m_Facenames; if (m_Encodings) delete m_Encodings; } - + private: wxArrayString *m_Facenames, *m_Encodings; diff --git a/include/wx/generic/logg.h b/include/wx/generic/logg.h index e0a82403d0..16418df233 100644 --- a/include/wx/generic/logg.h +++ b/include/wx/generic/logg.h @@ -90,14 +90,14 @@ class WXDLLEXPORT wxLogWindow : public wxLogPassThrough public: wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL) const wxChar *szTitle, // the title of the frame - bool bShow = TRUE, // show window immediately? - bool bPassToOld = TRUE); // pass messages to the old target? + bool bShow = true, // show window immediately? + bool bPassToOld = true); // pass messages to the old target? ~wxLogWindow(); // window operations // show/hide the log window - void Show(bool bShow = TRUE); + void Show(bool bShow = true); // retrieve the pointer to the frame wxFrame *GetFrame() const; @@ -107,7 +107,7 @@ public: virtual void OnFrameCreate(wxFrame *frame); // called if the user closes the window interactively, will not be // called if it is destroyed for another reason (such as when program - // exits) - return TRUE from here to allow the frame to close, FALSE + // exits) - return true from here to allow the frame to close, false // to prevent this from happening virtual bool OnFrameClose(wxFrame *frame); // called right before the log frame is going to be deleted: will diff --git a/include/wx/generic/progdlgg.h b/include/wx/generic/progdlgg.h index ee59cb9426..e944e1a132 100644 --- a/include/wx/generic/progdlgg.h +++ b/include/wx/generic/progdlgg.h @@ -55,7 +55,7 @@ public: @param newmsg if used, new message to display @returns true if ABORT button has not been pressed */ - virtual bool Update(int value, const wxString& newmsg = wxT("")); + virtual bool Update(int value, const wxString& newmsg = wxEmptyString); /* Can be called to continue after the cancel button has been pressed, but the program decided to continue the operation (e.g., user didn't @@ -63,7 +63,7 @@ public: */ void Resume(); - bool Show( bool show = TRUE ); + bool Show( bool show = true ); protected: // callback for optional abort button diff --git a/include/wx/gtk/font.h b/include/wx/gtk/font.h index 9d66ddc909..a3daf930e3 100644 --- a/include/wx/gtk/font.h +++ b/include/wx/gtk/font.h @@ -51,7 +51,7 @@ public: int family, int style, int weight, - bool underlined = FALSE, + bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { @@ -64,7 +64,7 @@ public: int family, int style, int weight, - bool underlined = FALSE, + bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); @@ -95,7 +95,7 @@ public: virtual void SetUnderlined( bool underlined ); virtual void SetEncoding(wxFontEncoding encoding); - virtual void SetNoAntiAliasing( bool no = TRUE ); + virtual void SetNoAntiAliasing( bool no = true ); virtual bool GetNoAntiAliasing(); // implementation from now on diff --git a/include/wx/gtk1/font.h b/include/wx/gtk1/font.h index 9d66ddc909..a3daf930e3 100644 --- a/include/wx/gtk1/font.h +++ b/include/wx/gtk1/font.h @@ -51,7 +51,7 @@ public: int family, int style, int weight, - bool underlined = FALSE, + bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { @@ -64,7 +64,7 @@ public: int family, int style, int weight, - bool underlined = FALSE, + bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); @@ -95,7 +95,7 @@ public: virtual void SetUnderlined( bool underlined ); virtual void SetEncoding(wxFontEncoding encoding); - virtual void SetNoAntiAliasing( bool no = TRUE ); + virtual void SetNoAntiAliasing( bool no = true ); virtual bool GetNoAntiAliasing(); // implementation from now on diff --git a/include/wx/html/helpfrm.h b/include/wx/html/helpfrm.h index 0b18da854e..6429c3147a 100644 --- a/include/wx/html/helpfrm.h +++ b/include/wx/html/helpfrm.h @@ -113,8 +113,8 @@ public: // Displays help window and focuses index. bool DisplayIndex(); - // Searches for keyword. Returns TRUE and display page if found, return - // FALSE otherwise + // Searches for keyword. Returns true and display page if found, return + // false otherwise // Syntax of keyword is Altavista-like: // * words are separated by spaces // (but "\"hello world\"" is only one world "hello world") @@ -139,10 +139,10 @@ public: // call this to let wxHtmlHelpFrame know page changed void NotifyPageChanged(); - + // Refreshes Contents and Index tabs void RefreshLists(); - + protected: void Init(wxHtmlHelpData* data = NULL); diff --git a/include/wx/motif/frame.h b/include/wx/motif/frame.h index 4cb7f953c8..ed717d2a69 100644 --- a/include/wx/motif/frame.h +++ b/include/wx/motif/frame.h @@ -43,7 +43,7 @@ public: virtual ~wxFrame(); - virtual bool Show(bool show = TRUE); + virtual bool Show(bool show = true); // Set menu bar void SetMenuBar(wxMenuBar *menu_bar); @@ -62,7 +62,7 @@ public: // Create toolbar #if wxUSE_TOOLBAR virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxString& name = wxToolBarNameStr); virtual void SetToolBar(wxToolBar *toolbar); virtual void PositionToolBar(); @@ -74,7 +74,7 @@ public: void OnSysColourChanged(wxSysColourChangedEvent& event); void OnActivate(wxActivateEvent& event); - virtual void ChangeFont(bool keepOriginalSize = TRUE); + virtual void ChangeFont(bool keepOriginalSize = true); virtual void ChangeBackgroundColour(); virtual void ChangeForegroundColour(); WXWidget GetMenuBarWidget() const; diff --git a/include/wx/msw/font.h b/include/wx/msw/font.h index 13674e03c5..eb54983eb6 100644 --- a/include/wx/msw/font.h +++ b/include/wx/msw/font.h @@ -31,7 +31,7 @@ public: int family, int style, int weight, - bool underlined = FALSE, + bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { @@ -53,7 +53,7 @@ public: int family, int style, int weight, - bool underlined = FALSE, + bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); @@ -90,7 +90,7 @@ public: virtual bool IsFree() const; virtual bool RealizeResource(); virtual WXHANDLE GetResourceHandle() const; - virtual bool FreeResource(bool force = FALSE); + virtual bool FreeResource(bool force = false); // for consistency with other wxMSW classes WXHFONT GetHFONT() const; diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index dc49862898..a7713503b8 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -69,7 +69,7 @@ public: // -------- wxTreeCtrl() { Init(); } - wxTreeCtrl(wxWindow *parent, wxWindowID id = -1, + wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, @@ -81,7 +81,7 @@ public: virtual ~wxTreeCtrl(); - bool Create(wxWindow *parent, wxWindowID id = -1, + bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, @@ -163,13 +163,13 @@ public: // allow the user to expand the items which don't have any children now // - but instead add them only when needed, thus minimizing memory // usage and loading time. - void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE); + void SetItemHasChildren(const wxTreeItemId& item, bool has = true); // the item will be shown in bold - void SetItemBold(const wxTreeItemId& item, bool bold = TRUE); + void SetItemBold(const wxTreeItemId& item, bool bold = true); // the item will be shown with a drop highlight - void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = TRUE); + void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true); // set the items text colour void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); @@ -197,15 +197,15 @@ public: // number of children // ------------------ - // if 'recursively' is FALSE, only immediate children count, otherwise + // if 'recursively' is false, only immediate children count, otherwise // the returned number is the number of all items in this branch size_t GetChildrenCount(const wxTreeItemId& item, - bool recursively = TRUE) const; + bool recursively = true) const; // navigation // ---------- - // wxTreeItemId.IsOk() will return FALSE if there is no such item + // wxTreeItemId.IsOk() will return false if there is no such item // get the root tree item wxTreeItemId GetRootItem() const; @@ -225,9 +225,9 @@ public: #if WXWIN_COMPATIBILITY_2_2 // deprecated: Use GetItemParent instead. wxTreeItemId GetParent(const wxTreeItemId& item) const - { return GetItemParent( item ); } + { return GetItemParent( item ); } - // Expose the base class method hidden by the one above. + // Expose the base class method hidden by the one above. wxWindow *GetParent() const { return wxControl::GetParent(); } #endif // WXWIN_COMPATIBILITY_2_2 @@ -340,7 +340,7 @@ public: // edited simultaneously) wxTextCtrl* GetEditControl() const; // end editing and accept or discard the changes to item label - void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE); + void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false); // sorting // this function is called to compare 2 items and should return -1, 0 @@ -371,7 +371,7 @@ public: // get the bounding rectangle of the item (or of its label only) bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, - bool textOnly = FALSE) const; + bool textOnly = false) const; // deprecated // ---------- @@ -433,7 +433,7 @@ public: // get/set the check state for the item (only for wxTR_MULTIPLE) bool IsItemChecked(const wxTreeItemId& item) const; - void SetItemCheck(const wxTreeItemId& item, bool check = TRUE); + void SetItemCheck(const wxTreeItemId& item, bool check = true); // set/get the item state.image (state == -1 means cycle to the next one) void SetState(const wxTreeItemId& node, int state); @@ -491,7 +491,7 @@ private: // the hash storing the items attributes (indexed by item ids) wxMapTreeAttr m_attrs; - // TRUE if the hash above is not empty + // true if the hash above is not empty bool m_hasAnyAttr; // used for dragging diff --git a/include/wx/os2/font.h b/include/wx/os2/font.h index 11792862cf..314d445d7b 100644 --- a/include/wx/os2/font.h +++ b/include/wx/os2/font.h @@ -32,7 +32,7 @@ public: ,int nFamily ,int nStyle ,int nWeight - ,bool bUnderlined = FALSE + ,bool bUnderlined = false ,const wxString& rsFace = wxEmptyString ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT ) @@ -67,7 +67,7 @@ public: ,int nFamily ,int nStyle ,int nWeight - ,bool bUnderlined = FALSE + ,bool bUnderlined = false ,const wxString& rsFace = wxEmptyString ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT ); @@ -116,7 +116,7 @@ public: virtual bool IsFree(void) const; virtual bool RealizeResource(void); virtual WXHANDLE GetResourceHandle(void); - virtual bool FreeResource(bool bForce = FALSE); + virtual bool FreeResource(bool bForce = false); WXHFONT GetHFONT(void) const; diff --git a/samples/artprov/artbrows.cpp b/samples/artprov/artbrows.cpp index 8b90ba5814..6ecf00a297 100644 --- a/samples/artprov/artbrows.cpp +++ b/samples/artprov/artbrows.cpp @@ -112,28 +112,28 @@ BEGIN_EVENT_TABLE(wxArtBrowserDialog, wxDialog) END_EVENT_TABLE() wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, _T("Art resources browser"), - wxDefaultPosition, wxDefaultSize, + : wxDialog(parent, wxID_ANY, _T("Art resources browser"), + wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { wxSizer *sizer = new wxBoxSizer(wxVERTICAL); wxSizer *subsizer; - + wxChoice *choice = new wxChoice(this, wxID_ANY); FillClients(choice); - + subsizer = new wxBoxSizer(wxHORIZONTAL); subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL); subsizer->Add(choice, 1, wxLEFT, 5); sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10); subsizer = new wxBoxSizer(wxHORIZONTAL); - + m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300), wxLC_REPORT | wxSUNKEN_BORDER); m_list->InsertColumn(0, _T("wxArtID")); subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10); - + wxSizer *subsub = new wxBoxSizer(wxVERTICAL); m_canvas = new wxStaticBitmap(this, wxID_ANY, wxBitmap(null_xpm)); subsub->Add(m_canvas); @@ -141,13 +141,12 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) subsizer->Add(subsub); sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10); - + wxButton *ok = new wxButton(this, wxID_OK, _T("Close")); ok->SetDefault(); sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10); - + SetSizer(sizer); - SetAutoLayout(true); sizer->Fit(this); choice->SetSelection(6/*wxART_MESSAGE_BOX*/); @@ -158,7 +157,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) void wxArtBrowserDialog::SetArtClient(const wxArtClient& client) { wxBusyCursor bcur; - + wxImageList *img = new wxImageList(16, 16); img->Add(wxIcon(null_xpm)); int index = 0; diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index c1e008d05c..96f70704d1 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -207,7 +207,7 @@ bool MyApp::OnInit() // Make a menubar wxMenu *file_menu = new wxMenu; - + file_menu->Append(DIALOGS_MESSAGE_BOX, _T("&Message box\tCtrl-M")); @@ -312,15 +312,15 @@ bool MyApp::OnInit() #if wxUSE_FINDREPLDLG wxMenu *find_menu = new wxMenu; - find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), _T(""), true); - find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), _T(""), true); + find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), wxEmptyString, true); + find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), wxEmptyString, true); file_menu->Append(wxID_ANY,_T("Searching"),find_menu); #endif // wxUSE_FINDREPLDLG #if USE_MODAL_PRESENTATION wxMenu *modal_menu = new wxMenu; modal_menu->Append(DIALOGS_MODAL, _T("Mo&dal dialog\tCtrl-W")); - modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), _T(""), true); + modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), wxEmptyString, true); file_menu->Append(wxID_ANY,_T("Modal/Modeless"),modal_menu); #endif // USE_MODAL_PRESENTATION @@ -357,15 +357,15 @@ MyFrame::MyFrame(wxWindow *parent, m_dlgFind = m_dlgReplace = NULL; #endif - -#if wxUSE_COLOURDLG + +#if wxUSE_COLOURDLG m_clrData.SetChooseFull(true); for (int i = 0; i < 16; i++) { m_clrData.SetCustomColour(i, wxColour(i*16, i*16, i*16)); } #endif // wxUSE_COLOURDLG - + CreateStatusBar(); } @@ -531,7 +531,7 @@ void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event)) { wxString pwd = wxGetPasswordFromUser(_T("Enter password:"), _T("Password entry dialog"), - _T(""), + wxEmptyString, this); if ( !!pwd ) { @@ -616,8 +616,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) ( this, _T("Testing open file dialog"), - _T(""), - _T(""), + wxEmptyString, + wxEmptyString, #ifdef __WXMOTIF__ _T("C++ files (*.cpp)|*.cpp") #else @@ -649,7 +649,7 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) ) static wxString s_extDef; wxString path = wxFileSelector( _T("Select the file to load"), - _T(""), _T(""), + wxEmptyString, wxEmptyString, s_extDef, _T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (*.*)|*.*"), wxCHANGE_DIR, @@ -668,14 +668,14 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) ) void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) { - wxString wildcards = + wxString wildcards = #ifdef __WXMOTIF__ _T("C++ files (*.cpp)|*.cpp"); #else _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp"); #endif wxFileDialog dialog(this, _T("Testing open multiple file dialog"), - _T(""), _T(""), wildcards, + wxEmptyString, wxEmptyString, wildcards, wxMULTIPLE); if (dialog.ShowModal() == wxID_OK) @@ -706,7 +706,7 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) ) { wxFileDialog dialog(this, _T("Testing save file dialog"), - _T(""), + wxEmptyString, _T("myletter.doc"), _T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"), wxSAVE|wxOVERWRITE_PROMPT); @@ -1050,7 +1050,6 @@ MyModelessDialog::MyModelessDialog(wxWindow *parent) sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5); sizerTop->Add(check, 1, wxEXPAND | wxALL, 5); - SetAutoLayout(true); SetSizer(sizerTop); sizerTop->SetSizeHints(this); @@ -1094,7 +1093,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent) sizerTop->Add(m_btnDelete, 0, wxALIGN_CENTER | wxALL, 5); sizerTop->Add(btnOk, 0, wxALIGN_CENTER | wxALL, 5); - SetAutoLayout(true); SetSizer(sizerTop); sizerTop->SetSizeHints(this); @@ -1118,7 +1116,7 @@ void MyModalDialog::OnButton(wxCommandEvent& event) #if wxUSE_TEXTDLG wxGetTextFromUser(_T("Dummy prompt"), _T("Modal dialog called from dialog"), - _T(""), this); + wxEmptyString, this); #else wxMessageBox(_T("Modal dialog called from dialog")); #endif // wxUSE_TEXTDLG diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index ff9f0c0841..0da6de76f8 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -146,18 +146,18 @@ GridFrame::GridFrame() fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") ); wxMenu *viewMenu = new wxMenu; - viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width..."), _T("") ); - viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width..."), _T("") ); + viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") ); + viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") ); viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") ); - viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), _T(""), wxITEM_CHECK ); - viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), _T(""), wxITEM_CHECK ); + viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), wxEmptyString, wxITEM_CHECK ); + viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), wxEmptyString, wxITEM_CHECK ); wxMenu *rowLabelMenu = new wxMenu; @@ -344,7 +344,6 @@ GridFrame::GridFrame() 0, wxEXPAND ); - SetAutoLayout(true); SetSizer( topSizer ); topSizer->Fit( this ); @@ -761,7 +760,7 @@ void GridFrame::OnAddToSelectToggle(wxCommandEvent& event) void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; if ( ev.GetRow() != -1 ) { logBuf << _T("Left click on row label ") << ev.GetRow(); @@ -787,7 +786,7 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) void GridFrame::OnCellLeftClick( wxGridEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; logBuf << _T("Left click at row ") << ev.GetRow() << _T(" col ") << ev.GetCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); @@ -801,7 +800,7 @@ void GridFrame::OnCellLeftClick( wxGridEvent& ev ) void GridFrame::OnRowSize( wxGridSizeEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; logBuf << _T("Resized row ") << ev.GetRowOrCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); @@ -811,7 +810,7 @@ void GridFrame::OnRowSize( wxGridSizeEvent& ev ) void GridFrame::OnColSize( wxGridSizeEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; logBuf << _T("Resized col ") << ev.GetRowOrCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); @@ -821,7 +820,7 @@ void GridFrame::OnColSize( wxGridSizeEvent& ev ) void GridFrame::OnSelectCell( wxGridEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; if ( ev.Selecting() ) logBuf << _T("Selected "); else @@ -841,7 +840,7 @@ void GridFrame::OnSelectCell( wxGridEvent& ev ) void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; if ( ev.Selecting() ) logBuf << _T("Selected "); else @@ -861,7 +860,7 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) void GridFrame::OnCellValueChanged( wxGridEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; logBuf << _T("Value changed for cell at") << _T(" row ") << ev.GetRow() << _T(" col ") << ev.GetCol(); diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index a593c3e810..d0dc6d9471 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -595,7 +595,7 @@ void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController) { wxString key = wxGetTextFromUser(_T("Search for?"), _T("Search help for keyword"), - _T(""), + wxEmptyString, this); if(! key.IsEmpty()) helpController.KeywordSearch(key); @@ -666,7 +666,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent) sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - SetAutoLayout(true); SetSizer(sizerTop); sizerTop->SetSizeHints(this); diff --git a/samples/html/about/about.cpp b/samples/html/about/about.cpp index 9f93a98019..6ace1ab1d6 100644 --- a/samples/html/about/about.cpp +++ b/samples/html/about/about.cpp @@ -166,19 +166,18 @@ html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER); html -> SetBorders(0); html -> LoadPage(wxT("data/about.htm")); - html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(), + html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(), html -> GetInternalRepresentation() -> GetHeight()); topsizer -> Add(html, 1, wxALL, 10); topsizer -> Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10); - + wxButton *bu1 = new wxButton(&dlg, wxID_OK, _("OK")); bu1 -> SetDefault(); topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15); - dlg.SetAutoLayout(true); dlg.SetSizer(topsizer); topsizer -> Fit(&dlg); diff --git a/samples/listbox/lboxtest.cpp b/samples/listbox/lboxtest.cpp index 751a5a18ce..6cf0461b8d 100644 --- a/samples/listbox/lboxtest.cpp +++ b/samples/listbox/lboxtest.cpp @@ -400,14 +400,14 @@ LboxTestFrame::LboxTestFrame(const wxString& title) sizerRow = new wxBoxSizer(wxHORIZONTAL); btn = new wxButton(panel, LboxTest_Change, _T("C&hange current")); - m_textChange = new wxTextCtrl(panel, LboxTest_ChangeText, _T("")); + m_textChange = new wxTextCtrl(panel, LboxTest_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); btn = new wxButton(panel, LboxTest_Delete, _T("&Delete this item")); - m_textDelete = new wxTextCtrl(panel, LboxTest_DeleteText, _T("")); + m_textDelete = new wxTextCtrl(panel, LboxTest_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -457,7 +457,6 @@ LboxTestFrame::LboxTestFrame(const wxString& title) Reset(); m_dirty = false; - panel->SetAutoLayout(true); panel->SetSizer(sizerTop); sizerTop->Fit(this); diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 3839145a06..8e196ba498 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -315,8 +315,6 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, m_panel->SetSizer(m_sizerFrame); - m_panel->SetAutoLayout(true); - m_sizerFrame->Fit(this); m_sizerFrame->SetSizeHints(this); diff --git a/samples/statbar/statbar.cpp b/samples/statbar/statbar.cpp index c6c1ddb2be..e98da938a3 100644 --- a/samples/statbar/statbar.cpp +++ b/samples/statbar/statbar.cpp @@ -492,7 +492,6 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent) sizerTop->Add(-1, 10, 1, wxGROW); sizerTop->Add(statbarBottom, 0, wxGROW); - SetAutoLayout(true); SetSizer(sizerTop); sizerTop->Fit(this); @@ -620,7 +619,7 @@ void MyStatusBar::DoToggle() m_statbmp->Refresh(); #endif - SetStatusText(_T(""), Field_Clock); + SetStatusText(wxEmptyString, Field_Clock); } } diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index c2a6d2997e..1f3f5f056d 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -52,7 +52,7 @@ class WXDLLEXPORT wxFontPreviewer : public wxWindow { public: - wxFontPreviewer(wxWindow *parent) : wxWindow(parent, -1) {} + wxFontPreviewer(wxWindow *parent) : wxWindow(parent, wxID_ANY) {} private: void OnPaint(wxPaintEvent& event); @@ -82,7 +82,7 @@ void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.GetTextExtent( wxT("X"), &w, &h); dc.SetTextForeground(GetForegroundColour()); dc.SetClippingRegion(2, 2, size.x-4, size.y-4); - dc.DrawText(_("ABCDEFGabcdefg12345"), + dc.DrawText(_("ABCDEFGabcdefg12345"), 10, size.y/2 - h/2); dc.DestroyClippingRegion(); } @@ -167,7 +167,7 @@ static wxString wxColourDialogNames[NUM_COLS]={wxT("ORANGE"), void wxGenericFontDialog::Init() { - m_useEvents = FALSE; + m_useEvents = false; m_previewer = NULL; Create( m_parent ) ; } @@ -183,21 +183,21 @@ void wxGenericFontDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) bool wxGenericFontDialog::DoCreate(wxWindow *parent) { - if ( !wxDialog::Create( parent , -1 , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, + if ( !wxDialog::Create( parent , wxID_ANY , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("fontdialog") ) ) { wxFAIL_MSG( wxT("wxFontDialog creation failed") ); - return FALSE; + return false; } InitializeFont(); CreateWidgets(); - + // sets initial font in preview area wxCommandEvent dummy; OnChangeFont(dummy); - - return TRUE; + + return true; } int wxGenericFontDialog::ShowModal() @@ -300,13 +300,13 @@ void wxGenericFontDialog::CreateWidgets() sizer->Add(weightChoice, 0, wxALIGN_CENTER | wxLEFT, 10); sizer->Add(colourChoice, 0, wxALIGN_CENTER | wxLEFT, 10); topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10); - + sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(pointSizeChoice, 0, wxALIGN_CENTER | wxLEFT, 10); sizer->Add(underLineCheckBox, 0, wxALIGN_CENTER | wxLEFT, 10); topsizer->Add(sizer, 0, wxLEFT| wxTOP| wxRIGHT, 10); } - + topsizer->Add(m_previewer, 1, wxALL | wxEXPAND, 10); topsizer->SetItemMinSize(m_previewer, 430, 100); @@ -315,7 +315,6 @@ void wxGenericFontDialog::CreateWidgets() sizer->Add(cancelButton, 0, wxRIGHT, 10); topsizer->Add(sizer, 0, wxALIGN_RIGHT | wxBOTTOM, 10); - SetAutoLayout(TRUE); SetSizer(topsizer); topsizer->SetSizeHints(this); topsizer->Fit(this); @@ -326,9 +325,9 @@ void wxGenericFontDialog::CreateWidgets() delete[] styles; delete[] weights; delete[] pointSizes; - + // Don't block events any more - m_useEvents = TRUE; + m_useEvents = true; } void wxGenericFontDialog::InitializeFont() @@ -337,7 +336,7 @@ void wxGenericFontDialog::InitializeFont() int fontWeight = wxNORMAL; int fontStyle = wxNORMAL; int fontSize = 12; - int fontUnderline = FALSE; + bool fontUnderline = false; if (m_fontData.m_initialFont.Ok()) { @@ -348,7 +347,8 @@ void wxGenericFontDialog::InitializeFont() fontUnderline = m_fontData.m_initialFont.GetUnderlined(); } - dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0)); + dialogFont = wxFont(fontSize, fontFamily, fontStyle, + fontWeight, fontUnderline); if (m_previewer) m_previewer->SetFont(dialogFont); @@ -366,7 +366,7 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event)) dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0)); m_previewer->SetFont(dialogFont); - if (colourChoice->GetStringSelection() != wxT("")) + if ( !colourChoice->GetStringSelection().empty() ) { wxColour col = wxTheColourDatabase->Find(colourChoice->GetStringSelection()); if (col.Ok()) diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 6dafd5d079..c593190737 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -156,7 +156,7 @@ BEGIN_EVENT_TABLE(wxLogDialog, wxDialog) #if wxUSE_FILE EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave) #endif // wxUSE_FILE - EVT_LIST_ITEM_SELECTED(-1, wxLogDialog::OnListSelect) + EVT_LIST_ITEM_SELECTED(wxID_ANY, wxLogDialog::OnListSelect) END_EVENT_TABLE() #endif // wxUSE_LOG_DIALOG @@ -168,8 +168,8 @@ END_EVENT_TABLE() #if wxUSE_FILE && wxUSE_FILEDLG // pass an uninitialized file object, the function will ask the user for the -// filename and try to open it, returns TRUE on success (file was opened), -// FALSE if file couldn't be opened/created and -1 if the file selection +// filename and try to open it, returns true on success (file was opened), +// false if file couldn't be opened/created and -1 if the file selection // dialog was cancelled static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL); @@ -235,7 +235,7 @@ void wxLogGui::Clear() { m_bErrors = m_bWarnings = - m_bHasMessages = FALSE; + m_bHasMessages = false; m_aMessages.Empty(); m_aSeverity.Empty(); @@ -248,7 +248,7 @@ void wxLogGui::Flush() return; // do it right now to block any new calls to Flush() while we're here - m_bHasMessages = FALSE; + m_bHasMessages = false; wxString appName = wxTheApp->GetAppName(); if ( !!appName ) @@ -340,7 +340,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) m_aMessages.Add(szString); m_aSeverity.Add(wxLOG_Message); m_aTimes.Add((long)t); - m_bHasMessages = TRUE; + m_bHasMessages = true; } break; @@ -404,20 +404,20 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) m_aSeverity.Empty(); m_aTimes.Empty(); #endif // wxUSE_LOG_DIALOG - m_bErrors = TRUE; + m_bErrors = true; } // fall through case wxLOG_Warning: if ( !m_bErrors ) { // for the warning we don't discard the info messages - m_bWarnings = TRUE; + m_bWarnings = true; } m_aMessages.Add(szString); m_aSeverity.Add((int)level); m_aTimes.Add((long)t); - m_bHasMessages = TRUE; + m_bHasMessages = true; break; } } @@ -479,11 +479,11 @@ BEGIN_EVENT_TABLE(wxLogFrame, wxFrame) END_EVENT_TABLE() wxLogFrame::wxLogFrame(wxFrame *pParent, wxLogWindow *log, const wxChar *szTitle) - : wxFrame(pParent, -1, szTitle) + : wxFrame(pParent, wxID_ANY, szTitle) { m_log = log; - m_pTextCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, + m_pTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxHSCROLL | @@ -522,7 +522,7 @@ void wxLogFrame::DoClose() { // instead of closing just hide the window to be able to Show() it // later - Show(FALSE); + Show(false); } } @@ -595,7 +595,7 @@ wxLogWindow::wxLogWindow(wxFrame *pParent, m_pLogFrame = new wxLogFrame(pParent, this, szTitle); if ( bShow ) - m_pLogFrame->Show(TRUE); + m_pLogFrame->Show(); } void wxLogWindow::Show(bool bShow) @@ -667,7 +667,7 @@ void wxLogWindow::OnFrameCreate(wxFrame * WXUNUSED(frame)) bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame)) { // allow to close - return TRUE; + return true; } void wxLogWindow::OnFrameDelete(wxFrame * WXUNUSED(frame)) @@ -697,7 +697,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent, const wxArrayLong& times, const wxString& caption, long style) - : wxDialog(parent, -1, caption, + : wxDialog(parent, wxID_ANY, caption, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { @@ -728,7 +728,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent, while ( !!msg ); } - m_showingDetails = FALSE; // not initially + m_showingDetails = false; // not initially m_listctrl = (wxListCtrl *)NULL; #if wxUSE_STATLINE @@ -781,7 +781,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent, default: wxFAIL_MSG(_T("incorrect log style")); } - sizerAll->Add(new wxStaticBitmap(this, -1, bitmap), 0); + sizerAll->Add(new wxStaticBitmap(this, wxID_ANY, bitmap), 0); const wxString& message = messages.Last(); sizerAll->Add(CreateTextSizer(message), 1, @@ -790,7 +790,6 @@ wxLogDialog::wxLogDialog(wxWindow *parent, sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN); - SetAutoLayout(TRUE); SetSizer(sizerTop); // see comments in OnDetails() @@ -830,11 +829,11 @@ void wxLogDialog::CreateDetailsControls() #endif // wxUSE_FILE #if wxUSE_STATLINE - m_statline = new wxStaticLine(this, -1); + m_statline = new wxStaticLine(this, wxID_ANY); #endif // wxUSE_STATLINE // create the list ctrl now - m_listctrl = new wxListCtrl(this, -1, + m_listctrl = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxLC_REPORT | @@ -858,7 +857,7 @@ void wxLogDialog::CreateDetailsControls() wxART_INFORMATION }; - bool loadedIcons = TRUE; + bool loadedIcons = true; for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ ) { @@ -869,7 +868,7 @@ void wxLogDialog::CreateDetailsControls() // Degrade gracefully. if ( !bmp.Ok() ) { - loadedIcons = FALSE; + loadedIcons = false; break; } @@ -1077,7 +1076,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) // VS: this is neccessary in order to force frame redraw under // WindowMaker or fvwm2 (and probably other broken WMs). // Otherwise, detailed list wouldn't be displayed. - Show(TRUE); + Show(); #endif // wxGTK } @@ -1094,8 +1093,8 @@ wxLogDialog::~wxLogDialog() #if wxUSE_FILE && wxUSE_FILEDLG // pass an uninitialized file object, the function will ask the user for the -// filename and try to open it, returns TRUE on success (file was opened), -// FALSE if file couldn't be opened/created and -1 if the file selection +// filename and try to open it, returns true on success (file was opened), +// false if file couldn't be opened/created and -1 if the file selection // dialog was cancelled static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent) { @@ -1111,18 +1110,18 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent) // --------- bool bOk; if ( wxFile::Exists(filename) ) { - bool bAppend = FALSE; + bool bAppend = false; wxString strMsg; strMsg.Printf(_("Append log to file '%s' (choosing [No] will overwrite it)?"), filename.c_str()); switch ( wxMessageBox(strMsg, _("Question"), wxICON_QUESTION | wxYES_NO | wxCANCEL) ) { case wxYES: - bAppend = TRUE; + bAppend = true; break; case wxNO: - bAppend = FALSE; + bAppend = false; break; case wxCANCEL: @@ -1136,7 +1135,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent) bOk = file.Open(filename, wxFile::write_append); } else { - bOk = file.Create(filename, TRUE /* overwrite */); + bOk = file.Create(filename, true /* overwrite */); } } else { diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 95e23580b6..7b96482cd2 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -85,7 +85,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, int maximum, wxWindow *parent, int style) - : wxDialog(parent, -1, title) + : wxDialog(parent, wxID_ANY, title) { // we may disappear at any moment, let the others know about it SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT); @@ -101,7 +101,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, // FIXME: should probably have a (extended?) window style for this if ( !hasAbortButton ) { - EnableCloseButton(FALSE); + EnableCloseButton(false); } #endif // wxMSW @@ -124,7 +124,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, long widthText; dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL); - m_msg = new wxStaticText(this, -1, message); + m_msg = new wxStaticText(this, wxID_ANY, message); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN); c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN); @@ -143,7 +143,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, // note that we can't use wxGA_SMOOTH because it happens to // cause the dialog to be modal. Have an extra // style argument to wxProgressDialog, perhaps. - m_gauge = new wxGauge(this, -1, m_maximum, + m_gauge = new wxGauge(this, wxID_ANY, m_maximum, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL); @@ -227,7 +227,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, m_btnAbort = (wxButton *)NULL; } - SetAutoLayout(TRUE); + SetAutoLayout(true); Layout(); sizeDlg.y += 2*LAYOUT_Y_MARGIN; @@ -247,12 +247,12 @@ wxProgressDialog::wxProgressDialog(wxString const &title, else { if ( m_parentTop ) - m_parentTop->Enable(FALSE); + m_parentTop->Disable(); m_winDisabler = NULL; } - Show(TRUE); - Enable(TRUE); // enable this window + Show(); + Enable(); // this one can be initialized even if the others are unknown for now // @@ -270,7 +270,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, { wxLayoutConstraints *c; - wxStaticText *label = new wxStaticText(this, -1, _("unknown")); + wxStaticText *label = new wxStaticText(this, wxID_ANY, _("unknown")); c = new wxLayoutConstraints; // VZ: I like the labels be centered - if the others don't mind, you may @@ -285,7 +285,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, c->height.AsIs(); label->SetConstraints(c); - wxStaticText *dummy = new wxStaticText(this, -1, text); + wxStaticText *dummy = new wxStaticText(this, wxID_ANY, text); c = new wxLayoutConstraints; c->right.LeftOf(label); c->top.SameAs(label, wxTop, 0); @@ -338,7 +338,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg) if ( value == m_maximum ) { - // so that we return TRUE below and that out [Cancel] handler knew what + // so that we return true below and that out [Cancel] handler knew what // to do m_state = Finished; if( !(GetWindowStyle() & wxPD_AUTO_HIDE) ) @@ -351,7 +351,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg) #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) else // enable the button to give the user a way to close the dlg { - EnableCloseButton(TRUE); + EnableCloseButton(); } #endif // __WXMSW__ @@ -437,7 +437,7 @@ void wxProgressDialog::OnClose(wxCloseEvent& event) if ( m_state == Uncancelable ) { // can't close this dialog - event.Veto(TRUE); + event.Veto(); } else if ( m_state == Finished ) { @@ -471,7 +471,7 @@ void wxProgressDialog::ReenableOtherWindows() else { if ( m_parentTop ) - m_parentTop->Enable(TRUE); + m_parentTop->Enable(); } } diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index bac3433d8a..78a423326e 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -100,7 +100,7 @@ public: wxTipProvider *tipProvider, bool showAtStartup); - // the tip dialog has "Show tips on startup" checkbox - return TRUE if it + // the tip dialog has "Show tips on startup" checkbox - return true if it // was checked (or wasn't unchecked) bool ShowTipsOnStartup() const { return m_checkbox->GetValue(); } @@ -142,34 +142,34 @@ wxString wxFileTipProvider::GetTip() { return _("Tips not available, sorry!"); } - + wxString tip; // Comments start with a # symbol. // Loop reading lines until get the first one that isn't a comment. - // The max number of loop executions is the number of lines in the - // textfile so that can't go into an eternal loop in the [oddball] - // case of a comment-only tips file, or the developer has vetoed + // The max number of loop executions is the number of lines in the + // textfile so that can't go into an eternal loop in the [oddball] + // case of a comment-only tips file, or the developer has vetoed // them all via PreprecessTip(). for ( size_t i=0; i < count; i++ ) - { - // The current tip may be at the last line of the textfile, (or - // past it, if the number of lines in the textfile changed, such + { + // The current tip may be at the last line of the textfile, (or + // past it, if the number of lines in the textfile changed, such // as changing to a different textfile, with less tips). So check // to see at last line of text file, (or past it)... if ( m_currentTip >= count ) { // .. and if so, wrap back to line 0. m_currentTip = 0; - } - + } + // Read the tip, and increment the current tip counter. tip = m_textfile.GetLine(m_currentTip++); - - // Allow a derived class's overrided virtual to modify the tip + + // Allow a derived class's overrided virtual to modify the tip // now if so desired. - tip = PreprocessTip(tip); - + tip = PreprocessTip(tip); + // Break if tip isn't a comment, and isn't an empty string // (or only stray space characters). if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) ) @@ -177,18 +177,18 @@ wxString wxFileTipProvider::GetTip() break; } } - + // If tip starts with '_(', then it is a gettext string of format // _("My \"global\" tip text") so first strip off the leading '_("'... if ( tip.StartsWith(wxT("_(\"" ), &tip)) { //...and strip off the trailing '")'... tip = tip.BeforeLast(wxT('\"')); - // ...and replace escaped quotes - tip.Replace(wxT("\\\""), wxT("\"")); - } - - return tip; + // ...and replace escaped quotes + tip.Replace(wxT("\\\""), wxT("\"")); + } + + return tip; } // ---------------------------------------------------------------------------- @@ -202,7 +202,7 @@ END_EVENT_TABLE() wxTipDialog::wxTipDialog(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup) - : wxDialog(parent, -1, _("Tip of the Day"), + : wxDialog(parent, wxID_ANY, _("Tip of the Day"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { @@ -212,12 +212,12 @@ wxTipDialog::wxTipDialog(wxWindow *parent, wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close")); - m_checkbox = new wxCheckBox(this, -1, _("&Show tips at startup")); + m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup")); m_checkbox->SetValue(showAtStartup); wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip")); - wxStaticText *text = new wxStaticText(this, -1, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) ); + wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) ); #if defined(__WXMSW__) || defined(__WXPM__) text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD)); #else @@ -226,7 +226,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent, // // text->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - m_text = new wxTextCtrl(this, -1, wxT(""), + m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, 160), wxTE_MULTILINE | wxTE_READONLY | @@ -248,12 +248,12 @@ wxTipDialog::wxTipDialog(wxWindow *parent, // vBitmap.SetId(wxICON_TIP); // OS/2 specific bitmap method--OS/2 wxBitmaps all have an ID. // // and for StatBmp's under OS/2 it MUST be a valid resource ID. // -// wxStaticBitmap* bmp = new wxStaticBitmap(this, -1, vBitmap); +// wxStaticBitmap* bmp = new wxStaticBitmap(this, wxID_ANY, vBitmap); // //#else wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG); - wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon); + wxStaticBitmap *bmp = new wxStaticBitmap(this, wxID_ANY, icon); //#endif @@ -277,7 +277,6 @@ wxTipDialog::wxTipDialog(wxWindow *parent, SetTipText(); - SetAutoLayout(TRUE); SetSizer( topsizer ); topsizer->SetSizeHints( this ); diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index ece0c36d9a..83991409d8 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -176,11 +176,11 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) if (data) { m_Data = data; - m_DataCreated = FALSE; + m_DataCreated = false; } else { m_Data = new wxHtmlHelpData(); - m_DataCreated = TRUE; + m_DataCreated = true; } m_ContentsBox = NULL; @@ -208,7 +208,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) m_Cfg.w = 700; m_Cfg.h = 480; m_Cfg.sashpos = 240; - m_Cfg.navig_on = TRUE; + m_Cfg.navig_on = true; m_NormalFonts = m_FixedFonts = NULL; m_NormalFace = m_FixedFace = wxEmptyString; @@ -223,7 +223,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) #endif m_PagesHash = NULL; - m_UpdateContents = TRUE; + m_UpdateContents = true; m_helpController = (wxHelpControllerBase*) NULL; } @@ -251,8 +251,8 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, if (m_Config) ReadCustomization(m_Config, m_ConfigRoot); - wxFrame::Create(parent, id, _("Help"), - wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h), + wxFrame::Create(parent, id, _("Help"), + wxPoint(m_Cfg.x, m_Cfg.y), wxSize(m_Cfg.w, m_Cfg.h), wxDEFAULT_FRAME_STYLE, wxT("wxHtmlHelp")); GetPosition(&m_Cfg.x, &m_Cfg.y); @@ -304,15 +304,14 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, m_Splitter = new wxSplitterWindow(this); m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter); - m_NavigPan = new wxPanel(m_Splitter, -1); + m_NavigPan = new wxPanel(m_Splitter, wxID_ANY); m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK, wxDefaultPosition, wxDefaultSize); wxNotebookSizer *nbs = new wxNotebookSizer(m_NavigNotebook); - + navigSizer = new wxBoxSizer(wxVERTICAL); navigSizer->Add(nbs, 1, wxEXPAND); - m_NavigPan->SetAutoLayout(TRUE); m_NavigPan->SetSizer(navigSizer); } else @@ -330,17 +329,16 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, { wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); wxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - + topsizer->Add(0, 10); - - dummy->SetAutoLayout(TRUE); + dummy->SetSizer(topsizer); if ( style & wxHF_BOOKMARKS ) { - m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST, + m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST, wxEmptyString, - wxDefaultPosition, wxDefaultSize, + wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY | wxCB_SORT); m_Bookmarks->Append(_("(bookmarks)")); for (unsigned i = 0; i < m_BookmarksNames.GetCount(); i++) @@ -348,11 +346,11 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, m_Bookmarks->SetSelection(0); wxBitmapButton *bmpbt1, *bmpbt2; - bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD, - wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK, + bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD, + wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK, wxART_HELP_BROWSER)); - bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE, - wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK, + bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE, + wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK, wxART_HELP_BROWSER)); #if wxUSE_TOOLTIPS bmpbt1->SetToolTip(_("Add current page to bookmarks")); @@ -360,22 +358,22 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, #endif // wxUSE_TOOLTIPS wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); - + sizer->Add(m_Bookmarks, 1, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5); sizer->Add(bmpbt1, 0, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 2); sizer->Add(bmpbt2, 0, wxALIGN_CENTRE_VERTICAL, 0); - + topsizer->Add(sizer, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 10); } m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL, wxDefaultPosition, wxDefaultSize, - wxSUNKEN_BORDER | + wxSUNKEN_BORDER | wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | wxTR_LINES_AT_ROOT); m_ContentsBox->AssignImageList(ContentsImageList); - + topsizer->Add(m_ContentsBox, 1, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 2); @@ -387,24 +385,23 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, // index listbox panel? if ( style & wxHF_INDEX ) { - wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); + wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); wxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - dummy->SetAutoLayout(TRUE); dummy->SetSizer(topsizer); - m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString, - wxDefaultPosition, wxDefaultSize, + m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString, + wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); m_IndexButton = new wxButton(dummy, wxID_HTML_INDEXBUTTON, _("Find")); - m_IndexButtonAll = new wxButton(dummy, wxID_HTML_INDEXBUTTONALL, + m_IndexButtonAll = new wxButton(dummy, wxID_HTML_INDEXBUTTONALL, _("Show all")); - m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO, + m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO, wxEmptyString, wxDefaultPosition, - wxDefaultSize, + wxDefaultSize, wxALIGN_RIGHT | wxST_NO_AUTORESIZE); - m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST, - wxDefaultPosition, wxDefaultSize, + m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST, + wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE); #if wxUSE_TOOLTIPS @@ -416,7 +413,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, wxSizer *btsizer = new wxBoxSizer(wxHORIZONTAL); btsizer->Add(m_IndexButton, 0, wxRIGHT, 2); btsizer->Add(m_IndexButtonAll); - topsizer->Add(btsizer, 0, + topsizer->Add(btsizer, 0, wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10); topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2); topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL, 2); @@ -428,28 +425,27 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, // search list panel? if ( style & wxHF_SEARCH ) { - wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); + wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); wxSizer *sizer = new wxBoxSizer(wxVERTICAL); - dummy->SetAutoLayout(TRUE); dummy->SetSizer(sizer); - m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT, - wxEmptyString, - wxDefaultPosition, wxDefaultSize, + m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT, + wxEmptyString, + wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); - m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE, + m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE, wxDefaultPosition, wxDefaultSize); - m_SearchCaseSensitive = new wxCheckBox(dummy, -1, _("Case sensitive")); - m_SearchWholeWords = new wxCheckBox(dummy, -1, _("Whole words only")); + m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive")); + m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only")); m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search")); #if wxUSE_TOOLTIPS m_SearchButton->SetToolTip(_("Search contents of help book(s) for all occurences of the text you typed above")); #endif //wxUSE_TOOLTIPS - m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST, - wxDefaultPosition, wxDefaultSize, + m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST, + wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE); - + sizer->Add(m_SearchText, 0, wxEXPAND | wxALL, 10); sizer->Add(m_SearchChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10); sizer->Add(m_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10); @@ -461,7 +457,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, m_SearchPage = notebook_page; } - m_HtmlWin->Show(TRUE); + m_HtmlWin->Show(); RefreshLists(); @@ -480,24 +476,24 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, if ( m_Cfg.navig_on ) { - m_NavigPan->Show(TRUE); + m_NavigPan->Show(); m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); } else { - m_NavigPan->Show(FALSE); + m_NavigPan->Show(false); m_Splitter->Initialize(m_HtmlWin); } } - + // Reduce flicker by updating the splitter pane sizes before the // frame is shown wxSizeEvent sizeEvent(GetSize(), GetId()); ProcessEvent(sizeEvent); - + m_Splitter->UpdateSize(); - - return TRUE; + + return true; } wxHtmlHelpFrame::~wxHtmlHelpFrame() @@ -507,7 +503,7 @@ wxHtmlHelpFrame::~wxHtmlHelpFrame() delete m_Data; if (m_NormalFonts) delete m_NormalFonts; if (m_FixedFonts) delete m_FixedFonts; - if (m_PagesHash) + if (m_PagesHash) { WX_CLEAR_HASH_TABLE(*m_PagesHash); delete m_PagesHash; @@ -521,23 +517,23 @@ wxHtmlHelpFrame::~wxHtmlHelpFrame() #if wxUSE_TOOLBAR void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style) { - wxBitmap wpanelBitmap = + wxBitmap wpanelBitmap = wxArtProvider::GetBitmap(wxART_HELP_SIDE_PANEL, wxART_HELP_BROWSER); - wxBitmap wbackBitmap = + wxBitmap wbackBitmap = wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_HELP_BROWSER); - wxBitmap wforwardBitmap = + wxBitmap wforwardBitmap = wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_HELP_BROWSER); - wxBitmap wupnodeBitmap = + wxBitmap wupnodeBitmap = wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_HELP_BROWSER); - wxBitmap wupBitmap = + wxBitmap wupBitmap = wxArtProvider::GetBitmap(wxART_GO_UP, wxART_HELP_BROWSER); - wxBitmap wdownBitmap = + wxBitmap wdownBitmap = wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_HELP_BROWSER); - wxBitmap wopenBitmap = + wxBitmap wopenBitmap = wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_HELP_BROWSER); - wxBitmap wprintBitmap = + wxBitmap wprintBitmap = wxArtProvider::GetBitmap(wxART_PRINT, wxART_HELP_BROWSER); - wxBitmap woptionsBitmap = + wxBitmap woptionsBitmap = wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_HELP_BROWSER); wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() && @@ -549,26 +545,26 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style) toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Show/hide navigation panel")); toolBar->AddSeparator(); toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Go back")); toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Go forward")); toolBar->AddSeparator(); toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Go one level up in document hierarchy")); toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Previous page")); toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Next page")); if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES)) @@ -576,19 +572,19 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style) if (style & wxHF_OPEN_FILES) toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Open HTML document")); #if wxUSE_PRINTING_ARCHITECTURE if (style & wxHF_PRINT) toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Print this page")); #endif toolBar->AddSeparator(); toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap, - FALSE, -1, -1, (wxObject *) NULL, + false, -1, -1, (wxObject *) NULL, _("Display options dialog")); } #endif //wxUSE_TOOLBAR @@ -609,9 +605,10 @@ bool wxHtmlHelpFrame::Display(const wxString& x) { m_HtmlWin->LoadPage(url); NotifyPageChanged(); - return TRUE; + return true; } - return FALSE; + + return false; } bool wxHtmlHelpFrame::Display(const int id) @@ -621,9 +618,10 @@ bool wxHtmlHelpFrame::Display(const int id) { m_HtmlWin->LoadPage(url); NotifyPageChanged(); - return TRUE; + return true; } - return FALSE; + + return false; } @@ -631,22 +629,26 @@ bool wxHtmlHelpFrame::Display(const int id) bool wxHtmlHelpFrame::DisplayContents() { if (! m_ContentsBox) - return FALSE; + return false; + if (!m_Splitter->IsSplit()) { - m_NavigPan->Show(TRUE); - m_HtmlWin->Show(TRUE); + m_NavigPan->Show(); + m_HtmlWin->Show(); m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - m_Cfg.navig_on = TRUE; + m_Cfg.navig_on = true; } + m_NavigNotebook->SetSelection(0); + if (m_Data->GetBookRecArray().GetCount() > 0) { wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0]; if (!book.GetStart().IsEmpty()) m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart())); } - return TRUE; + + return true; } @@ -654,21 +656,25 @@ bool wxHtmlHelpFrame::DisplayContents() bool wxHtmlHelpFrame::DisplayIndex() { if (! m_IndexList) - return FALSE; + return false; + if (!m_Splitter->IsSplit()) { - m_NavigPan->Show(TRUE); - m_HtmlWin->Show(TRUE); + m_NavigPan->Show(); + m_HtmlWin->Show(); m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); } + m_NavigNotebook->SetSelection(1); + if (m_Data->GetBookRecArray().GetCount() > 0) { wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0]; if (!book.GetStart().IsEmpty()) m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart())); } - return TRUE; + + return true; } @@ -695,8 +701,8 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword, if (!m_Splitter->IsSplit()) { - m_NavigPan->Show(TRUE); - m_HtmlWin->Show(TRUE); + m_NavigPan->Show(); + m_HtmlWin->Show(); m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); } @@ -705,7 +711,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword, m_NavigNotebook->SetSelection(m_SearchPage); m_SearchList->Clear(); m_SearchText->SetValue(keyword); - m_SearchButton->Enable(false); + m_SearchButton->Disable(); if (m_SearchChoice->GetSelection() != 0) book = m_SearchChoice->GetStringSelection(); @@ -726,9 +732,9 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword, while (status.IsActive()) { curi = status.GetCurIndex(); - if (curi % 32 == 0 + if (curi % 32 == 0 #if wxUSE_PROGRESSDLG - && progress.Update(curi) == FALSE + && !progress.Update(curi) #endif ) break; @@ -742,7 +748,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword, } } - m_SearchButton->Enable(TRUE); + m_SearchButton->Enable(); m_SearchText->SetSelection(0, keyword.Length()); m_SearchText->SetFocus(); } @@ -750,14 +756,14 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword, { m_NavigNotebook->SetSelection(m_IndexPage); m_IndexList->Clear(); - m_IndexButton->Enable(false); - m_IndexButtonAll->Enable(false); + m_IndexButton->Disable(); + m_IndexButtonAll->Disable(); m_IndexText->SetValue(keyword); wxCommandEvent dummy; OnIndexFind(dummy); // what a hack... - m_IndexButton->Enable(true); - m_IndexButtonAll->Enable(true); + m_IndexButton->Enable(); + m_IndexButtonAll->Enable(); foundcnt = m_IndexList->GetCount(); } @@ -816,9 +822,9 @@ void wxHtmlHelpFrame::CreateContents() // set its icon accordingly bool imaged[MAX_ROOTS]; m_ContentsBox->DeleteAllItems(); - + roots[0] = m_ContentsBox->AddRoot(_("(Help)")); - imaged[0] = TRUE; + imaged[0] = true; for (it = m_Data->GetContents(), i = 0; i < cnt; i++, it++) { @@ -837,9 +843,9 @@ void wxHtmlHelpFrame::CreateContents() roots[1] = m_ContentsBox->AppendItem(roots[0], it->m_Name, IMG_Book, -1, new wxHtmlHelpTreeItemData(i)); - m_ContentsBox->SetItemBold(roots[1], TRUE); + m_ContentsBox->SetItemBold(roots[1], true); } - imaged[1] = TRUE; + imaged[1] = true; } // ...and their contents: else @@ -847,7 +853,7 @@ void wxHtmlHelpFrame::CreateContents() roots[it->m_Level + 1] = m_ContentsBox->AppendItem( roots[it->m_Level], it->m_Name, IMG_Page, -1, new wxHtmlHelpTreeItemData(i)); - imaged[it->m_Level + 1] = FALSE; + imaged[it->m_Level + 1] = false; } m_PagesHash->Put(it->GetFullPath(), @@ -865,7 +871,7 @@ void wxHtmlHelpFrame::CreateContents() m_ContentsBox->SetItemImage(roots[it->m_Level], image); m_ContentsBox->SetItemImage(roots[it->m_Level], image, wxTreeItemIcon_Selected); - imaged[it->m_Level] = TRUE; + imaged[it->m_Level] = true; } } } @@ -1047,32 +1053,32 @@ public: wxSpinCtrl *FontSize; wxHtmlWindow *TestWin; - wxHtmlHelpFrameOptionsDialog(wxWindow *parent) - : wxDialog(parent, -1, wxString(_("Help Browser Options"))) + wxHtmlHelpFrameOptionsDialog(wxWindow *parent) + : wxDialog(parent, wxID_ANY, wxString(_("Help Browser Options"))) { wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5); - sizer->Add(new wxStaticText(this, -1, _("Normal font:"))); - sizer->Add(new wxStaticText(this, -1, _("Fixed font:"))); - sizer->Add(new wxStaticText(this, -1, _("Font size:"))); + sizer->Add(new wxStaticText(this, wxID_ANY, _("Normal font:"))); + sizer->Add(new wxStaticText(this, wxID_ANY, _("Fixed font:"))); + sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:"))); - sizer->Add(NormalFont = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition, + sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, 200), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); - sizer->Add(FixedFont = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition, + sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, 200), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); - sizer->Add(FontSize = new wxSpinCtrl(this, -1)); + sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY)); FontSize->SetRange(2, 100); topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10); - topsizer->Add(new wxStaticText(this, -1, _("Preview:")), + topsizer->Add(new wxStaticText(this, wxID_ANY, _("Preview:")), 0, wxLEFT | wxTOP, 10); - topsizer->Add(TestWin = new wxHtmlWindow(this, -1, wxDefaultPosition, wxSize(20, 150), + topsizer->Add(TestWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(20, 150), wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER), 1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10); @@ -1083,7 +1089,6 @@ public: sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10); topsizer->Add(sizer2, 0, wxALIGN_RIGHT); - SetAutoLayout(TRUE); SetSizer(topsizer); topsizer->Fit(this); Centre(wxBOTH); @@ -1137,8 +1142,8 @@ public: }; BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog) - EVT_COMBOBOX(-1, wxHtmlHelpFrameOptionsDialog::OnUpdate) - EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin) + EVT_COMBOBOX(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdate) + EVT_SPINCTRL(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin) END_EVENT_TABLE() void wxHtmlHelpFrame::OptionsDialog() @@ -1157,24 +1162,24 @@ void wxHtmlHelpFrame::OptionsDialog() if (m_FixedFonts == NULL) { wxFontEnumerator enu; - enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, TRUE); + enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, true /*enum fixed width only*/); m_FixedFonts = new wxArrayString; *m_FixedFonts = *enu.GetFacenames(); m_FixedFonts->Sort(wxStringSortAscending); } - + // VS: We want to show the font that is actually used by wxHtmlWindow. // If customization dialog wasn't used yet, facenames are empty and // wxHtmlWindow uses default fonts -- let's find out what they // are so that we can pass them to the dialog: if (m_NormalFace.empty()) { - wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, FALSE); + wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, false); m_NormalFace = fnt.GetFaceName(); } if (m_FixedFace.empty()) { - wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, FALSE); + wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, false); m_FixedFace = fnt.GetFaceName(); } @@ -1217,7 +1222,7 @@ void wxHtmlHelpFrame::NotifyPageChanged() if (ha) { bool olduc = m_UpdateContents; - m_UpdateContents = FALSE; + m_UpdateContents = false; m_ContentsBox->SelectItem(ha->m_Id); m_ContentsBox->EnsureVisible(ha->m_Id); m_UpdateContents = olduc; @@ -1345,14 +1350,14 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event) { m_Cfg.sashpos = m_Splitter->GetSashPosition(); m_Splitter->Unsplit(m_NavigPan); - m_Cfg.navig_on = FALSE; + m_Cfg.navig_on = false; } else { - m_NavigPan->Show(TRUE); - m_HtmlWin->Show(TRUE); + m_NavigPan->Show(); + m_HtmlWin->Show(); m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - m_Cfg.navig_on = TRUE; + m_Cfg.navig_on = true; } } break; @@ -1458,10 +1463,10 @@ void wxHtmlHelpFrame::OnContentsSel(wxTreeEvent& event) if (pg && m_UpdateContents) { it = m_Data->GetContents() + (pg->m_Id); - m_UpdateContents = FALSE; + m_UpdateContents = false; if (it->m_Page[0] != 0) m_HtmlWin->LoadPage(it->GetFullPath()); - m_UpdateContents = TRUE; + m_UpdateContents = true; } } @@ -1490,7 +1495,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event) const wxChar *cstr = sr.c_str(); wxChar mybuff[512]; wxChar *ptr; - bool first = TRUE; + bool first = true; m_IndexList->Clear(); int cnt = m_Data->GetIndexCnt(); @@ -1513,7 +1518,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event) if (index[i].m_Page[0] != 0) m_HtmlWin->LoadPage(index[i].GetFullPath()); NotifyPageChanged(); - first = FALSE; + first = false; } } } @@ -1533,7 +1538,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event)) m_IndexList->Clear(); int cnt = m_Data->GetIndexCnt(); - bool first = TRUE; + bool first = true; wxHtmlContentsItem* index = m_Data->GetIndex(); for (int i = 0; i < cnt; i++) @@ -1544,7 +1549,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event)) if (index[i].m_Page[0] != 0) m_HtmlWin->LoadPage(index[i].GetFullPath()); NotifyPageChanged(); - first = FALSE; + first = false; } } @@ -1595,7 +1600,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt) RemoveGrab(); } #endif - + if (m_Splitter && m_Cfg.navig_on) m_Cfg.sashpos = m_Splitter->GetSashPosition(); if (m_Config) @@ -1612,7 +1617,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt) #ifdef __WXMAC__ void wxHtmlHelpFrame::OnClose(wxCommandEvent& event) { - Close(TRUE); + Close(true); } void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event) diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 1163ab619f..ba6c799f25 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -223,7 +223,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer() if (m_parentSizer == NULL) // setup window: { - m_parentAsWindow->SetAutoLayout(true); m_parentAsWindow->SetSizer(sizer); wxXmlNode *nd = m_node; diff --git a/src/xrc/xh_unkwn.cpp b/src/xrc/xh_unkwn.cpp index d8b615cf6e..84c0158ff1 100644 --- a/src/xrc/xh_unkwn.cpp +++ b/src/xrc/xh_unkwn.cpp @@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child) wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add((wxWindow*)child, 1, wxEXPAND); SetSizer(sizer); - SetAutoLayout(true); Layout(); } diff --git a/utils/configtool/src/configbrowser.cpp b/utils/configtool/src/configbrowser.cpp index 372c2ca450..0eee4d5fa0 100644 --- a/utils/configtool/src/configbrowser.cpp +++ b/utils/configtool/src/configbrowser.cpp @@ -58,14 +58,13 @@ ctConfigurationBrowserWindow::ctConfigurationBrowserWindow( wxWindow* parent, wx */ void ctConfigurationBrowserWindow::CreateControls() -{ +{ ////@begin ctConfigurationBrowserWindow content construction ctConfigurationBrowserWindow* item1 = this; wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(true); wxSplitterWindow* item3 = new wxSplitterWindow(item1, ID_CONFIGBROWSER_SPLITTERWINDOW, wxDefaultPosition, wxSize(400, 400), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE); wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER); @@ -142,14 +141,13 @@ ctConfigurationBrowserControlPanel::ctConfigurationBrowserControlPanel( wxWindow */ void ctConfigurationBrowserControlPanel::CreateControls() -{ +{ ////@begin ctConfigurationBrowserControlPanel content construction ctConfigurationBrowserControlPanel* item5 = this; wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL); item5->SetSizer(item6); - item5->SetAutoLayout(true); wxStaticText* item7 = new wxStaticText(item5, wxID_STATIC, _("Browse, add and remove configurations"), wxDefaultPosition, wxDefaultSize, 0); item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5); @@ -170,7 +168,7 @@ void ctConfigurationBrowserControlPanel::CreateControls() wxStaticText* item13 = new wxStaticText(item5, ID_CONFIGURATION_NAME, _("Configuration:"), wxDefaultPosition, wxDefaultSize, 0); item6->Add(item13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH); + wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH); item6->Add(item14, 1, wxGROW|wxALL, 5); ////@end ctConfigurationBrowserControlPanel content construction diff --git a/utils/configtool/src/configitemselector.cpp b/utils/configtool/src/configitemselector.cpp index 25cd3714bc..c877f95df1 100644 --- a/utils/configtool/src/configitemselector.cpp +++ b/utils/configtool/src/configitemselector.cpp @@ -74,14 +74,13 @@ ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, c */ void ctConfigItemsSelector::CreateControls() -{ +{ ////@begin ctConfigItemsSelector content construction ctConfigItemsSelector* item1 = this; wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(true); wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); item2->Add(item3, 1, wxGROW|wxALL, 5); diff --git a/utils/configtool/src/custompropertydialog.cpp b/utils/configtool/src/custompropertydialog.cpp index 2be4b2db88..b002d67ced 100644 --- a/utils/configtool/src/custompropertydialog.cpp +++ b/utils/configtool/src/custompropertydialog.cpp @@ -70,14 +70,13 @@ ctCustomPropertyDialog::ctCustomPropertyDialog( wxWindow* parent, wxWindowID id, */ void ctCustomPropertyDialog::CreateControls() -{ +{ ////@begin ctCustomPropertyDialog content construction ctCustomPropertyDialog* item1 = this; wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(true); wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); item2->Add(item3, 1, wxGROW|wxALL, 5); @@ -88,7 +87,7 @@ void ctCustomPropertyDialog::CreateControls() wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0); item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, _(""), wxDefaultPosition, wxDefaultSize, 0); + wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); item3->Add(item6, 0, wxGROW|wxALL, 5); wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL); @@ -148,7 +147,7 @@ void ctCustomPropertyDialog::CreateControls() wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0); item3->Add(item19, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH); + wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH); item3->Add(item20, 1, wxGROW|wxALL, 5); wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL); diff --git a/utils/configtool/src/propeditor.cpp b/utils/configtool/src/propeditor.cpp index d184199412..b7b05fb696 100644 --- a/utils/configtool/src/propeditor.cpp +++ b/utils/configtool/src/propeditor.cpp @@ -99,7 +99,6 @@ void ctPropertyEditor::CreateControls(wxWindow* parent) item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - this->SetAutoLayout(true); this->SetSizer( item0 ); /// Add help text @@ -159,7 +158,7 @@ void ctPropertyEditor::ClearEditor() { m_attributeEditorGrid->ClearAttributes(); m_propertyDescriptionWindow->SetPage(WrapDescription(wxEmptyString)); - m_elementTitleTextCtrl->SetValue(_T("")); + m_elementTitleTextCtrl->SetValue(wxEmptyString); } /// Handles detailed editing event. @@ -294,13 +293,13 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly if (!m_item->CanEditProperty(prop->GetName())) { m_attributeEditorGrid->SetReadOnly(row, 1); - + wxColour col(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); m_attributeEditorGrid->SetCellTextColour(row, 1, col); } else { - m_attributeEditorGrid->SetReadOnly(row, 1, false); + m_attributeEditorGrid->SetReadOnly(row, 1, false); m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK); } @@ -346,7 +345,7 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly m_attributeEditorGrid->SetCellEditor(row, 1, new ctGridCellTextEditor); } - + return true; } @@ -411,7 +410,7 @@ ctProperty* ctPropertyEditor::FindSelectedProperty(int& row) if (selRow > -1) { row = selRow; - + if (selRow < (int) m_item->GetProperties().GetCount()) { ctProperty* prop = m_item->GetProperties().GetNth(selRow); @@ -536,7 +535,7 @@ void ctPropertyEditor::UpdateDescription(int row) } if (row == -1) { - wxString str = WrapDescription(wxEmptyString); + wxString str = WrapDescription(wxEmptyString); m_propertyDescriptionWindow->SetPage(str); } else @@ -544,7 +543,7 @@ void ctPropertyEditor::UpdateDescription(int row) ctProperty* prop = FindProperty(row); if (prop) { - wxString str = WrapDescription(m_item->GetDescription(prop)); + wxString str = WrapDescription(m_item->GetDescription(prop)); m_propertyDescriptionWindow->SetPage(str); } } @@ -557,13 +556,13 @@ wxString ctPropertyEditor::WrapDescription(const wxString& s) wxColour col = ctDESCRIPTION_BACKGROUND_COLOUR; wxString colStr = apColourToHexString(col); colStr = wxT("#") + colStr; - + wxString str; str << _T("") ; str << s; str << _T(""); - - return str; + + return str; } /// Intercept cell data change event. @@ -655,13 +654,13 @@ void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* proper // Apply the new value property->GetVariant() = variant; - item->ApplyProperty(property, oldValue); + item->ApplyProperty(property, oldValue); item->Modify(); - + UpdateItem(); wxString menuLabel(_T("Change ") + property->GetName()); - + // This won't do anything first time Do is applied, // since we've already done the action for this property. // But when we Undo or Redo, the changed properties will be applied. @@ -791,7 +790,7 @@ ctMultiLineTextEditor::ctMultiLineTextEditor( wxWindow *parent, wxWindowID id, c AddControls(this, msg); Centre(); } - + bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg) { wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); @@ -801,7 +800,7 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg) wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 ); item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT, 5 ); - wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH ); + wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH ); item1->Add( item3, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL ); @@ -826,7 +825,6 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg) item3->SetFocus(); ((wxButton*) FindWindow(wxID_OK))->SetDefault(); - parent->SetAutoLayout( true ); parent->SetSizer(item0); item0->Fit(parent); diff --git a/utils/configtool/src/settingsdialog.cpp b/utils/configtool/src/settingsdialog.cpp index b43838777c..4d8a7ef4f8 100644 --- a/utils/configtool/src/settingsdialog.cpp +++ b/utils/configtool/src/settingsdialog.cpp @@ -69,14 +69,13 @@ ctSettingsDialog::ctSettingsDialog( wxWindow* parent, wxWindowID id, const wxStr */ void ctSettingsDialog::CreateControls() -{ +{ ////@begin ctSettingsDialog content construction ctSettingsDialog* item1 = this; wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(true); wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP); wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3); @@ -204,14 +203,13 @@ ctGeneralSettingsDialog::ctGeneralSettingsDialog( wxWindow* parent, wxWindowID i */ void ctGeneralSettingsDialog::CreateControls() -{ +{ ////@begin ctGeneralSettingsDialog content construction ctGeneralSettingsDialog* item4 = this; wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL); item4->SetSizer(item5); - item4->SetAutoLayout(true); wxStaticBox* item6Static = new wxStaticBox(item4, wxID_ANY, _("General settings")); wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL); @@ -306,14 +304,13 @@ ctLocationSettingsDialog::ctLocationSettingsDialog( wxWindow* parent, wxWindowID */ void ctLocationSettingsDialog::CreateControls() -{ +{ ////@begin ctLocationSettingsDialog content construction ctLocationSettingsDialog* item11 = this; wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL); item11->SetSizer(item12); - item11->SetAutoLayout(true); wxStaticBox* item13Static = new wxStaticBox(item11, wxID_ANY, _("Locations")); wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL); @@ -325,7 +322,7 @@ void ctLocationSettingsDialog::CreateControls() wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL); item13->Add(item15, 0, wxGROW, 5); - wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, _(""), wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0); + wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, wxEmptyString, wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0); item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy")); #if wxUSE_TOOLTIPS if (ShowToolTips()) diff --git a/utils/helpview/src/client.cpp b/utils/helpview/src/client.cpp index 66dc71fde5..dfcae4f0d0 100644 --- a/utils/helpview/src/client.cpp +++ b/utils/helpview/src/client.cpp @@ -182,7 +182,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) // Make a panel m_panel = new wxPanel(this ); - m_modalbutton = new wxButton( this, BUTTON_MODAL, "Modal Dialog", + m_modalbutton = new wxButton( this, BUTTON_MODAL, "Modal Dialog", wxPoint(10,10), wxDefaultSize ); } @@ -266,7 +266,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent) sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5); sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5); - SetAutoLayout(true); SetSizer(sizerTop); sizerTop->SetSizeHints(this); diff --git a/wxPython/contrib/dllwidget/dllwidget.cpp b/wxPython/contrib/dllwidget/dllwidget.cpp index 025c28b806..4a876c93e1 100644 --- a/wxPython/contrib/dllwidget/dllwidget.cpp +++ b/wxPython/contrib/dllwidget/dllwidget.cpp @@ -35,7 +35,7 @@ wxDllWidget::wxDllWidget(wxWindow *parent, long style) : wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER, className + wxT("_container")), - m_widget(NULL), m_lib(NULL), m_controlAdded(FALSE) + m_widget(NULL), m_lib(NULL), m_controlAdded(false) { SetBackgroundColour(wxColour(255, 0, 255)); if ( !!className ) @@ -53,11 +53,10 @@ void wxDllWidget::AddChild(wxWindowBase *child) wxPanel::AddChild(child); - m_controlAdded = TRUE; + m_controlAdded = true; wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add((wxWindow*)child, 1, wxEXPAND); SetSizer(sizer); - SetAutoLayout(TRUE); Layout(); } @@ -85,7 +84,7 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className, { delete m_lib; m_lib = NULL; - return FALSE; + return false; } DLL_WidgetFactory_t factory; @@ -94,7 +93,7 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className, { delete m_lib; m_lib = NULL; - return FALSE; + return false; } if ( !factory(className, this, style, &m_widget, &m_cmdFunc) ) @@ -103,10 +102,10 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className, delete m_lib; m_lib = NULL; m_widget = NULL; - return FALSE; + return false; } - return TRUE; + return true; } void wxDllWidget::UnloadWidget() diff --git a/wxPython/contrib/dllwidget/dllwidget.h b/wxPython/contrib/dllwidget/dllwidget.h index 61263da614..5e15f935d4 100644 --- a/wxPython/contrib/dllwidget/dllwidget.h +++ b/wxPython/contrib/dllwidget/dllwidget.h @@ -41,7 +41,7 @@ Example of use: { public: MyWindow(wxWindow *parent, long style) - : wxWindow(parent, -1) {} + : wxWindow(parent, wxID_ANY) {} int HandleCommand(int cmd, const wxString& param) { @@ -75,7 +75,7 @@ class wxDllWidget : public wxPanel { public: wxDllWidget(wxWindow *parent, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxString& dllName = wxEmptyString, const wxString& className = wxEmptyString, const wxPoint& pos = wxDefaultPosition, @@ -132,12 +132,12 @@ private: { \ *classInst = new widget(parent, style); \ *cmdFunc = SendCommandTo##widget; \ - return TRUE; \ + return true; \ } #define END_WIDGET_LIBRARY() \ - return FALSE; \ + return false; \ } #endif // __DLLWIDGET_H__ diff --git a/wxPython/demo/dllwidget/test_dll.cpp b/wxPython/demo/dllwidget/test_dll.cpp index 0c2d92e16f..4790351db7 100644 --- a/wxPython/demo/dllwidget/test_dll.cpp +++ b/wxPython/demo/dllwidget/test_dll.cpp @@ -9,7 +9,7 @@ class TestWindow : public wxWindow { public: TestWindow(wxWindow *parent, long style) - : wxWindow(parent, -1) + : wxWindow(parent, wxID_ANY) { SetBackgroundColour(wxColour("white")); } -- 2.45.2