wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h")
wxBEGIN_PROPERTIES_TABLE(wxComboBox)
IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h")
wxBEGIN_PROPERTIES_TABLE(wxComboBox)
- wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( Value ,wxString, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Value ,wxString, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxComboBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
wxPROPERTY_FLAGS( WindowStyle , wxComboBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
- value = GetString(sel);
+ m_selectionOld = sel;
+
+ // GetValue() would still return the old value from here but
+ // according to the docs we should return the new value if the
+ // user calls it in his event handler, so update internal
+ // m_value
+ m_value = GetString(sel);
wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
event.SetInt(sel);
event.SetEventObject(this);
wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
event.SetInt(sel);
event.SetEventObject(this);
- // We need to retrieve the current selection because the user
- // may have changed it in the previous handler (for CBN_SELCHANGE
- // above).
+ // We need to retrieve the current selection because the
+ // user may have changed it in the previous handler (for
+ // CBN_SELCHANGE above).
// pretend that wxComboBox is hidden while it is positioned and resized and
// show it only right before leaving this method because otherwise there is
// some noticeable flicker while the control rearranges itself
// pretend that wxComboBox is hidden while it is positioned and resized and
// show it only right before leaving this method because otherwise there is
// some noticeable flicker while the control rearranges itself
if ( !CreateAndInit(parent, id, pos, size, n, choices, style,
validator, name) )
if ( !CreateAndInit(parent, id, pos, size, n, choices, style,
validator, name) )
// we shouldn't call SetValue() for an empty string because this would
// (correctly) result in an assert with a read only combobox and is useless
// we shouldn't call SetValue() for an empty string because this would
// (correctly) result in an assert with a read only combobox and is useless
SetStringSelection(value);
else
SetWindowText(GetHwnd(), value.c_str());
SetStringSelection(value);
else
SetWindowText(GetHwnd(), value.c_str());