// logical as the text does change)
case CBN_EDITCHANGE:
+ if ( m_allowTextEvents )
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
WXHWND wxComboBox::GetEditHWNDIfAvailable() const
{
- // we assume that the only child of the combobox is the edit window so it's
- // unnecessary to pass "EDIT" as class name parameter
- return (WXHWND)::FindWindowEx(GetHwnd(), NULL, NULL, NULL);
+ // notice that a slightly safer alternative could be to use FindWindowEx()
+ // but it's not available under WinCE so just take the first child for now
+ // to keep one version of the code for all platforms and fix it later if
+ // problems are discovered
+
+ // we assume that the only child of the combobox is the edit window
+ return (WXHWND)::GetWindow(GetHwnd(), GW_CHILD);
}
WXHWND wxComboBox::GetEditHWND() const
void wxComboBox::OnDelete(wxCommandEvent& WXUNUSED(event))
{
- long from, to;
- GetSelection(& from, & to);
- if (from != -1 && to != -1)
- Remove(from, to);
+ RemoveSelection();
}
void wxComboBox::OnSelectAll(wxCommandEvent& WXUNUSED(event))
{
- SetSelection(-1, -1);
+ SelectAll();
}
void wxComboBox::OnUpdateCut(wxUpdateUIEvent& event)
void wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event)
{
- event.Enable(IsEditable() && GetLastPosition() > 0);
+ event.Enable(IsEditable() && !wxTextEntry::IsEmpty());
}
#if wxUSE_TOOLTIPS