Fix manual selection of custom colour item for wxColourProperty and wxSystemColourProperty in wxPG.

If keyword 'custom' is entered into the edit field of wxColourProperty or wxSystemColourProperty (with wxPGEditor_ComboBox) then dialog box to query for custom colour should be invoked. Afterwards, when control value is updated, its selection index should be also updated respectively.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2014-09-20 19:46:25 +00:00
parent fe7301b6b0
commit a3611b8190
2 changed files with 7 additions and 10 deletions

View File

@@ -1228,11 +1228,11 @@ WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(ComboBox,
void wxPGComboBoxEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const
{
wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
const int index = property->GetChoiceSelection();
wxString s = property->GetValueAsString(wxPG_EDITABLE_VALUE);
cb->SetSelection(index);
property->GetGrid()->SetupTextCtrlValue(s);
cb->SetValue(s);
// TODO: If string matches any selection, then select that.
}