From e2dcdb275b651295b9f75e210d4f9b58be9acaab Mon Sep 17 00:00:00 2001 From: Artur Wieczorek <7330332+a-wi@users.noreply.github.com> Date: Sat, 6 Jan 2024 17:58:22 +0100 Subject: [PATCH] Use wxString() rather than wxEmptyString in propgrid sample --- samples/propgrid/propgrid.cpp | 15 +++++++-------- samples/propgrid/sampleprops.cpp | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 9659b12b01..79dfd835ca 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -339,7 +339,7 @@ public: SingleChoiceProperty( const wxString& label, const wxString& name = wxPG_LABEL, - const wxString& value = wxEmptyString ) + const wxString& value = wxString() ) : wxStringProperty(label, name, value) { // Prepare choices @@ -812,7 +812,7 @@ void FormMain::OnPropertyGridItemRightClick( wxPropertyGridEvent& event ) } else { - sb->SetStatusText( wxEmptyString ); + sb->SetStatusText( wxString() ); } #endif } @@ -834,7 +834,7 @@ void FormMain::OnPropertyGridItemDoubleClick( wxPropertyGridEvent& event ) } else { - sb->SetStatusText ( wxEmptyString ); + sb->SetStatusText ( wxString() ); } #endif } @@ -1280,7 +1280,7 @@ void FormMain::PopulateWithExamples () soc.Add( "Look, it continues", 200 ); soc.Add( "Even More", 240 ); soc.Add( "And More", 280 ); - soc.Add( wxEmptyString, 300 ); + soc.Add( "", 300); soc.Add( "True End of the List", 320 ); // Test custom colours ([] operator of wxPGChoices returns @@ -1331,8 +1331,7 @@ void FormMain::PopulateWithExamples () pg->SetPropertyHelpString( "Password", "Has attribute wxPG_STRING_PASSWORD set to true" ); - // String editor with dir selector button. Uses wxEmptyString as name, which - // is allowed (naturally, in this case property cannot be accessed by name). + // String editor with dir selector button. pg->Append( new wxDirProperty( "DirProperty", wxPG_LABEL, ::wxGetUserHome()) ); pg->SetPropertyAttribute( "DirProperty", wxPG_DIALOG_TITLE, @@ -1978,7 +1977,7 @@ FormMain::FormMain(const wxString& title) // // Create menu bar - wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF); + wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); wxMenu *menuTry = new wxMenu; wxMenu *menuTools1 = new wxMenu; wxMenu *menuTools2 = new wxMenu; @@ -2102,7 +2101,7 @@ FormMain::FormMain(const wxString& title) #if wxUSE_STATUSBAR // create a status bar CreateStatusBar(1); - SetStatusText(wxEmptyString); + SetStatusText(wxString()); #endif // wxUSE_STATUSBAR // Register all editors (SpinCtrl etc.) diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index d22b46cf75..b305cd82f5 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -557,7 +557,7 @@ bool wxArrayDoubleProperty::DisplayEditorDialog(wxPropertyGrid* pg, wxVariant& v // Create editor dialog. wxArrayDoubleEditorDialog dlg; dlg.SetPrecision(m_precision); - dlg.Create(pg->GetPanel(), wxEmptyString, + dlg.Create(pg->GetPanel(), "", m_dlgTitle.empty() ? GetLabel() : m_dlgTitle, curValue, m_dlgStyle); dlg.Move( pg->GetGoodEditorDialogPosition(this,dlg.GetSize()) ); @@ -710,7 +710,7 @@ wxColour MyColourProperty::GetColour(int index) const wxString MyColourProperty::ColourToString(const wxColour& col, int index, wxPGPropValFormatFlags flags) const { if ( index == (int)(m_choices.GetCount() - 1) ) - return wxEmptyString; + return wxString(); return wxColourProperty::ColourToString(col, index, flags); }