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
This commit is contained in:
Dimitri Schoolwerth
2004-06-12 23:44:08 +00:00
parent 3d4875664f
commit dabbc6a5a1
47 changed files with 560 additions and 584 deletions

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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)

View File

@@ -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();
}

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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));

View File

@@ -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;

View File

@@ -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;
}