From e18d66b9b587975faef1f68343b836e801821cd2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 May 2014 16:34:31 +0000 Subject: [PATCH] Fix cancelling choice of custom colour in wxPropertyGrid. When using wxPGEditor_Choice colour property, cancelling the choice of the custom colour reset the previously selected custom colour. Fix this by correcting the test for the custom colour which didn't work before. Closes #15542. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/propgrid/advprops.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index eb0258d46b..a84b84d884 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -605,6 +605,7 @@ All (GUI): - Fix dragging columns in wxGrid when some of them are hidden (Artur Wieczorek). - Fix selecting elements from wxPropertyGrid enum properties (Artur Wieczorek). - Don't show the dialog twice for colours in wxPropertyGrid (Artur Wieczorek). +- Fix handling of custom colours in wxPropertyGrid choices (Artur Wieczorek). wxGTK: diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 5aabb0cbfb..784dba57dc 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -1261,7 +1261,7 @@ bool wxSystemColourProperty::IntToValue( wxVariant& variant, int number, int arg int index = number; int type = m_choices.GetValue(index); - if ( type == wxPG_COLOUR_CUSTOM ) + if ( m_choices.GetLabel(index) == _("Custom") ) { if ( !(argFlags & wxPG_PROPERTY_SPECIFIC) ) return QueryColourFromUser(variant);