Enable selecting opacity in generic wxColourPicker

This is implmentation of the feature which is already implemented in
the native wxColourPicker under wxGTK.
This commit is contained in:
Artur Wieczorek
2017-07-03 21:16:04 +02:00
parent a29815e19a
commit 823f75c739
3 changed files with 6 additions and 0 deletions

View File

@@ -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:

View File

@@ -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}

View File

@@ -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;
}