Use wxT macro with string literals in propgrid sample.

This fix is to unify string literals in the sample.
This commit is contained in:
Artur Wieczorek 2015-05-10 20:06:46 +02:00
parent d4440703b2
commit cc799c10ac
4 changed files with 122 additions and 122 deletions

View File

@ -106,8 +106,8 @@ wxPGWindowList wxSampleMultiButtonEditor::CreateControls( wxPropertyGrid* propGr
wxPGMultiButton* buttons = new wxPGMultiButton( propGrid, sz ); wxPGMultiButton* buttons = new wxPGMultiButton( propGrid, sz );
// Add two regular buttons // Add two regular buttons
buttons->Add( "..." ); buttons->Add( wxT("...") );
buttons->Add( "A" ); buttons->Add( wxT("A") );
// Add a bitmap button // Add a bitmap button
buttons->Add( wxArtProvider::GetBitmap(wxART_FOLDER) ); buttons->Add( wxArtProvider::GetBitmap(wxART_FOLDER) );
@ -136,19 +136,19 @@ bool wxSampleMultiButtonEditor::OnEvent( wxPropertyGrid* propGrid,
if ( event.GetId() == buttons->GetButtonId(0) ) if ( event.GetId() == buttons->GetButtonId(0) )
{ {
// Do something when the first button is pressed // Do something when the first button is pressed
wxLogDebug("First button pressed"); wxLogDebug(wxT("First button pressed"));
return false; // Return false since value did not change return false; // Return false since value did not change
} }
if ( event.GetId() == buttons->GetButtonId(1) ) if ( event.GetId() == buttons->GetButtonId(1) )
{ {
// Do something when the second button is pressed // Do something when the second button is pressed
wxMessageBox("Second button pressed"); wxMessageBox(wxT("Second button pressed"));
return false; // Return false since value did not change return false; // Return false since value did not change
} }
if ( event.GetId() == buttons->GetButtonId(2) ) if ( event.GetId() == buttons->GetButtonId(2) )
{ {
// Do something when the third button is pressed // Do something when the third button is pressed
wxMessageBox("Third button pressed"); wxMessageBox(wxT("Third button pressed"));
return false; // Return false since value did not change return false; // Return false since value did not change
} }
} }
@ -780,7 +780,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) )
void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event )
{ {
wxLogMessage("wxPG_EVT_LABEL_EDIT_BEGIN(%s)", wxLogMessage(wxT("wxPG_EVT_LABEL_EDIT_BEGIN(%s)"),
event.GetProperty()->GetLabel().c_str()); event.GetProperty()->GetLabel().c_str());
} }
@ -788,7 +788,7 @@ void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event )
void FormMain::OnPropertyGridLabelEditEnding( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridLabelEditEnding( wxPropertyGridEvent& event )
{ {
wxLogMessage("wxPG_EVT_LABEL_EDIT_ENDING(%s)", wxLogMessage(wxT("wxPG_EVT_LABEL_EDIT_ENDING(%s)"),
event.GetProperty()->GetLabel().c_str()); event.GetProperty()->GetLabel().c_str());
} }
@ -884,12 +884,12 @@ void FormMain::OnPropertyGridColBeginDrag( wxPropertyGridEvent& event )
{ {
if ( m_itemVetoDragging->IsChecked() ) if ( m_itemVetoDragging->IsChecked() )
{ {
wxLogMessage("Splitter %i resize was vetoed", event.GetColumn()); wxLogMessage(wxT("Splitter %i resize was vetoed"), event.GetColumn());
event.Veto(); event.Veto();
} }
else else
{ {
wxLogMessage("Splitter %i resize began", event.GetColumn()); wxLogMessage(wxT("Splitter %i resize began"), event.GetColumn());
} }
} }
@ -899,14 +899,14 @@ void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event )
{ {
wxUnusedVar(event); wxUnusedVar(event);
// For now, let's not spam the log output // For now, let's not spam the log output
//wxLogMessage("Splitter %i is being resized", event.GetColumn()); //wxLogMessage(wxT("Splitter %i is being resized"), event.GetColumn());
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event )
{ {
wxLogMessage("Splitter %i resize ended", event.GetColumn()); wxLogMessage(wxT("Splitter %i resize ended"), event.GetColumn());
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@ -1065,15 +1065,15 @@ void FormMain::PopulateWithStandardItems ()
pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_UNITS, wxT("Pixels") ); pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_UNITS, wxT("Pixels") );
// Set value to unspecified so that Hint attribute will be demonstrated // Set value to unspecified so that Hint attribute will be demonstrated
pg->SetPropertyValueUnspecified("Height"); pg->SetPropertyValueUnspecified(wxT("Height"));
pg->SetPropertyAttribute("Height", wxPG_ATTR_HINT, pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_HINT,
"Enter new height for window" ); wxT("Enter new height for window") );
// Difference between hint and help string is that the hint is shown in // Difference between hint and help string is that the hint is shown in
// an empty value cell, while help string is shown either in the // an empty value cell, while help string is shown either in the
// description text box, as a tool tip, or on the status bar. // description text box, as a tool tip, or on the status bar.
pg->SetPropertyHelpString("Height", pg->SetPropertyHelpString(wxT("Height"),
"This property uses attributes \"Units\" and \"Hint\"." ); wxT("This property uses attributes \"Units\" and \"Hint\".") );
pg->Append( new wxIntProperty(wxT("Width"),wxPG_LABEL,640) ); pg->Append( new wxIntProperty(wxT("Width"),wxPG_LABEL,640) );
pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_MIN, (long)10 ); pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_MIN, (long)10 );
@ -1081,10 +1081,10 @@ void FormMain::PopulateWithStandardItems ()
pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_UNITS, wxT("Pixels") ); pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_UNITS, wxT("Pixels") );
pg->SetPropertyValueUnspecified(wxT("Width")); pg->SetPropertyValueUnspecified(wxT("Width"));
pg->SetPropertyAttribute("Width", wxPG_ATTR_HINT, pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_HINT,
"Enter new width for window" ); wxT("Enter new width for window") );
pg->SetPropertyHelpString("Width", pg->SetPropertyHelpString(wxT("Width"),
"This property uses attributes \"Units\" and \"Hint\"." ); wxT("This property uses attributes \"Units\" and \"Hint\".") );
pg->Append( new wxIntProperty(wxT("X"),wxPG_LABEL,10) ); pg->Append( new wxIntProperty(wxT("X"),wxPG_LABEL,10) );
pg->SetPropertyAttribute(wxT("X"), wxPG_ATTR_UNITS, wxT("Pixels") ); pg->SetPropertyAttribute(wxT("X"), wxPG_ATTR_UNITS, wxT("Pixels") );
@ -1212,7 +1212,7 @@ void FormMain::PopulateWithExamples ()
pg->SetPropertyHelpString( wxT("BoolProperty with CheckBox"), pg->SetPropertyHelpString( wxT("BoolProperty with CheckBox"),
wxT("Property attribute wxPG_BOOL_USE_CHECKBOX has been set to true.") ); wxT("Property attribute wxPG_BOOL_USE_CHECKBOX has been set to true.") );
prop = pg->Append( new wxFloatProperty("FloatProperty", prop = pg->Append( new wxFloatProperty(wxT("FloatProperty"),
wxPG_LABEL, wxPG_LABEL,
1234500.23) ); 1234500.23) );
prop->SetAttribute(wxPG_ATTR_MIN, -100.12); prop->SetAttribute(wxPG_ATTR_MIN, -100.12);
@ -1261,12 +1261,12 @@ void FormMain::PopulateWithExamples ()
wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ") wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ")
wxT("editor of this property to wxPGEditor_ComboBox)")); wxT("editor of this property to wxPGEditor_ComboBox)"));
pid = pg->Append( new wxColourProperty("ColourPropertyWithAlpha", pid = pg->Append( new wxColourProperty(wxT("ColourPropertyWithAlpha"),
wxPG_LABEL, wxPG_LABEL,
wxColour(15, 200, 95, 128)) ); wxColour(15, 200, 95, 128)) );
pg->SetPropertyAttribute("ColourPropertyWithAlpha", wxPG_COLOUR_HAS_ALPHA, true); pg->SetPropertyAttribute(wxT("ColourPropertyWithAlpha"), wxPG_COLOUR_HAS_ALPHA, true);
pg->SetPropertyHelpString("ColourPropertyWithAlpha", pg->SetPropertyHelpString(wxT("ColourPropertyWithAlpha"),
"Attribute \"HasAlpha\" is set to true for this property."); wxT("Attribute \"HasAlpha\" is set to true for this property."));
// //
// This demonstrates using alternative editor for colour property // This demonstrates using alternative editor for colour property
@ -1301,7 +1301,7 @@ void FormMain::PopulateWithExamples ()
soc.Add( wxT("Look, it continues"), 200 ); soc.Add( wxT("Look, it continues"), 200 );
soc.Add( wxT("Even More"), 240 ); soc.Add( wxT("Even More"), 240 );
soc.Add( wxT("And More"), 280 ); soc.Add( wxT("And More"), 280 );
soc.Add( "", 300 ); soc.Add( wxT(""), 300 );
soc.Add( wxT("True End of the List"), 320 ); soc.Add( wxT("True End of the List"), 320 );
// Test custom colours ([] operator of wxPGChoices returns // Test custom colours ([] operator of wxPGChoices returns
@ -1325,10 +1325,10 @@ void FormMain::PopulateWithExamples ()
soc, 240 ) ); soc, 240 ) );
// Test Hint attribute in EnumProperty // Test Hint attribute in EnumProperty
pg->GetProperty("EnumProperty 3")->SetAttribute(wxPG_ATTR_HINT, "Dummy Hint"); pg->GetProperty(wxT("EnumProperty 3"))->SetAttribute(wxPG_ATTR_HINT, wxT("Dummy Hint"));
pg->SetPropertyHelpString("EnumProperty 3", pg->SetPropertyHelpString(wxT("EnumProperty 3"),
"This property uses \"Hint\" attribute."); wxT("This property uses \"Hint\" attribute."));
// 'soc' plus one exclusive extra choice "4th only" // 'soc' plus one exclusive extra choice "4th only"
pg->Append( new wxEnumProperty(wxT("EnumProperty 4"),wxPG_LABEL, pg->Append( new wxEnumProperty(wxT("EnumProperty 4"),wxPG_LABEL,
@ -1362,22 +1362,22 @@ void FormMain::PopulateWithExamples ()
// //
// Demonstrate "AutoComplete" attribute // Demonstrate "AutoComplete" attribute
pg->Append( new wxStringProperty( "StringProperty AutoComplete", pg->Append( new wxStringProperty( wxT("StringProperty AutoComplete"),
wxPG_LABEL ) ); wxPG_LABEL ) );
wxArrayString autoCompleteStrings; wxArrayString autoCompleteStrings;
autoCompleteStrings.Add("One choice"); autoCompleteStrings.Add(wxT("One choice"));
autoCompleteStrings.Add("Another choice"); autoCompleteStrings.Add(wxT("Another choice"));
autoCompleteStrings.Add("Another choice, yeah"); autoCompleteStrings.Add(wxT("Another choice, yeah"));
autoCompleteStrings.Add("Yet another choice"); autoCompleteStrings.Add(wxT("Yet another choice"));
autoCompleteStrings.Add("Yet another choice, bear with me"); autoCompleteStrings.Add(wxT("Yet another choice, bear with me"));
pg->SetPropertyAttribute( "StringProperty AutoComplete", pg->SetPropertyAttribute( wxT("StringProperty AutoComplete"),
wxPG_ATTR_AUTOCOMPLETE, wxPG_ATTR_AUTOCOMPLETE,
autoCompleteStrings ); autoCompleteStrings );
pg->SetPropertyHelpString( "StringProperty AutoComplete", pg->SetPropertyHelpString( wxT("StringProperty AutoComplete"),
"AutoComplete attribute has been set for this property " wxT("AutoComplete attribute has been set for this property ")
"(try writing something beginning with 'a', 'o' or 'y')."); wxT("(try writing something beginning with 'a', 'o' or 'y')."));
// Add string property with arbitrarily wide bitmap in front of it. We // Add string property with arbitrarily wide bitmap in front of it. We
// intentionally lower-than-typical row height here so that the ugly // intentionally lower-than-typical row height here so that the ugly
@ -1440,13 +1440,13 @@ void FormMain::PopulateWithExamples ()
eech.Add(wxT("Choice 1")); eech.Add(wxT("Choice 1"));
eech.Add(wxT("Choice 2")); eech.Add(wxT("Choice 2"));
eech.Add(wxT("Choice 3")); eech.Add(wxT("Choice 3"));
pg->Append( new wxEditEnumProperty("EditEnumProperty", pg->Append( new wxEditEnumProperty(wxT("EditEnumProperty"),
wxPG_LABEL, wxPG_LABEL,
eech, eech,
"Choice not in the list") ); wxT("Choice not in the list")) );
// Test Hint attribute in EditEnumProperty // Test Hint attribute in EditEnumProperty
pg->GetProperty("EditEnumProperty")->SetAttribute(wxPG_ATTR_HINT, "Dummy Hint"); pg->GetProperty(wxT("EditEnumProperty"))->SetAttribute(wxPG_ATTR_HINT, wxT("Dummy Hint"));
//wxString v_; //wxString v_;
//wxTextValidator validator1(wxFILTER_NUMERIC,&v_); //wxTextValidator validator1(wxFILTER_NUMERIC,&v_);
@ -1611,10 +1611,10 @@ void FormMain::PopulateWithLibraryConfig ()
wxFont italicFont = pgman->GetGrid()->GetCaptionFont(); wxFont italicFont = pgman->GetGrid()->GetCaptionFont();
italicFont.SetStyle(wxFONTSTYLE_ITALIC); italicFont.SetStyle(wxFONTSTYLE_ITALIC);
wxString italicFontHelp = "Font of this property's wxPGCell has " wxString italicFontHelp = wxT("Font of this property's wxPGCell has ")
"been modified. Obtain property's cell " wxT("been modified. Obtain property's cell ")
"with wxPGProperty::" wxT("with wxPGProperty::")
"GetOrCreateCell(column)."; wxT("GetOrCreateCell(column).");
#define ADD_WX_LIB_CONF_GROUP(A) \ #define ADD_WX_LIB_CONF_GROUP(A) \
cat = pg->AppendIn( pid, new wxPropertyCategory(A) ); \ cat = pg->AppendIn( pid, new wxPropertyCategory(A) ); \
@ -1630,8 +1630,8 @@ void FormMain::PopulateWithLibraryConfig ()
pg->SetPropertyCell( pid, 0, wxPG_LABEL, bmp ); pg->SetPropertyCell( pid, 0, wxPG_LABEL, bmp );
// Both of following lines would set a label for the second column // Both of following lines would set a label for the second column
pg->SetPropertyCell( pid, 1, "Is Enabled" ); pg->SetPropertyCell( pid, 1, wxT("Is Enabled") );
pid->SetValue("Is Enabled"); pid->SetValue(wxT("Is Enabled"));
ADD_WX_LIB_CONF_GROUP(wxT("Global Settings")) ADD_WX_LIB_CONF_GROUP(wxT("Global Settings"))
ADD_WX_LIB_CONF( wxUSE_GUI ) ADD_WX_LIB_CONF( wxUSE_GUI )
@ -1839,10 +1839,10 @@ void FormMain::FinalizePanel( bool wasCreated )
{ {
// Button for tab traversal testing // Button for tab traversal testing
m_topSizer->Add( new wxButton(m_panel, wxID_ANY, m_topSizer->Add( new wxButton(m_panel, wxID_ANY,
wxS("Should be able to move here with Tab")), wxT("Should be able to move here with Tab")),
0, wxEXPAND ); 0, wxEXPAND );
m_topSizer->Add( new wxButton(m_panel, ID_SHOWPOPUP, m_topSizer->Add( new wxButton(m_panel, ID_SHOWPOPUP,
wxS("Show Popup")), wxT("Show Popup")),
0, wxEXPAND ); 0, wxEXPAND );
m_panel->SetSizer( m_topSizer ); m_panel->SetSizer( m_topSizer );
@ -1937,7 +1937,7 @@ void FormMain::CreateGrid( int style, int extraStyle )
// //
// Set somewhat different unspecified value appearance // Set somewhat different unspecified value appearance
wxPGCell cell; wxPGCell cell;
cell.SetText("Unspecified"); cell.SetText(wxT("Unspecified"));
cell.SetFgCol(*wxLIGHT_GREY); cell.SetFgCol(*wxLIGHT_GREY);
m_propGrid->SetUnspecifiedValueAppearance(cell); m_propGrid->SetUnspecifiedValueAppearance(cell);
@ -2033,24 +2033,24 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
menuTools1->AppendSeparator(); menuTools1->AppendSeparator();
menuTools1->Append(ID_SETBGCOLOUR, wxT("Set Bg Colour") ); menuTools1->Append(ID_SETBGCOLOUR, wxT("Set Bg Colour") );
menuTools1->Append(ID_SETBGCOLOURRECUR, wxT("Set Bg Colour (Recursively)") ); menuTools1->Append(ID_SETBGCOLOURRECUR, wxT("Set Bg Colour (Recursively)") );
menuTools1->Append(ID_UNSPECIFY, "Set Value to Unspecified"); menuTools1->Append(ID_UNSPECIFY, wxT("Set Value to Unspecified"));
menuTools1->AppendSeparator(); menuTools1->AppendSeparator();
m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"), m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
wxT("Toggles item's enabled state.") ); wxT("Toggles item's enabled state.") );
m_itemEnable->Enable( false ); m_itemEnable->Enable( false );
menuTools1->Append(ID_HIDE, "Hide", "Hides a property" ); menuTools1->Append(ID_HIDE, wxT("Hide"), wxT("Hides a property") );
menuTools1->Append(ID_SETREADONLY, "Set as Read-Only", menuTools1->Append(ID_SETREADONLY, wxT("Set as Read-Only"),
"Set property as read-only" ); wxT("Set property as read-only") );
menuTools2->Append(ID_ITERATE1, wxT("Iterate Over Properties") ); menuTools2->Append(ID_ITERATE1, wxT("Iterate Over Properties") );
menuTools2->Append(ID_ITERATE2, wxT("Iterate Over Visible Items") ); menuTools2->Append(ID_ITERATE2, wxT("Iterate Over Visible Items") );
menuTools2->Append(ID_ITERATE3, wxT("Reverse Iterate Over Properties") ); menuTools2->Append(ID_ITERATE3, wxT("Reverse Iterate Over Properties") );
menuTools2->Append(ID_ITERATE4, wxT("Iterate Over Categories") ); menuTools2->Append(ID_ITERATE4, wxT("Iterate Over Categories") );
menuTools2->AppendSeparator(); menuTools2->AppendSeparator();
menuTools2->Append(ID_ONEXTENDEDKEYNAV, "Extend Keyboard Navigation", menuTools2->Append(ID_ONEXTENDEDKEYNAV, wxT("Extend Keyboard Navigation"),
"This will set Enter to navigate to next property, " wxT("This will set Enter to navigate to next property, ")
"and allows arrow keys to navigate even when in " wxT("and allows arrow keys to navigate even when in ")
"editor control."); wxT("editor control."));
menuTools2->AppendSeparator(); menuTools2->AppendSeparator();
menuTools2->Append(ID_SETPROPERTYVALUE, wxT("Set Property Value") ); menuTools2->Append(ID_SETPROPERTYVALUE, wxT("Set Property Value") );
menuTools2->Append(ID_CLEARMODIF, wxT("Clear Modified Status"), wxT("Clears wxPG_MODIFIED flag from all properties.") ); menuTools2->Append(ID_CLEARMODIF, wxT("Clear Modified Status"), wxT("Clears wxPG_MODIFIED flag from all properties.") );
@ -2079,7 +2079,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
menuTools2->Append(ID_FITCOLUMNS, wxT("Fit Columns") ); menuTools2->Append(ID_FITCOLUMNS, wxT("Fit Columns") );
m_itemVetoDragging = m_itemVetoDragging =
menuTools2->AppendCheckItem(ID_VETOCOLDRAG, menuTools2->AppendCheckItem(ID_VETOCOLDRAG,
"Veto Column Dragging"); wxT("Veto Column Dragging"));
menuTools2->AppendSeparator(); menuTools2->AppendSeparator();
menuTools2->Append(ID_CHANGEFLAGSITEMS, wxT("Change Children of FlagsProp") ); menuTools2->Append(ID_CHANGEFLAGSITEMS, wxT("Change Children of FlagsProp") );
menuTools2->AppendSeparator(); menuTools2->AppendSeparator();
@ -2091,11 +2091,11 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
menuTry->Append(ID_SELECTSTYLE, wxT("Set Window Style"), menuTry->Append(ID_SELECTSTYLE, wxT("Set Window Style"),
wxT("Select window style flags used by the grid.")); wxT("Select window style flags used by the grid."));
menuTry->Append(ID_ENABLELABELEDITING, "Enable label editing", menuTry->Append(ID_ENABLELABELEDITING, wxT("Enable label editing"),
"This calls wxPropertyGrid::MakeColumnEditable(0)"); wxT("This calls wxPropertyGrid::MakeColumnEditable(0)"));
menuTry->AppendCheckItem(ID_SHOWHEADER, menuTry->AppendCheckItem(ID_SHOWHEADER,
"Enable header", wxT("Enable header"),
"This calls wxPropertyGridManager::ShowHeader()"); wxT("This calls wxPropertyGridManager::ShowHeader()"));
menuTry->AppendSeparator(); menuTry->AppendSeparator();
menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard Colour Scheme") ); menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard Colour Scheme") );
menuTry->AppendRadioItem( ID_COLOURSCHEME2, wxT("White Colour Scheme") ); menuTry->AppendRadioItem( ID_COLOURSCHEME2, wxT("White Colour Scheme") );
@ -2141,7 +2141,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
#if wxUSE_LOGWINDOW #if wxUSE_LOGWINDOW
// Create log window // Create log window
m_logWindow = new wxLogWindow(this, "Log Messages", false); m_logWindow = new wxLogWindow(this, wxT("Log Messages"), false);
m_logWindow->GetFrame()->Move(GetPosition().x + GetSize().x + 10, m_logWindow->GetFrame()->Move(GetPosition().x + GetSize().x + 10,
GetPosition().y); GetPosition().y);
m_logWindow->Show(); m_logWindow->Show();
@ -2559,7 +2559,7 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event )
return; return;
} }
wxColour col = ::wxGetColourFromUser(this, *wxWHITE, "Choose colour"); wxColour col = ::wxGetColourFromUser(this, *wxWHITE, wxT("Choose colour"));
if ( col.IsOk() ) if ( col.IsOk() )
{ {
@ -2688,7 +2688,7 @@ void FormMain::OnEnableLabelEditing( wxCommandEvent& WXUNUSED(event) )
void FormMain::OnShowHeader( wxCommandEvent& event ) void FormMain::OnShowHeader( wxCommandEvent& event )
{ {
m_pPropGridManager->ShowHeader(event.IsChecked()); m_pPropGridManager->ShowHeader(event.IsChecked());
m_pPropGridManager->SetColumnTitle(2, _("Units")); m_pPropGridManager->SetColumnTitle(2, wxT("Units"));
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@ -3223,20 +3223,20 @@ struct PropertyGridPopup : wxPopupWindow
m_grid = new wxPropertyGrid(m_panel, ID_POPUPGRID, wxDefaultPosition, wxSize(400,400), wxPG_SPLITTER_AUTO_CENTER); m_grid = new wxPropertyGrid(m_panel, ID_POPUPGRID, wxDefaultPosition, wxSize(400,400), wxPG_SPLITTER_AUTO_CENTER);
m_grid->SetColumnCount(3); m_grid->SetColumnCount(3);
wxPGProperty *prop=m_grid->Append(new wxStringProperty("test_name", wxPG_LABEL, "test_value")); wxPGProperty *prop=m_grid->Append(new wxStringProperty(wxT("test_name"), wxPG_LABEL, wxT("test_value")));
m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, "type"); m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, wxT("type"));
wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty("sub_name1", wxPG_LABEL, "sub_value1")); wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name1"), wxPG_LABEL, wxT("sub_value1")));
m_grid->AppendIn(prop1, new wxSystemColourProperty(wxT("Cell Colour"),wxPG_LABEL, m_grid->GetGrid()->GetCellBackgroundColour())); m_grid->AppendIn(prop1, new wxSystemColourProperty(wxT("Cell Colour"),wxPG_LABEL, m_grid->GetGrid()->GetCellBackgroundColour()));
wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty("sub_name2", wxPG_LABEL, "sub_value2")); wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name2"), wxPG_LABEL, wxT("sub_value2")));
m_grid->AppendIn(prop2, new wxStringProperty("sub_name21", wxPG_LABEL, "sub_value21")); m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name21"), wxPG_LABEL, wxT("sub_value21")));
wxArrayDouble arrdbl; wxArrayDouble arrdbl;
arrdbl.Add(-1.0); arrdbl.Add(-0.5); arrdbl.Add(0.0); arrdbl.Add(0.5); arrdbl.Add(1.0); arrdbl.Add(-1.0); arrdbl.Add(-0.5); arrdbl.Add(0.0); arrdbl.Add(0.5); arrdbl.Add(1.0);
m_grid->AppendIn(prop, new wxArrayDoubleProperty(wxT("ArrayDoubleProperty"),wxPG_LABEL,arrdbl) ); m_grid->AppendIn(prop, new wxArrayDoubleProperty(wxT("ArrayDoubleProperty"),wxPG_LABEL,arrdbl) );
m_grid->AppendIn(prop, new wxFontProperty(wxT("Font"),wxPG_LABEL)); m_grid->AppendIn(prop, new wxFontProperty(wxT("Font"),wxPG_LABEL));
m_grid->AppendIn(prop2, new wxStringProperty("sub_name22", wxPG_LABEL, "sub_value22")); m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name22"), wxPG_LABEL, wxT("sub_value22")));
m_grid->AppendIn(prop2, new wxStringProperty("sub_name23", wxPG_LABEL, "sub_value23")); m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name23"), wxPG_LABEL, wxT("sub_value23")));
prop2->SetExpanded(false); prop2->SetExpanded(false);
::SetMinSize(m_grid); ::SetMinSize(m_grid);
@ -3251,13 +3251,13 @@ struct PropertyGridPopup : wxPopupWindow
void OnCollapse(wxPropertyGridEvent& WXUNUSED(event)) void OnCollapse(wxPropertyGridEvent& WXUNUSED(event))
{ {
wxLogMessage("OnCollapse"); wxLogMessage(wxT("OnCollapse"));
Fit(); Fit();
} }
void OnExpand(wxPropertyGridEvent& WXUNUSED(event)) void OnExpand(wxPropertyGridEvent& WXUNUSED(event))
{ {
wxLogMessage("OnExpand"); wxLogMessage(wxT("OnExpand"));
Fit(); Fit();
} }

