Modify widgets sample to demonstrate colour picker with alpha support.
This commit is contained in:
committed by
Artur Wieczorek
parent
59f5fe993b
commit
b81e842689
@@ -98,7 +98,8 @@ protected:
|
|||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
wxCheckBox *m_chkColourTextCtrl,
|
wxCheckBox *m_chkColourTextCtrl,
|
||||||
*m_chkColourShowLabel;
|
*m_chkColourShowLabel,
|
||||||
|
*m_chkColourShowAlpha;
|
||||||
wxBoxSizer *m_sizer;
|
wxBoxSizer *m_sizer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -145,6 +146,7 @@ void ColourPickerWidgetsPage::CreateContent()
|
|||||||
wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style"));
|
wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style"));
|
||||||
m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl"));
|
m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl"));
|
||||||
m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label"));
|
m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label"));
|
||||||
|
m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, wxT("With opacity"));
|
||||||
boxleft->Add(clrbox, 0, wxALL|wxGROW, 5);
|
boxleft->Add(clrbox, 0, wxALL|wxGROW, 5);
|
||||||
|
|
||||||
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
|
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
|
||||||
@@ -189,6 +191,9 @@ long ColourPickerWidgetsPage::GetPickerStyle()
|
|||||||
if ( m_chkColourShowLabel->GetValue() )
|
if ( m_chkColourShowLabel->GetValue() )
|
||||||
style |= wxCLRP_SHOW_LABEL;
|
style |= wxCLRP_SHOW_LABEL;
|
||||||
|
|
||||||
|
if ( m_chkColourShowAlpha->GetValue() )
|
||||||
|
style |= wxCLRP_SHOW_ALPHA;
|
||||||
|
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +232,8 @@ void ColourPickerWidgetsPage::OnColourChange(wxColourPickerEvent& event)
|
|||||||
void ColourPickerWidgetsPage::OnCheckBox(wxCommandEvent &event)
|
void ColourPickerWidgetsPage::OnCheckBox(wxCommandEvent &event)
|
||||||
{
|
{
|
||||||
if (event.GetEventObject() == m_chkColourTextCtrl ||
|
if (event.GetEventObject() == m_chkColourTextCtrl ||
|
||||||
event.GetEventObject() == m_chkColourShowLabel)
|
event.GetEventObject() == m_chkColourShowLabel ||
|
||||||
|
event.GetEventObject() == m_chkColourShowAlpha)
|
||||||
RecreatePicker();
|
RecreatePicker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user