From 823f75c7390e33299a2b5710cdab55a7ec9da2cc Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 3 Jul 2017 21:16:04 +0200 Subject: [PATCH] Enable selecting opacity in generic wxColourPicker This is implmentation of the feature which is already implemented in the native wxColourPicker under wxGTK. --- docs/changes.txt | 1 + interface/wx/clrpicker.h | 4 ++++ src/generic/clrpickerg.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index c75de4e0b2..a5c7193af4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -330,6 +330,7 @@ All (GUI): - Add support for the events from multimedia keys (Jens Göpfert). - Allow suppressing warnings from wxImage::LoadFile(). - Allow customizing wxRibbon highlight colours (wxBen). +- Enable selecting opacity in generic wxColourPicker. wxGTK: diff --git a/interface/wx/clrpicker.h b/interface/wx/clrpicker.h index 31b42b8ddc..176934c834 100644 --- a/interface/wx/clrpicker.h +++ b/interface/wx/clrpicker.h @@ -8,6 +8,7 @@ #define wxCLRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) #define wxCLRP_DEFAULT_STYLE 0 #define wxCLRP_SHOW_LABEL 0x0008 +#define wxCLRP_SHOW_ALPHA 0x0010 wxEventType wxEVT_COLOURPICKER_CHANGED; @@ -33,6 +34,9 @@ wxEventType wxEVT_COLOURPICKER_CHANGED; @style{wxCLRP_SHOW_LABEL} Shows the colour in HTML form (AABBCC) as colour button label (instead of no label at all). + @style{wxCLRP_SHOW_ALPHA} + Allows to select opacity in the colour-chooser (effective under + wxGTK and wxOSX). @endStyleTable @beginEventEmissionTable{wxColourPickerEvent} diff --git a/src/generic/clrpickerg.cpp b/src/generic/clrpickerg.cpp index e7df508057..6eff895c8d 100644 --- a/src/generic/clrpickerg.cpp +++ b/src/generic/clrpickerg.cpp @@ -64,6 +64,7 @@ bool wxGenericColourButton::Create( wxWindow *parent, wxWindowID id, m_colour = col; UpdateColour(); InitColourData(); + ms_data.SetChooseAlpha(style & wxCLRP_SHOW_ALPHA); return true; }