From 858102d740aa2d0644f040b64c7078de8d19a240 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sat, 11 Jul 2009 07:29:42 +0000 Subject: [PATCH] Fixed 'Custom' entry in the colour property combo boxes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/advprops.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 9dc5a203c7..2bb5d600bc 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -1242,9 +1242,24 @@ bool wxSystemColourProperty::IntToValue( wxVariant& variant, int number, int WXU } // Need to do some extra event handling. -bool wxSystemColourProperty::OnEvent( wxPropertyGrid* propgrid, wxWindow* WXUNUSED(primary), wxEvent& event ) +bool wxSystemColourProperty::OnEvent( wxPropertyGrid* propgrid, + wxWindow* WXUNUSED(primary), + wxEvent& event ) { + bool askColour = false; + if ( propgrid->IsMainButtonEvent(event) ) + { + askColour = true; + } + else if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED ) + { + if ( GetIndex() == GetCustomColourIndex() && + !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) ) + askColour = true; + } + + if ( askColour ) { // We need to handle button click in case editor has been // switched to one that has wxButton as well. -- 2.45.2