void OnLeftUp(wxMouseEvent& event);
private:
+ friend class wxComboBox; // it accesses our DoGetItemClientData()
+
DECLARE_EVENT_TABLE()
};
wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId());
evt.SetInt(wxListBox::GetSelection());
evt.SetEventObject(m_combo);
- m_combo->ProcessEvent(evt);
+ m_combo->ProcessWindowEvent(evt);
event.Skip();
}
void wxComboBox::Init()
{
- m_lbox = (wxListBox *)NULL;
+ m_lbox = NULL;
}
wxComboBox::wxComboBox(wxWindow *parent,
// wxComboBox methods forwarded to wxTextCtrl
// ----------------------------------------------------------------------------
-wxString wxComboBox::GetValue() const
+wxString wxComboBox::DoGetValue() const
{
return wxComboCtrl::GetValue();
}
wxComboCtrl::SetValue(value);
}
+void wxComboBox::WriteText(const wxString& value)
+{
+ if ( GetTextCtrl() ) GetTextCtrl()->WriteText(value);
+}
+
void wxComboBox::Copy()
{
if ( GetTextCtrl() ) GetTextCtrl()->Copy();
if ( GetTextCtrl() ) GetTextCtrl()->SetSelection(from, to);
}
+void wxComboBox::GetSelection(long *from, long *to) const
+{
+ if ( GetTextCtrl() ) GetTextCtrl()->GetSelection(from, to);
+}
+
void wxComboBox::SetEditable(bool editable)
{
if ( GetTextCtrl() ) GetTextCtrl()->SetEditable(editable);
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::Delete") );
if (GetSelection() == (int)n)
if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString);
wxString wxComboBox::GetString(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxComboBox::GetString") );
+ wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("invalid index in wxComboBox::GetString") );
return GetLBox()->GetString(n);
}
void wxComboBox::SetString(unsigned int n, const wxString& s)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::SetString") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::SetString") );
GetLBox()->SetString(n, s);
}
void wxComboBox::SetSelection(int n)
{
- wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") );
+ wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), wxT("invalid index in wxComboBox::Select") );
GetLBox()->SetSelection(n);
#endif
}
+wxString wxComboBox::GetStringSelection() const
+{
+ return GetLBox()->GetStringSelection();
+}
+
+wxClientDataType wxComboBox::GetClientDataType() const
+{
+ return GetLBox()->GetClientDataType();
+}
+
+void wxComboBox::SetClientDataType(wxClientDataType clientDataItemsType)
+{
+ GetLBox()->SetClientDataType(clientDataItemsType);
+}
+
int wxComboBox::DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData, wxClientDataType type)
void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
{
- GetLBox()->SetClientData(n, clientData);
+ GetLBox()->DoSetItemClientData(n, clientData);
}
void *wxComboBox::DoGetItemClientData(unsigned int n) const
{
- return GetLBox()->GetClientData(n);
+ return GetLBox()->DoGetItemClientData(n);
}
bool wxComboBox::IsEditable() const