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 );
// Add two regular buttons
buttons->Add( "..." );
buttons->Add( "A" );
buttons->Add( wxT("...") );
buttons->Add( wxT("A") );
// Add a bitmap button
buttons->Add( wxArtProvider::GetBitmap(wxART_FOLDER) );
@ -136,19 +136,19 @@ bool wxSampleMultiButtonEditor::OnEvent( wxPropertyGrid* propGrid,
if ( event.GetId() == buttons->GetButtonId(0) )
{
// 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
}
if ( event.GetId() == buttons->GetButtonId(1) )
{
// 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
}
if ( event.GetId() == buttons->GetButtonId(2) )
{
// 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
}
}
@ -780,7 +780,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(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());
}
@ -788,7 +788,7 @@ void FormMain::OnPropertyGridLabelEditBegin( 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());
}
@ -884,12 +884,12 @@ void FormMain::OnPropertyGridColBeginDrag( wxPropertyGridEvent& event )
{
if ( m_itemVetoDragging->IsChecked() )
{
wxLogMessage("Splitter %i resize was vetoed", event.GetColumn());
wxLogMessage(wxT("Splitter %i resize was vetoed"), event.GetColumn());
event.Veto();
}
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);
// 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 )
{
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") );
// Set value to unspecified so that Hint attribute will be demonstrated
pg->SetPropertyValueUnspecified("Height");
pg->SetPropertyAttribute("Height", wxPG_ATTR_HINT,
"Enter new height for window" );
pg->SetPropertyValueUnspecified(wxT("Height"));
pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_HINT,
wxT("Enter new height for window") );
// 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
// description text box, as a tool tip, or on the status bar.
pg->SetPropertyHelpString("Height",
"This property uses attributes \"Units\" and \"Hint\"." );
pg->SetPropertyHelpString(wxT("Height"),
wxT("This property uses attributes \"Units\" and \"Hint\".") );
pg->Append( new wxIntProperty(wxT("Width"),wxPG_LABEL,640) );
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->SetPropertyValueUnspecified(wxT("Width"));
pg->SetPropertyAttribute("Width", wxPG_ATTR_HINT,
"Enter new width for window" );
pg->SetPropertyHelpString("Width",
"This property uses attributes \"Units\" and \"Hint\"." );
pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_HINT,
wxT("Enter new width for window") );
pg->SetPropertyHelpString(wxT("Width"),
wxT("This property uses attributes \"Units\" and \"Hint\".") );
pg->Append( new wxIntProperty(wxT("X"),wxPG_LABEL,10) );
pg->SetPropertyAttribute(wxT("X"), wxPG_ATTR_UNITS, wxT("Pixels") );
@ -1212,7 +1212,7 @@ void FormMain::PopulateWithExamples ()
pg->SetPropertyHelpString( wxT("BoolProperty with CheckBox"),
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,
1234500.23) );
prop->SetAttribute(wxPG_ATTR_MIN, -100.12);
@ -1261,12 +1261,12 @@ void FormMain::PopulateWithExamples ()
wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ")
wxT("editor of this property to wxPGEditor_ComboBox)"));
pid = pg->Append( new wxColourProperty("ColourPropertyWithAlpha",
pid = pg->Append( new wxColourProperty(wxT("ColourPropertyWithAlpha"),
wxPG_LABEL,
wxColour(15, 200, 95, 128)) );
pg->SetPropertyAttribute("ColourPropertyWithAlpha", wxPG_COLOUR_HAS_ALPHA, true);
pg->SetPropertyHelpString("ColourPropertyWithAlpha",
"Attribute \"HasAlpha\" is set to true for this property.");
pg->SetPropertyAttribute(wxT("ColourPropertyWithAlpha"), wxPG_COLOUR_HAS_ALPHA, true);
pg->SetPropertyHelpString(wxT("ColourPropertyWithAlpha"),
wxT("Attribute \"HasAlpha\" is set to true for this 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("Even More"), 240 );
soc.Add( wxT("And More"), 280 );
soc.Add( "", 300 );
soc.Add( wxT(""), 300 );
soc.Add( wxT("True End of the List"), 320 );
// Test custom colours ([] operator of wxPGChoices returns
@ -1325,10 +1325,10 @@ void FormMain::PopulateWithExamples ()
soc, 240 ) );
// 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",
"This property uses \"Hint\" attribute.");
pg->SetPropertyHelpString(wxT("EnumProperty 3"),
wxT("This property uses \"Hint\" attribute."));
// 'soc' plus one exclusive extra choice "4th only"
pg->Append( new wxEnumProperty(wxT("EnumProperty 4"),wxPG_LABEL,
@ -1362,22 +1362,22 @@ void FormMain::PopulateWithExamples ()
//
// Demonstrate "AutoComplete" attribute
pg->Append( new wxStringProperty( "StringProperty AutoComplete",
pg->Append( new wxStringProperty( wxT("StringProperty AutoComplete"),
wxPG_LABEL ) );
wxArrayString autoCompleteStrings;
autoCompleteStrings.Add("One choice");
autoCompleteStrings.Add("Another choice");
autoCompleteStrings.Add("Another choice, yeah");
autoCompleteStrings.Add("Yet another choice");
autoCompleteStrings.Add("Yet another choice, bear with me");
pg->SetPropertyAttribute( "StringProperty AutoComplete",
autoCompleteStrings.Add(wxT("One choice"));
autoCompleteStrings.Add(wxT("Another choice"));
autoCompleteStrings.Add(wxT("Another choice, yeah"));
autoCompleteStrings.Add(wxT("Yet another choice"));
autoCompleteStrings.Add(wxT("Yet another choice, bear with me"));
pg->SetPropertyAttribute( wxT("StringProperty AutoComplete"),
wxPG_ATTR_AUTOCOMPLETE,
autoCompleteStrings );
pg->SetPropertyHelpString( "StringProperty AutoComplete",
"AutoComplete attribute has been set for this property "
"(try writing something beginning with 'a', 'o' or 'y').");
pg->SetPropertyHelpString( wxT("StringProperty AutoComplete"),
wxT("AutoComplete attribute has been set for this property ")
wxT("(try writing something beginning with 'a', 'o' or 'y')."));
// Add string property with arbitrarily wide bitmap in front of it. We
// 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 2"));
eech.Add(wxT("Choice 3"));
pg->Append( new wxEditEnumProperty("EditEnumProperty",
pg->Append( new wxEditEnumProperty(wxT("EditEnumProperty"),
wxPG_LABEL,
eech,
"Choice not in the list") );
wxT("Choice not in the list")) );
// 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_;
//wxTextValidator validator1(wxFILTER_NUMERIC,&v_);
@ -1611,10 +1611,10 @@ void FormMain::PopulateWithLibraryConfig ()
wxFont italicFont = pgman->GetGrid()->GetCaptionFont();
italicFont.SetStyle(wxFONTSTYLE_ITALIC);
wxString italicFontHelp = "Font of this property's wxPGCell has "
"been modified. Obtain property's cell "
"with wxPGProperty::"
"GetOrCreateCell(column).";
wxString italicFontHelp = wxT("Font of this property's wxPGCell has ")
wxT("been modified. Obtain property's cell ")
wxT("with wxPGProperty::")
wxT("GetOrCreateCell(column).");
#define ADD_WX_LIB_CONF_GROUP(A) \
cat = pg->AppendIn( pid, new wxPropertyCategory(A) ); \
@ -1630,8 +1630,8 @@ void FormMain::PopulateWithLibraryConfig ()
pg->SetPropertyCell( pid, 0, wxPG_LABEL, bmp );
// Both of following lines would set a label for the second column
pg->SetPropertyCell( pid, 1, "Is Enabled" );
pid->SetValue("Is Enabled");
pg->SetPropertyCell( pid, 1, wxT("Is Enabled") );
pid->SetValue(wxT("Is Enabled"));
ADD_WX_LIB_CONF_GROUP(wxT("Global Settings"))
ADD_WX_LIB_CONF( wxUSE_GUI )
@ -1839,10 +1839,10 @@ void FormMain::FinalizePanel( bool wasCreated )
{
// Button for tab traversal testing
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 );
m_topSizer->Add( new wxButton(m_panel, ID_SHOWPOPUP,
wxS("Show Popup")),
wxT("Show Popup")),
0, wxEXPAND );
m_panel->SetSizer( m_topSizer );
@ -1937,7 +1937,7 @@ void FormMain::CreateGrid( int style, int extraStyle )
//
// Set somewhat different unspecified value appearance
wxPGCell cell;
cell.SetText("Unspecified");
cell.SetText(wxT("Unspecified"));
cell.SetFgCol(*wxLIGHT_GREY);
m_propGrid->SetUnspecifiedValueAppearance(cell);
@ -2033,24 +2033,24 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
menuTools1->AppendSeparator();
menuTools1->Append(ID_SETBGCOLOUR, wxT("Set Bg Colour") );
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();
m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
wxT("Toggles item's enabled state.") );
m_itemEnable->Enable( false );
menuTools1->Append(ID_HIDE, "Hide", "Hides a property" );
menuTools1->Append(ID_SETREADONLY, "Set as Read-Only",
"Set property as read-only" );
menuTools1->Append(ID_HIDE, wxT("Hide"), wxT("Hides a property") );
menuTools1->Append(ID_SETREADONLY, wxT("Set as Read-Only"),
wxT("Set property as read-only") );
menuTools2->Append(ID_ITERATE1, wxT("Iterate Over Properties") );
menuTools2->Append(ID_ITERATE2, wxT("Iterate Over Visible Items") );
menuTools2->Append(ID_ITERATE3, wxT("Reverse Iterate Over Properties") );
menuTools2->Append(ID_ITERATE4, wxT("Iterate Over Categories") );
menuTools2->AppendSeparator();
menuTools2->Append(ID_ONEXTENDEDKEYNAV, "Extend Keyboard Navigation",
"This will set Enter to navigate to next property, "
"and allows arrow keys to navigate even when in "
"editor control.");
menuTools2->Append(ID_ONEXTENDEDKEYNAV, wxT("Extend Keyboard Navigation"),
wxT("This will set Enter to navigate to next property, ")
wxT("and allows arrow keys to navigate even when in ")
wxT("editor control."));
menuTools2->AppendSeparator();
menuTools2->Append(ID_SETPROPERTYVALUE, wxT("Set Property Value") );
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") );
m_itemVetoDragging =
menuTools2->AppendCheckItem(ID_VETOCOLDRAG,
"Veto Column Dragging");
wxT("Veto Column Dragging"));
menuTools2->AppendSeparator();
menuTools2->Append(ID_CHANGEFLAGSITEMS, wxT("Change Children of FlagsProp") );
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"),
wxT("Select window style flags used by the grid."));
menuTry->Append(ID_ENABLELABELEDITING, "Enable label editing",
"This calls wxPropertyGrid::MakeColumnEditable(0)");
menuTry->Append(ID_ENABLELABELEDITING, wxT("Enable label editing"),
wxT("This calls wxPropertyGrid::MakeColumnEditable(0)"));
menuTry->AppendCheckItem(ID_SHOWHEADER,
"Enable header",
"This calls wxPropertyGridManager::ShowHeader()");
wxT("Enable header"),
wxT("This calls wxPropertyGridManager::ShowHeader()"));
menuTry->AppendSeparator();
menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard 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
// 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,
GetPosition().y);
m_logWindow->Show();
@ -2559,7 +2559,7 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event )
return;
}
wxColour col = ::wxGetColourFromUser(this, *wxWHITE, "Choose colour");
wxColour col = ::wxGetColourFromUser(this, *wxWHITE, wxT("Choose colour"));
if ( col.IsOk() )
{
@ -2688,7 +2688,7 @@ void FormMain::OnEnableLabelEditing( wxCommandEvent& WXUNUSED(event) )
void FormMain::OnShowHeader( wxCommandEvent& event )
{
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->SetColumnCount(3);
wxPGProperty *prop=m_grid->Append(new wxStringProperty("test_name", wxPG_LABEL, "test_value"));
m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, "type");
wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty("sub_name1", wxPG_LABEL, "sub_value1"));
wxPGProperty *prop=m_grid->Append(new wxStringProperty(wxT("test_name"), wxPG_LABEL, wxT("test_value")));
m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, wxT("type"));
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()));
wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty("sub_name2", wxPG_LABEL, "sub_value2"));
m_grid->AppendIn(prop2, new wxStringProperty("sub_name21", wxPG_LABEL, "sub_value21"));
wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name2"), wxPG_LABEL, wxT("sub_value2")));
m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name21"), wxPG_LABEL, wxT("sub_value21")));
wxArrayDouble arrdbl;
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 wxFontProperty(wxT("Font"),wxPG_LABEL));
m_grid->AppendIn(prop2, new wxStringProperty("sub_name22", wxPG_LABEL, "sub_value22"));
m_grid->AppendIn(prop2, new wxStringProperty("sub_name23", wxPG_LABEL, "sub_value23"));
m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name22"), wxPG_LABEL, wxT("sub_value22")));
m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name23"), wxPG_LABEL, wxT("sub_value23")));
prop2->SetExpanded(false);
::SetMinSize(m_grid);
@ -3251,13 +3251,13 @@ struct PropertyGridPopup : wxPopupWindow
void OnCollapse(wxPropertyGridEvent& WXUNUSED(event))
{
wxLogMessage("OnCollapse");
wxLogMessage(wxT("OnCollapse"));
Fit();
}
void OnExpand(wxPropertyGridEvent& WXUNUSED(event))
{
wxLogMessage("OnExpand");
wxLogMessage(wxT("OnExpand"));
Fit();
}