View File

@ -46,9 +46,9 @@ MyFrame::MyFrame(wxWindow* parent)
wxPG_BOLD_MODIFIED ); wxPG_BOLD_MODIFIED );
m_pg = pg; m_pg = pg;
pg->Append( new wxStringProperty("String Property", wxPG_LABEL) ); pg->Append( new wxStringProperty(wxT("String Property"), wxPG_LABEL) );
pg->Append( new wxIntProperty("Int Property", wxPG_LABEL) ); pg->Append( new wxIntProperty(wxT("Int Property"), wxPG_LABEL) );
pg->Append( new wxBoolProperty("Bool Property", wxPG_LABEL) ); pg->Append( new wxBoolProperty(wxT("Bool Property"), wxPG_LABEL) );
SetSize(400, 600); SetSize(400, 600);
} }

View File

@ -69,7 +69,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n
m_value_wxFontData << fontData; m_value_wxFontData << fontData;
// Add extra children. // Add extra children.
AddPrivateChild( new wxColourProperty(_("Colour"), wxPG_LABEL, AddPrivateChild( new wxColourProperty(wxT("Colour"), wxPG_LABEL,
fontData.GetColour() ) ); fontData.GetColour() ) );
} }
@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { }
void wxFontDataProperty::OnSetValue() void wxFontDataProperty::OnSetValue()
{ {
if ( m_value.GetType() != "wxFontData" ) if ( m_value.GetType() != wxT("wxFontData") )
{ {
if ( m_value.GetType() == "wxFont" ) if ( m_value.GetType() == wxT("wxFont") )
{ {
wxFont font; wxFont font;
font << m_value; font << m_value;
@ -277,7 +277,7 @@ wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue,
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',', WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',',
"Browse") wxT("Browse"))
#if wxUSE_VALIDATORS #if wxUSE_VALIDATORS
@ -292,7 +292,7 @@ wxValidator* wxDirsProperty::DoGetValidator() const
bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value ) bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value )
{ {
wxDirDialog dlg(parent, wxDirDialog dlg(parent,
_("Select a directory to be added to the list:"), wxT("Select a directory to be added to the list:"),
value, value,
0); 0);
@ -657,7 +657,7 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
wxArrayString incChars(numValidator.GetIncludes()); wxArrayString incChars(numValidator.GetIncludes());
// Accept also a delimiter and space character // Accept also a delimiter and space character
incChars.Add(m_delimiter); incChars.Add(m_delimiter);
incChars.Add(" "); incChars.Add(wxT(" "));
validator->SetIncludes(incChars); validator->SetIncludes(incChars);
@ -670,9 +670,9 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
bool wxArrayDoubleProperty::ValidateValue(wxVariant& value, bool wxArrayDoubleProperty::ValidateValue(wxVariant& value,
wxPGValidationInfo& validationInfo) const wxPGValidationInfo& validationInfo) const
{ {
if (!value.IsType("wxArrayDouble")) if (!value.IsType(wxT("wxArrayDouble")))
{ {
validationInfo.SetFailureMessage(_("At least one element is not a valid floating-point number.")); validationInfo.SetFailureMessage(wxT("At least one element is not a valid floating-point number."));
return false; return false;
} }

View File

@ -511,7 +511,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxAny any; wxAny any;
#if wxUSE_DATETIME #if wxUSE_DATETIME
prop = pgman->GetProperty("DateProperty"); prop = pgman->GetProperty(wxT("DateProperty"));
wxDateTime testTime = wxDateTime::Now(); wxDateTime testTime = wxDateTime::Now();
any = testTime; any = testTime;
prop->SetValue(any); prop->SetValue(any);
@ -519,7 +519,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_FAILURE(); RT_FAILURE();
#endif #endif
prop = pgman->GetProperty("IntProperty"); prop = pgman->GetProperty(wxT("IntProperty"));
int testInt = 25537983; int testInt = 25537983;
any = testInt; any = testInt;
prop->SetValue(any); prop->SetValue(any);
@ -530,15 +530,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_FAILURE(); RT_FAILURE();
#endif #endif
prop = pgman->GetProperty("StringProperty"); prop = pgman->GetProperty(wxT("StringProperty"));
wxString testString = "asd934jfyn3"; wxString testString = wxT("asd934jfyn3");
any = testString; any = testString;
prop->SetValue(any); prop->SetValue(any);
if ( prop->GetValue().GetAny().As<wxString>() != testString ) if ( prop->GetValue().GetAny().As<wxString>() != testString )
RT_FAILURE(); RT_FAILURE();
// Test with a type generated with IMPLEMENT_VARIANT_OBJECT() // Test with a type generated with IMPLEMENT_VARIANT_OBJECT()
prop = pgman->GetProperty("ColourProperty"); prop = pgman->GetProperty(wxT("ColourProperty"));
wxColour testCol = *wxCYAN; wxColour testCol = *wxCYAN;
any = testCol; any = testCol;
prop->SetValue(any); prop->SetValue(any);
@ -547,7 +547,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
// Test with a type with custom wxVariantData defined by // Test with a type with custom wxVariantData defined by
// wxPG headers. // wxPG headers.
prop = pgman->GetProperty("Position"); prop = pgman->GetProperty(wxT("Position"));
wxPoint testPoint(199, 199); wxPoint testPoint(199, 199);
any = testPoint; any = testPoint;
prop->SetValue(any); prop->SetValue(any);
@ -742,50 +742,50 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
// //
// This updates children as well // This updates children as well
wxString nvs = "Lamborghini Diablo XYZ; 5707; [100; 3.9; 8.6] 3000002; Convertible"; wxString nvs = wxT("Lamborghini Diablo XYZ; 5707; [100; 3.9; 8.6] 3000002; Convertible");
pgman->SetPropertyValue("Car", nvs); pgman->SetPropertyValue("Car", nvs);
if ( pgman->GetPropertyValueAsString("Car.Model") != "Lamborghini Diablo XYZ" ) if ( pgman->GetPropertyValueAsString(wxT("Car.Model")) != wxT("Lamborghini Diablo XYZ") )
{ {
wxLogDebug("Did not match: Car.Model=%s", pgman->GetPropertyValueAsString("Car.Model").c_str()); wxLogDebug(wxT("Did not match: Car.Model=%s"), pgman->GetPropertyValueAsString(wxT("Car.Model")).c_str());
RT_FAILURE(); RT_FAILURE();
} }
if ( pgman->GetPropertyValueAsInt("Car.Speeds.Max. Speed (mph)") != 100 ) if ( pgman->GetPropertyValueAsInt(wxT("Car.Speeds.Max. Speed (mph)")) != 100 )
{ {
wxLogDebug("Did not match: Car.Speeds.Max. Speed (mph)=%s", pgman->GetPropertyValueAsString("Car.Speeds.Max. Speed (mph)").c_str()); wxLogDebug(wxT("Did not match: Car.Speeds.Max. Speed (mph)=%s"), pgman->GetPropertyValueAsString(wxT("Car.Speeds.Max. Speed (mph)")).c_str());
RT_FAILURE(); RT_FAILURE();
} }
if ( pgman->GetPropertyValueAsInt("Car.Price ($)") != 3000002 ) if ( pgman->GetPropertyValueAsInt(wxT("Car.Price ($)")) != 3000002 )
{ {
wxLogDebug("Did not match: Car.Price ($)=%s", pgman->GetPropertyValueAsString("Car.Price ($)").c_str()); wxLogDebug(wxT("Did not match: Car.Price ($)=%s"), pgman->GetPropertyValueAsString(wxT("Car.Price ($)")).c_str());
RT_FAILURE(); RT_FAILURE();
} }
if ( !pgman->GetPropertyValueAsBool("Car.Convertible") ) if ( !pgman->GetPropertyValueAsBool(wxT("Car.Convertible")) )
{ {
wxLogDebug("Did not match: Car.Convertible=%s", pgman->GetPropertyValueAsString("Car.Convertible").c_str()); wxLogDebug(wxT("Did not match: Car.Convertible=%s"), pgman->GetPropertyValueAsString(wxT("Car.Convertible")).c_str());
RT_FAILURE(); RT_FAILURE();
} }
// SetPropertyValueString for special cases such as wxColour // SetPropertyValueString for special cases such as wxColour
pgman->SetPropertyValueString("ColourProperty", "(123,4,255)"); pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("(123,4,255)"));
col << pgman->GetPropertyValue("ColourProperty"); col << pgman->GetPropertyValue(wxT("ColourProperty"));
if ( col != wxColour(123, 4, 255) ) if ( col != wxColour(123, 4, 255) )
RT_FAILURE(); RT_FAILURE();
pgman->SetPropertyValueString("ColourProperty", "#FE860B"); pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("#FE860B"));
col << pgman->GetPropertyValue("ColourProperty"); col << pgman->GetPropertyValue(wxT("ColourProperty"));
if ( col != wxColour(254, 134, 11) ) if ( col != wxColour(254, 134, 11) )
RT_FAILURE(); RT_FAILURE();
pgman->SetPropertyValueString("ColourPropertyWithAlpha", pgman->SetPropertyValueString(wxT("ColourPropertyWithAlpha"),
"(10, 20, 30, 128)"); wxT("(10, 20, 30, 128)"));
col << pgman->GetPropertyValue("ColourPropertyWithAlpha"); col << pgman->GetPropertyValue(wxT("ColourPropertyWithAlpha"));
if ( col != wxColour(10, 20, 30, 128) ) if ( col != wxColour(10, 20, 30, 128) )
RT_FAILURE(); RT_FAILURE();
if ( pgman->GetPropertyValueAsString("ColourPropertyWithAlpha") if ( pgman->GetPropertyValueAsString(wxT("ColourPropertyWithAlpha"))
!= "(10,20,30,128)" ) != wxT("(10,20,30,128)") )
RT_FAILURE(); RT_FAILURE();
} }
@ -908,20 +908,20 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_START_TEST(DoubleToString) RT_START_TEST(DoubleToString)
// Locale-specific decimal separator // Locale-specific decimal separator
wxString sep = wxString::Format("%g", 1.1)[1]; wxString sep = wxString::Format(wxT("%g"), 1.1)[1];
wxString s; wxString s;
if ( wxPropertyGrid::DoubleToString(s, 123.123, 2, true) != if ( wxPropertyGrid::DoubleToString(s, 123.123, 2, true) !=
wxString::Format("123%s12", sep.c_str()) ) wxString::Format(wxT("123%s12"), sep.c_str()) )
RT_FAILURE(); RT_FAILURE();
if ( wxPropertyGrid::DoubleToString(s, -123.123, 4, false) != if ( wxPropertyGrid::DoubleToString(s, -123.123, 4, false) !=
wxString::Format("-123%s1230", sep.c_str()) ) wxString::Format(wxT("-123%s1230"), sep.c_str()) )
RT_FAILURE(); RT_FAILURE();
if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) != if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) !=
wxString::Format("0%s0", sep) ) wxString::Format(wxT("0%s0"), sep) )
RT_FAILURE(); RT_FAILURE();
if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != "0" ) if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != wxT("0") )
RT_FAILURE(); RT_FAILURE();
} }
#endif #endif
@ -1088,17 +1088,17 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p; wxPGProperty* p;
wxPGProperty* origParent = wxPGProperty* origParent =
pgman->GetProperty("Window Styles")->GetParent(); pgman->GetProperty(wxT("Window Styles"))->GetParent();
// For testing purposes, let's set some custom cell colours // For testing purposes, let's set some custom cell colours
p = pgman->GetProperty("Window Styles"); p = pgman->GetProperty(wxT("Window Styles"));
p->SetCell(2, wxPGCell("style")); p->SetCell(2, wxPGCell("style"));
p = pgman->RemoveProperty("Window Styles"); p = pgman->RemoveProperty(wxT("Window Styles"));
pgman->Refresh(); pgman->Refresh();
pgman->Update(); pgman->Update();
pgman->AppendIn(origParent, p); pgman->AppendIn(origParent, p);
wxASSERT( p->GetCell(2).GetText() == "style"); wxASSERT( p->GetCell(2).GetText() == wxT("style"));
pgman->Refresh(); pgman->Refresh();
pgman->Update(); pgman->Update();
} }
@ -1161,7 +1161,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_START_TEST(Clear) RT_START_TEST(Clear)
// Manager clear // Manager clear
pgman->SelectProperty("Label"); pgman->SelectProperty(wxT("Label"));
pgman->Clear(); pgman->Clear();
if ( pgman->GetPageCount() ) if ( pgman->GetPageCount() )
@ -1175,7 +1175,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
pgman = m_pPropGridManager; pgman = m_pPropGridManager;
// Grid clear // Grid clear
pgman->SelectProperty("Label"); pgman->SelectProperty(wxT("Label"));
pgman->GetGrid()->Clear(); pgman->GetGrid()->Clear();
if ( pgman->GetGrid()->GetRoot()->GetChildCount() ) if ( pgman->GetGrid()->GetRoot()->GetChildCount() )