if (clearEditArea)
{
m_valueList->Clear();
- m_valueText->SetValue(_T(""));
+ m_valueText->SetValue( wxT("") );
}
- wxNode *node = m_propertySheet->GetProperties().First();
+ wxNode *node = m_propertySheet->GetProperties().GetFirst();
// Should sort them... later...
while (node)
{
- wxProperty *property = (wxProperty *)node->Data();
+ wxProperty *property = (wxProperty *)node->GetData();
wxString stringValueRepr(property->GetValue().GetStringRepresentation());
wxString paddedString(MakeNameValueString(property->GetName(), stringValueRepr));
m_propertyScrollingList->Append(paddedString.GetData(), (void *)property);
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
if (GetFlags() & wxPROP_SHOWVALUES)
{
// Want to pad with spaces
- theString.Append(' ', padWith);
+ theString.Append( wxT(' '), padWith);
theString += value;
}
}
m_valueList->Clear();
- m_valueText->SetValue(_T(""));
+ m_valueText->SetValue( wxT("") );
if (property)
{
if (val < m_realMin || val > m_realMax)
{
- char buf[200];
- sprintf(buf, "Value must be a real number between %.2f and %.2f!", m_realMin, m_realMax);
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, wxT("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax);
+ wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (!m_strings->Member(value.GetData()))
{
- wxString s("Value ");
- s += value.GetData();
- s += " is not valid.";
- wxMessageBox(s.GetData(), "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxString str( wxT("Value ") );
+ str += value.GetData();
+ str += wxT(" is not valid.");
+ wxMessageBox( str.GetData(), wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
return TRUE;
}
-bool wxStringListValidator::OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
+bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property,
+ wxPropertyListView *view,
+ wxWindow *WXUNUSED(parentWindow) )
{
if (view->GetValueList())
{
view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE);
- wxNode *node = m_strings->First();
+ wxStringList::Node *node = m_strings->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
view->GetValueList()->Append(s);
- node = node->Next();
+ node = node->GetNext();
}
wxChar *currentString = property->GetValue().StringValue();
view->GetValueList()->SetStringSelection(currentString);
// Called when the property is double clicked. Extra functionality can be provided,
// cycling through possible values.
-bool wxStringListValidator::OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
+bool wxStringListValidator::OnDoubleClick( wxProperty *property,
+ wxPropertyListView *view,
+ wxWindow *WXUNUSED(parentWindow) )
{
if (!view->GetValueText())
return FALSE;
if (!m_strings)
return FALSE;
- wxNode *node = m_strings->First();
- wxChar *currentString = property->GetValue().StringValue();
+ wxStringList::Node *node = m_strings->GetFirst();
+ wxChar *currentString = property->GetValue().StringValue();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
if (wxStrcmp(s, currentString) == 0)
{
wxChar *nextString = NULL;
- if (node->Next())
- nextString = (wxChar *)node->Next()->Data();
+ if (node->GetNext())
+ nextString = node->GetNext()->GetData();
else
- nextString = (wxChar *)m_strings->First()->Data();
+ nextString = m_strings->GetFirst()->GetData();
property->GetValue() = wxString(nextString);
view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property);
view->OnPropertyChanged(property);
return TRUE;
}
- else node = node->Next();
+ else node = node->GetNext();
}
return TRUE;
}
return TRUE;
}
-void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow)
+void wxListOfStringsListValidator::OnEdit( wxProperty *property,
+ wxPropertyListView *view,
+ wxWindow *parentWindow )
{
// Convert property value to a list of strings for editing
wxStringList *stringList = new wxStringList;
{
wxPropertyValue& oldValue = property->GetValue();
oldValue.ClearList();
- wxNode *node = stringList->First();
+ wxStringList::Node *node = stringList->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = node->GetData();
oldValue.Append(new wxPropertyValue(s));
- node = node->Next();
+ node = node->GetNext();
}
view->DisplayProperty(property);
public:
wxPropertyStringListEditorDialog(wxWindow *parent, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = "stringEditorDialogBox"):
+ long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("stringEditorDialogBox")):
wxDialog(parent, -1, title, pos, size, windowStyle, name)
{
m_stringList = NULL;
public:
wxPropertyStringListEditorText(wxWindow *parent, wxWindowID id, const wxString& val,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long windowStyle = 0, const wxString& name = "text"):
+ long windowStyle = 0, const wxString& name = wxT("text")):
wxTextCtrl(parent, id, val, pos, size, windowStyle, wxDefaultValidator, name)
{
}
wxPoint(-1, -1), wxSize(-1, -1), 0, NULL, wxLB_SINGLE);
dialog->m_stringText = new wxPropertyStringListEditorText(dialog,
- wxID_PROP_SL_TEXT, "", wxPoint(5, 240),
+ wxID_PROP_SL_TEXT, wxT(""), wxPoint(5, 240),
wxSize(300, -1), wxPROCESS_ENTER);
dialog->m_stringText->Enable(FALSE);
- wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, "Add", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, "Delete", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- wxButton *cancelButton = new wxButton(dialog, wxID_CANCEL, "Cancel", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
- wxButton *okButton = new wxButton(dialog, wxID_OK, "OK", wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
+ wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
+ wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
+ wxButton *cancelButton = new wxButton(dialog, wxID_CANCEL, wxT("Cancel"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
+ wxButton *okButton = new wxButton(dialog, wxID_OK, wxT("OK"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight));
#ifndef __WXGTK__
okButton->SetDefault();
c->height.AsIs();
okButton->SetConstraints(c);
- wxNode *node = stringList->First();
+ wxStringList::Node *node = stringList->GetFirst();
while (node)
{
- char *str = (char *)node->Data();
+ wxChar *str = node->GetData();
// Save node as client data for each listbox item
- dialog->m_listBox->Append(str, (char *)node);
- node = node->Next();
+ dialog->m_listBox->Append(str, (wxChar *)node);
+ node = node->GetNext();
}
dialog->SetClientSize(310, 305);
return;
m_listBox->Delete(sel);
- delete[] (wxChar *)node->Data();
+ delete[] (wxChar *)node->GetData();
delete node;
m_currentSelection = -1;
m_stringText->SetValue(_T(""));
wxString initialText;
wxNode *node = m_stringList->Add(initialText);
m_listBox->Append(initialText, (void *)node);
- m_currentSelection = m_stringList->Number() - 1;
+ m_currentSelection = m_stringList->GetCount() - 1;
m_listBox->SetSelection(m_currentSelection);
ShowCurrentSelection();
m_stringText->SetFocus();
return;
wxString txt(m_stringText->GetValue());
- if (node->Data())
- delete[] (char *)node->Data();
- node->SetData((wxObject *)copystring(txt));
+ if (node->GetData())
+ delete[] (wxChar *)node->GetData();
+ node->SetData((wxObject *)wxStrdup(txt));
- m_listBox->SetString(m_currentSelection, (char *)node->Data());
+ m_listBox->SetString(m_currentSelection, (wxChar *)node->GetData());
}
void wxPropertyStringListEditorDialog::ShowCurrentSelection()
{
if (m_currentSelection == -1)
{
- m_stringText->SetValue(_T(""));
+ m_stringText->SetValue(wxT(""));
return;
}
wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection);
- char *txt = (char *)node->Data();
+ wxChar *txt = (wxChar *)node->GetData();
m_stringText->SetValue(txt);
m_stringText->Enable(TRUE);
}