projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove workaround
[wxWidgets.git]
/
src
/
motif
/
combobox.cpp
diff --git
a/src/motif/combobox.cpp
b/src/motif/combobox.cpp
index 099cc58604a8f0db4071ba8041705c2eef785835..83dac29f7f70897d259716e8c147c7781dbd0711 100644
(file)
--- a/
src/motif/combobox.cpp
+++ b/
src/motif/combobox.cpp
@@
-53,8
+53,6
@@
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
return false;
PreCreation();
return false;
PreCreation();
- m_noStrings = n;
-
Widget parentWidget = (Widget) parent->GetClientWidget();
Widget buttonWidget = XtVaCreateManagedWidget(name.c_str(),
Widget parentWidget = (Widget) parent->GetClientWidget();
Widget buttonWidget = XtVaCreateManagedWidget(name.c_str(),
@@
-72,7
+70,7
@@
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
{
wxXmString str( choices[i] );
XmComboBoxAddItem(buttonWidget, str(), 0);
{
wxXmString str( choices[i] );
XmComboBoxAddItem(buttonWidget, str(), 0);
- m_string
List
.Add(choices[i]);
+ m_string
Array
.Add(choices[i]);
}
m_mainWidget = (Widget) buttonWidget;
}
m_mainWidget = (Widget) buttonWidget;
@@
-121,6
+119,8
@@
void wxComboBox::DoSetSize(int x, int y,
wxWindow::DoSetSize(x, y, width, DoGetBestSize().y, sizeFlags);
}
wxWindow::DoSetSize(x, y, width, DoGetBestSize().y, sizeFlags);
}
+#if 0
+// Already defined in include/motif/combobox.h
wxString wxComboBox::GetValue() const
{
char *s = XmComboBoxGetString ((Widget) m_mainWidget);
wxString wxComboBox::GetValue() const
{
char *s = XmComboBoxGetString ((Widget) m_mainWidget);
@@
-133,6
+133,7
@@
wxString wxComboBox::GetValue() const
else
return wxEmptyString;
}
else
return wxEmptyString;
}
+#endif
void wxComboBox::SetValue(const wxString& value)
{
void wxComboBox::SetValue(const wxString& value)
{
@@
-162,9
+163,7
@@
int wxComboBox::DoInsertItems(const wxArrayStringsAdapter& items,
{
wxXmString str( items[i].c_str() );
XmComboBoxAddItem((Widget) m_mainWidget, str(), GetMotifPosition(pos));
{
wxXmString str( items[i].c_str() );
XmComboBoxAddItem((Widget) m_mainWidget, str(), GetMotifPosition(pos));
- wxChar* copy = wxStrcpy(new wxChar[items[i].length() + 1], items[i].c_str());
- m_stringList.Insert(pos, copy);
- m_noStrings ++;
+ m_stringArray.Insert(items[i], pos);
InsertNewItemClientData(pos, clientData, i, type);
}
InsertNewItemClientData(pos, clientData, i, type);
}
@@
-174,23
+173,16
@@
int wxComboBox::DoInsertItems(const wxArrayStringsAdapter& items,
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
- wxStringList::Node *node = m_stringList.Item(n);
- if (node)
- {
- delete[] node->GetData();
- delete node;
- }
+ m_stringArray.RemoveAt(n);
wxControlWithItems::DoDeleteOneItem(n);
wxControlWithItems::DoDeleteOneItem(n);
- m_noStrings--;
}
}
-void wxComboBox::
Do
Clear()
+void wxComboBox::Clear()
{
XmComboBoxDeleteAllItems((Widget) m_mainWidget);
{
XmComboBoxDeleteAllItems((Widget) m_mainWidget);
- m_string
List
.Clear();
+ m_string
Array
.Clear();
wxControlWithItems::DoClear();
wxControlWithItems::DoClear();
- m_noStrings = 0;
}
void wxComboBox::SetSelection (int n)
}
void wxComboBox::SetSelection (int n)
@@
-209,11
+201,7
@@
int wxComboBox::GetSelection (void) const
wxString wxComboBox::GetString(unsigned int n) const
{
wxString wxComboBox::GetString(unsigned int n) const
{
- wxStringList::Node *node = m_stringList.Item(n);
- if (node)
- return wxString(node->GetData ());
- else
- return wxEmptyString;
+ return m_stringArray[n];
}
int wxComboBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const
}
int wxComboBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const