#include "wx/wx.h"
#endif
+#include "wx/colordlg.h"
+#include "wx/proplist.h"
+
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#if wxUSE_IOSTREAMH
-#if defined(__WXMSW__) && !defined(__GNUWIN32__)
-#include <strstrea.h>
-#else
-#include <strstream.h>
-#endif
-#else
-#include <strstream>
-#endif
-
-#include "wx/window.h"
-#include "wx/utils.h"
-#include "wx/list.h"
-#include "wx/colordlg.h"
-#include "wx/proplist.h"
/*
* Property text edit control
wxString stringValueRepr(property->GetValue().GetStringRepresentation());
wxString paddedString(MakeNameValueString(property->GetName(), stringValueRepr));
- m_propertyScrollingList->Append(paddedString.GetData(), (char *)property);
+ m_propertyScrollingList->Append(paddedString.GetData(), (void *)property);
node = node->Next();
}
return TRUE;
bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
wxString s(view->GetValueList()->GetStringSelection());
- if (s != "")
+ if (s != _T(""))
{
view->GetValueText()->SetValue(s);
view->RetrieveProperty(property);
float val = 0.0;
if (!StringToFloat(WXSTRINGCAST value, &val))
{
- char buf[200];
- sprintf(buf, "Value %s is not a valid real number!", value.GetData());
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value %s is not a valid real number!"), value.GetData());
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (!view->GetValueText())
return FALSE;
- if (strlen(view->GetValueText()->GetValue()) == 0)
+ if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE;
wxString value(view->GetValueText()->GetValue());
- float f = (float)atof(value.GetData());
+ float f = (float)wxAtof(value.GetData());
property->GetValue() = f;
return TRUE;
}
long val = 0;
if (!StringToLong(WXSTRINGCAST value, &val))
{
- char buf[200];
- sprintf(buf, "Value %s is not a valid integer!", value.GetData());
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value %s is not a valid integer!"), value.GetData());
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (val < m_integerMin || val > m_integerMax)
{
- char buf[200];
- sprintf(buf, "Value must be an integer between %ld and %ld!", m_integerMin, m_integerMax);
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax);
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (!view->GetValueText())
return FALSE;
- if (strlen(view->GetValueText()->GetValue()) == 0)
+ if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE;
wxString value(view->GetValueText()->GetValue());
- long val = (long)atoi(value.GetData());
+ long val = (long)wxAtoi(value.GetData());
property->GetValue() = (long)val;
return TRUE;
}
if (!view->GetValueText())
return FALSE;
wxString value(view->GetValueText()->GetValue());
- if (value != "True" && value != "False")
+ if (value != _T("True") && value != _T("False"))
{
- wxMessageBox("Value must be True or False!", "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxMessageBox(_T("Value must be True or False!"), _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (!view->GetValueText())
return FALSE;
- if (strlen(view->GetValueText()->GetValue()) == 0)
+ if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE;
wxString value(view->GetValueText()->GetValue());
bool boolValue = FALSE;
- if (value == "True")
+ if (value == _T("True"))
boolValue = TRUE;
else
boolValue = FALSE;
view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE);
- view->GetValueList()->Append("True");
- view->GetValueList()->Append("False");
- char *currentString = copystring(view->GetValueText()->GetValue());
+ view->GetValueList()->Append(_T("True"));
+ view->GetValueList()->Append(_T("False"));
+ wxChar *currentString = copystring(view->GetValueText()->GetValue());
view->GetValueList()->SetStringSelection(currentString);
delete[] currentString;
}
wxNode *node = m_strings->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
view->GetValueList()->Append(s);
node = node->Next();
}
- char *currentString = property->GetValue().StringValue();
+ wxChar *currentString = property->GetValue().StringValue();
view->GetValueList()->SetStringSelection(currentString);
}
return TRUE;
return FALSE;
wxNode *node = m_strings->First();
- char *currentString = property->GetValue().StringValue();
+ wxChar *currentString = property->GetValue().StringValue();
while (node)
{
- char *s = (char *)node->Data();
- if (strcmp(s, currentString) == 0)
+ wxChar *s = (wxChar *)node->Data();
+ if (wxStrcmp(s, currentString) == 0)
{
- char *nextString = NULL;
+ wxChar *nextString = NULL;
if (node->Next())
- nextString = (char *)node->Next()->Data();
+ nextString = (wxChar *)node->Next()->Data();
else
- nextString = (char *)m_strings->First()->Data();
+ nextString = (wxChar *)m_strings->First()->Data();
property->GetValue() = wxString(nextString);
view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property);
m_filenameWildCard.GetData(),
0,
parentWindow);
- if (s != "")
+ if (s != _T(""))
{
property->GetValue() = s;
view->DisplayProperty(property);
if (!view->GetValueText())
return;
- char *s = property->GetValue().StringValue();
+ wxChar *s = property->GetValue().StringValue();
int r = 0;
int g = 0;
int b = 0;
wxColourData retData = dialog.GetColourData();
col = retData.GetColour();
- char buf[7];
+ wxChar buf[7];
wxDecToHex(col.Red(), buf);
wxDecToHex(col.Green(), buf+2);
wxDecToHex(col.Blue(), buf+4);
wxPropertyValue *expr = property->GetValue().GetFirst();
while (expr)
{
- char *s = expr->StringValue();
+ wxChar *s = expr->StringValue();
if (s)
stringList->Add(s);
expr = expr->GetNext();
}
- wxString title("Editing ");
+ wxString title(_T("Editing "));
title += property->GetName();
if (EditStringList(parentWindow, stringList, title.GetData()))
wxNode *node = stringList->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
oldValue.Append(new wxPropertyValue(s));
node = node->Next();
bool wxPropertyStringListEditorDialog::sm_dialogCancelled = FALSE;
// Edit the string list.
-bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList *stringList, const char *title)
+bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title)
{
int largeButtonWidth = 60;
int largeButtonHeight = 25;
return;
m_listBox->Delete(sel);
- delete[] (char *)node->Data();
+ delete[] (wxChar *)node->Data();
delete node;
m_currentSelection = -1;
m_stringText->SetValue("");
{
SaveCurrentSelection();
- char *initialText = "";
+ wxChar *initialText = _T("");
wxNode *node = m_stringList->Add(initialText);
- m_listBox->Append(initialText, (char *)node);
+ m_listBox->Append(initialText, (void *)node);
m_currentSelection = m_stringList->Number() - 1;
m_listBox->SetSelection(m_currentSelection);
ShowCurrentSelection();