View File

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

View File

@ -69,7 +69,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n
m_value_wxFontData << fontData;
// Add extra children.
AddPrivateChild( new wxColourProperty(_("Colour"), wxPG_LABEL,
AddPrivateChild( new wxColourProperty(wxT("Colour"), wxPG_LABEL,
fontData.GetColour() ) );
}
@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { }
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;
font << m_value;
@ -277,7 +277,7 @@ wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue,
// -----------------------------------------------------------------------
WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',',
"Browse")
wxT("Browse"))
#if wxUSE_VALIDATORS
@ -292,7 +292,7 @@ wxValidator* wxDirsProperty::DoGetValidator() const
bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value )
{
wxDirDialog dlg(parent,
_("Select a directory to be added to the list:"),
wxT("Select a directory to be added to the list:"),
value,
0);
@ -657,7 +657,7 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
wxArrayString incChars(numValidator.GetIncludes());
// Accept also a delimiter and space character
incChars.Add(m_delimiter);
incChars.Add(" ");
incChars.Add(wxT(" "));
validator->SetIncludes(incChars);
@ -670,9 +670,9 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
bool wxArrayDoubleProperty::ValidateValue(wxVariant& value,
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;
}

View File

@ -511,7 +511,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxAny any;
#if wxUSE_DATETIME
prop = pgman->GetProperty("DateProperty");
prop = pgman->GetProperty(wxT("DateProperty"));
wxDateTime testTime = wxDateTime::Now();
any = testTime;
prop->SetValue(any);
@ -519,7 +519,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_FAILURE();
#endif
prop = pgman->GetProperty("IntProperty");
prop = pgman->GetProperty(wxT("IntProperty"));
int testInt = 25537983;
any = testInt;
prop->SetValue(any);
@ -530,15 +530,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_FAILURE();
#endif
prop = pgman->GetProperty("StringProperty");
wxString testString = "asd934jfyn3";
prop = pgman->GetProperty(wxT("StringProperty"));
wxString testString = wxT("asd934jfyn3");
any = testString;
prop->SetValue(any);
if ( prop->GetValue().GetAny().As<wxString>() != testString )
RT_FAILURE();
// Test with a type generated with IMPLEMENT_VARIANT_OBJECT()
prop = pgman->GetProperty("ColourProperty");
prop = pgman->GetProperty(wxT("ColourProperty"));
wxColour testCol = *wxCYAN;
any = testCol;
prop->SetValue(any);
@ -547,7 +547,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
// Test with a type with custom wxVariantData defined by
// wxPG headers.
prop = pgman->GetProperty("Position");
prop = pgman->GetProperty(wxT("Position"));
wxPoint testPoint(199, 199);
any = testPoint;
prop->SetValue(any);
@ -742,50 +742,50 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
//
// 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);
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();
}
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();
}
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();
}
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();
}
// SetPropertyValueString for special cases such as wxColour
pgman->SetPropertyValueString("ColourProperty", "(123,4,255)");
col << pgman->GetPropertyValue("ColourProperty");
pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("(123,4,255)"));
col << pgman->GetPropertyValue(wxT("ColourProperty"));
if ( col != wxColour(123, 4, 255) )
RT_FAILURE();
pgman->SetPropertyValueString("ColourProperty", "#FE860B");
col << pgman->GetPropertyValue("ColourProperty");
pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("#FE860B"));
col << pgman->GetPropertyValue(wxT("ColourProperty"));
if ( col != wxColour(254, 134, 11) )
RT_FAILURE();
pgman->SetPropertyValueString("ColourPropertyWithAlpha",
"(10, 20, 30, 128)");
col << pgman->GetPropertyValue("ColourPropertyWithAlpha");
pgman->SetPropertyValueString(wxT("ColourPropertyWithAlpha"),
wxT("(10, 20, 30, 128)"));
col << pgman->GetPropertyValue(wxT("ColourPropertyWithAlpha"));
if ( col != wxColour(10, 20, 30, 128) )
RT_FAILURE();
if ( pgman->GetPropertyValueAsString("ColourPropertyWithAlpha")
!= "(10,20,30,128)" )
if ( pgman->GetPropertyValueAsString(wxT("ColourPropertyWithAlpha"))
!= wxT("(10,20,30,128)") )
RT_FAILURE();
}
@ -908,20 +908,20 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_START_TEST(DoubleToString)
// Locale-specific decimal separator
wxString sep = wxString::Format("%g", 1.1)[1];
wxString sep = wxString::Format(wxT("%g"), 1.1)[1];
wxString s;
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();
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();
if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) !=
wxString::Format("0%s0", sep) )
wxString::Format(wxT("0%s0"), sep) )
RT_FAILURE();
if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != "0" )
if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != wxT("0") )
RT_FAILURE();
}
#endif
@ -1088,17 +1088,17 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p;
wxPGProperty* origParent =
pgman->GetProperty("Window Styles")->GetParent();
pgman->GetProperty(wxT("Window Styles"))->GetParent();
// 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 = pgman->RemoveProperty("Window Styles");
p = pgman->RemoveProperty(wxT("Window Styles"));
pgman->Refresh();
pgman->Update();
pgman->AppendIn(origParent, p);
wxASSERT( p->GetCell(2).GetText() == "style");
wxASSERT( p->GetCell(2).GetText() == wxT("style"));
pgman->Refresh();
pgman->Update();
}
@ -1161,7 +1161,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_START_TEST(Clear)
// Manager clear
pgman->SelectProperty("Label");
pgman->SelectProperty(wxT("Label"));
pgman->Clear();
if ( pgman->GetPageCount() )
@ -1175,7 +1175,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
pgman = m_pPropGridManager;
// Grid clear
pgman->SelectProperty("Label");
pgman->SelectProperty(wxT("Label"));
pgman->GetGrid()->Clear();
if ( pgman->GetGrid()->GetRoot()->GetChildCount() )