12DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
DIALOG_SHIM( parent, id, title, pos, size, style )
14 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
16 wxBoxSizer* bSizerMain;
17 bSizerMain =
new wxBoxSizer( wxVERTICAL );
19 wxBoxSizer* bSizerUpperMain;
20 bSizerUpperMain =
new wxBoxSizer( wxHORIZONTAL );
22 m_notebook =
new wxNotebook(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
24 wxBoxSizer* bSizerUpperFreeColors;
25 bSizerUpperFreeColors =
new wxBoxSizer( wxVERTICAL );
27 wxBoxSizer* bSizerPanels;
28 bSizerPanels =
new wxBoxSizer( wxHORIZONTAL );
30 wxStaticBoxSizer* sbSizerViewRGB;
31 sbSizerViewRGB =
new wxStaticBoxSizer(
new wxStaticBox(
m_panelFreeColors, wxID_ANY,
_(
"RGB") ), wxVERTICAL );
33 m_RgbBitmap =
new wxStaticBitmap( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
36 sbSizerViewRGB->Add(
m_RgbBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 5 );
39 sbSizerViewRGB->Add( 0, 0, 1, wxEXPAND, 5 );
41 wxFlexGridSizer* fgSizerRGB;
42 fgSizerRGB =
new wxFlexGridSizer( 0, 3, 0, 0 );
43 fgSizerRGB->AddGrowableCol( 0 );
44 fgSizerRGB->AddGrowableCol( 1 );
45 fgSizerRGB->AddGrowableCol( 2 );
46 fgSizerRGB->SetFlexibleDirection( wxBOTH );
47 fgSizerRGB->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
49 m_staticTextR =
new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY,
_(
"Red:"), wxDefaultPosition, wxDefaultSize, 0 );
53 m_staticTextG =
new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY,
_(
"Green:"), wxDefaultPosition, wxDefaultSize, 0 );
57 m_staticTextB =
new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY,
_(
"Blue:"), wxDefaultPosition, wxDefaultSize, 0 );
61 m_spinCtrlRed =
new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
62 fgSizerRGB->Add(
m_spinCtrlRed, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
64 m_spinCtrlGreen =
new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
65 fgSizerRGB->Add(
m_spinCtrlGreen, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
67 m_spinCtrlBlue =
new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
68 fgSizerRGB->Add(
m_spinCtrlBlue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
71 sbSizerViewRGB->Add( fgSizerRGB, 0, wxEXPAND, 5 );
74 bSizerPanels->Add( sbSizerViewRGB, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
76 wxStaticBoxSizer* sbSizerViewHSV;
77 sbSizerViewHSV =
new wxStaticBoxSizer(
new wxStaticBox(
m_panelFreeColors, wxID_ANY,
_(
"HSV") ), wxVERTICAL );
79 m_HsvBitmap =
new wxStaticBitmap( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
82 sbSizerViewHSV->Add(
m_HsvBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 5 );
85 sbSizerViewHSV->Add( 0, 0, 1, wxEXPAND, 5 );
87 wxFlexGridSizer* fgSizerHSV;
88 fgSizerHSV =
new wxFlexGridSizer( 0, 2, 0, 0 );
89 fgSizerHSV->AddGrowableCol( 0 );
90 fgSizerHSV->AddGrowableCol( 1 );
91 fgSizerHSV->SetFlexibleDirection( wxBOTH );
92 fgSizerHSV->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
94 m_staticTextHue =
new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY,
_(
"Hue:"), wxDefaultPosition, wxDefaultSize, 0 );
98 m_staticTextSat =
new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY,
_(
"Saturation:"), wxDefaultPosition, wxDefaultSize, 0 );
102 m_spinCtrlHue =
new wxSpinCtrl( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 );
103 fgSizerHSV->Add(
m_spinCtrlHue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
105 m_spinCtrlSaturation =
new wxSpinCtrl( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
109 sbSizerViewHSV->Add( fgSizerHSV, 0, wxEXPAND, 5 );
112 bSizerPanels->Add( sbSizerViewHSV, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
114 wxBoxSizer* bSizerBright;
115 bSizerBright =
new wxBoxSizer( wxVERTICAL );
122 bSizerBright->Add(
m_sliderBrightness, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5 );
125 bSizerPanels->Add( bSizerBright, 0, wxALL|wxEXPAND, 5 );
128 bSizerUpperFreeColors->Add( bSizerPanels, 1, wxEXPAND, 5 );
145 m_fgridColor->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
156 bSizerUpperMain->Add(
m_notebook, 1, wxEXPAND | wxALL, 5 );
163 m_opacityLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Opacity:"), wxDefaultPosition, wxDefaultSize, 0 );
167 m_sliderTransparency =
new wxSlider(
this, wxID_ANY, 80, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
174 bSizerMain->Add( bSizerUpperMain, 1, wxEXPAND, 5 );
176 wxBoxSizer* bButtonsSizer;
177 bButtonsSizer =
new wxBoxSizer( wxHORIZONTAL );
179 m_staticTextOldColor =
new wxStaticText(
this, wxID_ANY,
_(
"Preview (old/new):"), wxDefaultPosition, wxDefaultSize, 0 );
181 bButtonsSizer->Add(
m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
183 m_OldColorRect =
new wxStaticBitmap(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
186 bButtonsSizer->Add(
m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 5 );
188 m_NewColorRect =
new wxStaticBitmap(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
191 bButtonsSizer->Add(
m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 5 );
193 m_colorValue =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
196 bButtonsSizer->Add(
m_colorValue, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
199 bButtonsSizer->Add( 20, 0, 0, wxEXPAND, 5 );
201 m_resetToDefault =
new wxButton(
this, wxID_ANY,
_(
"Reset to Default"), wxDefaultPosition, wxDefaultSize, 0 );
202 bButtonsSizer->Add(
m_resetToDefault, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
211 bButtonsSizer->Add(
m_sdbSizer, 1, wxALL, 5 );
214 bSizerMain->Add( bButtonsSizer, 0, wxEXPAND|wxLEFT, 10 );
217 this->SetSizer( bSizerMain );
219 bSizerMain->Fit(
this );
221 this->Centre( wxBOTH );
virtual void onSize(wxSizeEvent &event)
DIALOG_COLOR_PICKER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Color Picker"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxSpinCtrl * m_spinCtrlRed
wxStaticText * m_opacityLabel
virtual void onRGBMouseDrag(wxMouseEvent &event)
virtual void OnChangeEditBlue(wxSpinEvent &event)
wxPanel * m_panelFreeColors
virtual void OnColorValueText(wxCommandEvent &event)
virtual void onHSVMouseClick(wxMouseEvent &event)
virtual void OnChangeEditSat(wxSpinEvent &event)
wxSpinCtrl * m_spinCtrlHue
virtual void OnResetButton(wxCommandEvent &event)
wxStaticBitmap * m_NewColorRect
wxSpinCtrl * m_spinCtrlBlue
wxBoxSizer * m_SizerTransparency
virtual void OnChangeEditRed(wxSpinEvent &event)
wxStaticBitmap * m_RgbBitmap
wxStaticText * m_staticTextSat
wxStaticText * m_staticTextBright
wxSlider * m_sliderBrightness
wxStaticText * m_staticTextR
wxStaticText * m_staticTextB
wxBoxSizer * m_SizerDefinedColors
virtual void OnChangeEditGreen(wxSpinEvent &event)
virtual void OnChangeEditHue(wxSpinEvent &event)
wxSlider * m_sliderTransparency
wxStdDialogButtonSizer * m_sdbSizer
wxStaticText * m_staticTextG
wxStaticText * m_staticTextOldColor
virtual void onRGBMouseClick(wxMouseEvent &event)
wxTextCtrl * m_colorValue
wxStaticBitmap * m_HsvBitmap
virtual void onHSVMouseDrag(wxMouseEvent &event)
wxPanel * m_panelDefinedColors
wxButton * m_sdbSizerCancel
wxStaticBitmap * m_OldColorRect
wxSpinCtrl * m_spinCtrlSaturation
wxButton * m_resetToDefault
wxFlexGridSizer * m_fgridColor
wxSpinCtrl * m_spinCtrlGreen
virtual void OnChangeAlpha(wxScrollEvent &event)
virtual void OnChangeBrightness(wxScrollEvent &event)
~DIALOG_COLOR_PICKER_BASE()
wxStaticText * m_staticTextHue
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...