IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
#endif
-bool wxComboBox::MSWCommand(const WXUINT param, const WXWORD WXUNUSED(id))
+bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
if (param == CBN_SELCHANGE)
{
- wxCommandEvent event(wxEVENT_TYPE_COMBOBOX_COMMAND, m_windowId);
+ wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId);
event.SetInt(GetSelection());
event.SetEventObject(this);
event.SetString(copystring(GetStringSelection()));
delete[] event.GetString();
return TRUE;
}
+ else if (param == CBN_EDITCHANGE)
+ {
+ wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
+ event.SetString(copystring(GetValue()));
+ event.SetEventObject(this);
+ ProcessCommand(event);
+ delete[] event.GetString();
+ return TRUE;
+ }
else return FALSE;
}
-bool wxComboBox::Create(wxWindow *parent, const wxWindowID id,
+bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
- const int n, const wxString choices[],
- const long style,
+ int n, const wxString choices[],
+ long style,
const wxValidator& validator,
const wxString& name)
{
if (parent) parent->AddChild(this);
SetBackgroundColour(parent->GetDefaultBackgroundColour()) ;
SetForegroundColour(parent->GetDefaultForegroundColour()) ;
- no_strings = n;
+ m_noStrings = n;
m_windowStyle = style;
SendMessage(hWnd, WM_PASTE, 0, 0L);
}
-void wxComboBox::SetEditable(const bool editable)
+void wxComboBox::SetEditable(bool editable)
{
// Can't implement in MSW?
// HWND hWnd = (HWND) GetHWND();
// SendMessage(hWnd, EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L);
}
-void wxComboBox::SetInsertionPoint(const long pos)
+void wxComboBox::SetInsertionPoint(long pos)
{
/*
HWND hWnd = (HWND) GetHWND();
return 0;
}
-void wxComboBox::Replace(const long from, const long to, const wxString& value)
+void wxComboBox::Replace(long from, long to, const wxString& value)
{
#if USE_CLIPBOARD
HWND hWnd = (HWND) GetHWND();
SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
// Now replace with 'value', by pasting.
- wxSetClipboardData(wxCF_TEXT, (wxObject *)(const char *)value, 0, 0);
+ wxSetClipboardData(wxDF_TEXT, (wxObject *)(const char *)value, 0, 0);
// Paste into edit control
SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);
#endif
}
-void wxComboBox::Remove(const long from, const long to)
+void wxComboBox::Remove(long from, long to)
{
HWND hWnd = (HWND) GetHWND();
long fromChar = from;
SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
}
-void wxComboBox::SetSelection(const long from, const long to)
+void wxComboBox::SetSelection(long from, long to)
{
HWND hWnd = (HWND) GetHWND();
long fromChar = from;