From c5781105eeb79ed13da3b088b369e7f1c7b98759 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 16 Aug 2018 01:02:26 +0100 Subject: [PATCH] Fix layout and grouping issues in color picker. --- common/widgets/color4Dpickerdlg.cpp | 11 +- common/widgets/color4Dpickerdlg_base.cpp | 209 ++- common/widgets/color4Dpickerdlg_base.fbp | 1771 ++++++++++------------ common/widgets/color4Dpickerdlg_base.h | 29 +- common/widgets/color_swatch.cpp | 2 +- 5 files changed, 909 insertions(+), 1113 deletions(-) diff --git a/common/widgets/color4Dpickerdlg.cpp b/common/widgets/color4Dpickerdlg.cpp index d077921ab2..e3e490d6a3 100644 --- a/common/widgets/color4Dpickerdlg.cpp +++ b/common/widgets/color4Dpickerdlg.cpp @@ -28,14 +28,13 @@ COLOR4D_PICKER_DLG::COLOR4D_PICKER_DLG( wxWindow* aParent, KIGFX::COLOR4D& aCurr m_newColor4D.a = 1.0; } - m_notebook->SetSelection( m_ActivePage ); + if( m_ActivePage >= 0 ) + m_notebook->SetSelection( (unsigned) m_ActivePage ); // Build the defined colors panel: initDefinedColors(); m_sdbSizerOK->SetDefault(); - - FinishDialogSettings(); } int COLOR4D_PICKER_DLG::m_ActivePage = 0; // the active notebook page, stored during a session @@ -115,9 +114,11 @@ bool COLOR4D_PICKER_DLG::TransferDataToWindow() SetEditVals( ALL_CHANGED ); drawAll(); - // Now the bitmaps are built, fix the minsizes: - GetSizer()->SetSizeHints( this ); + m_notebook->GetPage( 0 )->Layout(); + m_notebook->GetPage( 1 )->Layout(); + FinishDialogSettings(); + return true; } diff --git a/common/widgets/color4Dpickerdlg_base.cpp b/common/widgets/color4Dpickerdlg_base.cpp index 58bcecf125..10d84795c0 100644 --- a/common/widgets/color4Dpickerdlg_base.cpp +++ b/common/widgets/color4Dpickerdlg_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 4 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "color4Dpickerdlg_base.h" @@ -30,59 +30,11 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i wxStaticBoxSizer* sbSizerViewRGB; sbSizerViewRGB = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("RGB") ), wxVERTICAL ); - - sbSizerViewRGB->Add( 0, 0, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_RgbBitmap = new wxStaticBitmap( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 ); m_RgbBitmap->SetMinSize( wxSize( 264,264 ) ); sbSizerViewRGB->Add( m_RgbBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - sbSizerViewRGB->Add( 0, 0, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerPanels->Add( sbSizerViewRGB, 1, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); - - wxStaticBoxSizer* sbSizerViewHSV; - sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("Hue and Saturation") ), wxVERTICAL ); - - - sbSizerViewHSV->Add( 0, 0, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_HsvBitmap = new wxStaticBitmap( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 ); - m_HsvBitmap->SetMinSize( wxSize( 264,264 ) ); - - sbSizerViewHSV->Add( m_HsvBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - sbSizerViewHSV->Add( 0, 0, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerPanels->Add( sbSizerViewHSV, 1, wxEXPAND|wxBOTTOM, 5 ); - - wxBoxSizer* bSizerBright; - bSizerBright = new wxBoxSizer( wxVERTICAL ); - - m_staticTextBright = new wxStaticText( m_panelFreeColors, wxID_ANY, wxT("Value"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextBright->Wrap( -1 ); - bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_sliderBrightness = new wxSlider( m_panelFreeColors, wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL ); - bSizerBright->Add( m_sliderBrightness, 1, wxALL, 5 ); - - - bSizerPanels->Add( bSizerBright, 0, wxEXPAND, 5 ); - - - bSizerUpperFreeColors->Add( bSizerPanels, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizerLowerFreeColors; - bSizerLowerFreeColors = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBoxSizer* sbSizerSetRGB; - sbSizerSetRGB = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("RGB Values") ), wxHORIZONTAL ); - wxFlexGridSizer* fgSizerRGB; fgSizerRGB = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizerRGB->AddGrowableCol( 0 ); @@ -91,41 +43,49 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i fgSizerRGB->SetFlexibleDirection( wxBOTH ); fgSizerRGB->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextR = new wxStaticText( sbSizerSetRGB->GetStaticBox(), wxID_ANY, wxT("Red"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextR = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxT("Red:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextR->Wrap( -1 ); fgSizerRGB->Add( m_staticTextR, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticTextG = new wxStaticText( sbSizerSetRGB->GetStaticBox(), wxID_ANY, wxT("Green"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextG = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxT("Green:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextG->Wrap( -1 ); fgSizerRGB->Add( m_staticTextG, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticTextB = new wxStaticText( sbSizerSetRGB->GetStaticBox(), wxID_ANY, wxT("Blue"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextB = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxT("Blue:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextB->Wrap( -1 ); fgSizerRGB->Add( m_staticTextB, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_spinCtrlRed = new wxSpinCtrl( sbSizerSetRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); + m_spinCtrlRed = new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); m_spinCtrlRed->SetMinSize( wxSize( 80,-1 ) ); - fgSizerRGB->Add( m_spinCtrlRed, 0, wxALL|wxEXPAND, 5 ); + fgSizerRGB->Add( m_spinCtrlRed, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_spinCtrlGreen = new wxSpinCtrl( sbSizerSetRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); + m_spinCtrlGreen = new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); m_spinCtrlGreen->SetMinSize( wxSize( 80,-1 ) ); - fgSizerRGB->Add( m_spinCtrlGreen, 0, wxALL|wxEXPAND, 5 ); + fgSizerRGB->Add( m_spinCtrlGreen, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_spinCtrlBlue = new wxSpinCtrl( sbSizerSetRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); + m_spinCtrlBlue = new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); m_spinCtrlBlue->SetMinSize( wxSize( 80,-1 ) ); - fgSizerRGB->Add( m_spinCtrlBlue, 0, wxALL|wxEXPAND, 5 ); + fgSizerRGB->Add( m_spinCtrlBlue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - sbSizerSetRGB->Add( fgSizerRGB, 1, wxEXPAND, 5 ); + sbSizerViewRGB->Add( fgSizerRGB, 0, wxEXPAND, 5 ); - bSizerLowerFreeColors->Add( sbSizerSetRGB, 1, wxEXPAND, 5 ); + bSizerPanels->Add( sbSizerViewRGB, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - wxStaticBoxSizer* sbSizerSetHSV; - sbSizerSetHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("HS Values") ), wxHORIZONTAL ); + wxStaticBoxSizer* sbSizerViewHSV; + sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("HSV") ), wxHORIZONTAL ); + + wxBoxSizer* bSizer10; + bSizer10 = new wxBoxSizer( wxVERTICAL ); + + m_HsvBitmap = new wxStaticBitmap( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 ); + m_HsvBitmap->SetMinSize( wxSize( 264,264 ) ); + + bSizer10->Add( m_HsvBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); wxFlexGridSizer* fgSizerHSV; fgSizerHSV = new wxFlexGridSizer( 0, 2, 0, 0 ); @@ -134,32 +94,48 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i fgSizerHSV->SetFlexibleDirection( wxBOTH ); fgSizerHSV->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextHue = new wxStaticText( sbSizerSetHSV->GetStaticBox(), wxID_ANY, wxT("Hue"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextHue = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxT("Hue:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextHue->Wrap( -1 ); fgSizerHSV->Add( m_staticTextHue, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticTextSat = new wxStaticText( sbSizerSetHSV->GetStaticBox(), wxID_ANY, wxT("Saturation"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSat = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxT("Saturation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextSat->Wrap( -1 ); fgSizerHSV->Add( m_staticTextSat, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_spinCtrlHue = new wxSpinCtrl( sbSizerSetHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + m_spinCtrlHue = new wxSpinCtrl( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); m_spinCtrlHue->SetMinSize( wxSize( 80,-1 ) ); - fgSizerHSV->Add( m_spinCtrlHue, 0, wxALL|wxEXPAND, 5 ); + fgSizerHSV->Add( m_spinCtrlHue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_spinCtrlSaturation = new wxSpinCtrl( sbSizerSetHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); + m_spinCtrlSaturation = new wxSpinCtrl( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 ); m_spinCtrlSaturation->SetMinSize( wxSize( 80,-1 ) ); - fgSizerHSV->Add( m_spinCtrlSaturation, 0, wxALL|wxEXPAND, 5 ); + fgSizerHSV->Add( m_spinCtrlSaturation, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - sbSizerSetHSV->Add( fgSizerHSV, 1, wxEXPAND, 5 ); + bSizer10->Add( fgSizerHSV, 0, wxEXPAND, 5 ); - bSizerLowerFreeColors->Add( sbSizerSetHSV, 1, wxEXPAND, 5 ); + sbSizerViewHSV->Add( bSizer10, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizerBright; + bSizerBright = new wxBoxSizer( wxVERTICAL ); + + m_staticTextBright = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxT("Value:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextBright->Wrap( -1 ); + bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_sliderBrightness = new wxSlider( sbSizerViewHSV->GetStaticBox(), wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL ); + bSizerBright->Add( m_sliderBrightness, 1, wxTOP|wxRIGHT, 5 ); - bSizerUpperFreeColors->Add( bSizerLowerFreeColors, 0, wxEXPAND, 5 ); + sbSizerViewHSV->Add( bSizerBright, 0, wxEXPAND, 5 ); + + + bSizerPanels->Add( sbSizerViewHSV, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); + + + bSizerUpperFreeColors->Add( bSizerPanels, 1, wxEXPAND, 5 ); m_panelFreeColors->SetSizer( bSizerUpperFreeColors ); @@ -169,9 +145,6 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_panelDefinedColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_SizerDefinedColors = new wxBoxSizer( wxVERTICAL ); - - m_SizerDefinedColors->Add( 0, 0, 1, wxEXPAND, 5 ); - m_fgridColor = new wxFlexGridSizer( 0, 10, 0, 0 ); m_fgridColor->AddGrowableCol( 1 ); m_fgridColor->AddGrowableCol( 3 ); @@ -182,10 +155,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_fgridColor->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_SizerDefinedColors->Add( m_fgridColor, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - m_SizerDefinedColors->Add( 0, 0, 1, wxEXPAND, 5 ); + m_SizerDefinedColors->Add( m_fgridColor, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); m_panelDefinedColors->SetSizer( m_SizerDefinedColors ); @@ -193,51 +163,48 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_SizerDefinedColors->Fit( m_panelDefinedColors ); m_notebook->AddPage( m_panelDefinedColors, wxT("Defined Colors"), false ); - bSizerUpperMain->Add( m_notebook, 1, wxEXPAND | wxALL, 5 ); + bSizerUpperMain->Add( m_notebook, 0, wxEXPAND | wxALL, 5 ); m_SizerTransparency = new wxBoxSizer( wxVERTICAL ); - m_SizerTransparency->Add( 0, 20, 0, 0, 5 ); + m_SizerTransparency->Add( 0, 20, 0, wxTOP, 5 ); - m_staticText9 = new wxStaticText( this, wxID_ANY, wxT("Opacity %"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( -1 ); - m_SizerTransparency->Add( m_staticText9, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_opacityLabel = new wxStaticText( this, wxID_ANY, wxT("Opacity:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_opacityLabel->Wrap( -1 ); + m_SizerTransparency->Add( m_opacityLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); m_sliderTransparency = new wxSlider( this, wxID_ANY, 80, 20, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL ); m_SizerTransparency->Add( m_sliderTransparency, 1, wxALL, 5 ); - m_SizerTransparency->Add( 0, 20, 0, 0, 5 ); + bSizerUpperMain->Add( m_SizerTransparency, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - bSizerUpperMain->Add( m_SizerTransparency, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizerShowColors; - bSizerShowColors = new wxBoxSizer( wxVERTICAL ); - - m_staticTextOldColor = new wxStaticText( this, wxID_ANY, wxT("Old Color"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextOldColor->Wrap( -1 ); - bSizerShowColors->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_OldColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 64,64 ), 0 ); - bSizerShowColors->Add( m_OldColorRect, 0, wxALL, 5 ); - - m_staticTextNewColor = new wxStaticText( this, wxID_ANY, wxT("New Color"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextNewColor->Wrap( -1 ); - bSizerShowColors->Add( m_staticTextNewColor, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_NewColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 64,64 ), 0 ); - bSizerShowColors->Add( m_NewColorRect, 0, wxALL, 5 ); + bSizerUpperMain->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - bSizerUpperMain->Add( bSizerShowColors, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - - bSizerMain->Add( bSizerUpperMain, 1, wxEXPAND, 5 ); + bSizerMain->Add( bSizerUpperMain, 0, wxEXPAND, 5 ); m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 ); + bSizerMain->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bButtonsSizer; + bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextOldColor = new wxStaticText( this, wxID_ANY, wxT("Preview (old / new):"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextOldColor->Wrap( -1 ); + bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_OldColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_OldColorRect->SetMinSize( wxSize( 30,22 ) ); + + bButtonsSizer->Add( m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_NewColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_NewColorRect->SetMinSize( wxSize( 30,22 ) ); + + bButtonsSizer->Add( m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); @@ -246,19 +213,28 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALL, 5 ); + bButtonsSizer->Add( m_sdbSizer, 1, wxALIGN_RIGHT|wxALL, 5 ); + + + bSizerMain->Add( bButtonsSizer, 1, wxEXPAND|wxLEFT, 10 ); this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); this->Centre( wxBOTH ); // Connect Events m_RgbBitmap->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onRGBMouseClick ), NULL, this ); m_RgbBitmap->Connect( wxEVT_MOTION, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onRGBMouseDrag ), NULL, this ); + m_spinCtrlRed->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditRed ), NULL, this ); + m_spinCtrlGreen->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditGreen ), NULL, this ); + m_spinCtrlBlue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditBlue ), NULL, this ); m_HsvBitmap->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onHSVMouseClick ), NULL, this ); m_HsvBitmap->Connect( wxEVT_MOTION, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onHSVMouseDrag ), NULL, this ); + m_spinCtrlHue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditHue ), NULL, this ); + m_spinCtrlSaturation->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditSat ), NULL, this ); m_sliderBrightness->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); @@ -268,11 +244,6 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_sliderBrightness->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); - m_spinCtrlRed->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditRed ), NULL, this ); - m_spinCtrlGreen->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditGreen ), NULL, this ); - m_spinCtrlBlue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditBlue ), NULL, this ); - m_spinCtrlHue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditHue ), NULL, this ); - m_spinCtrlSaturation->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditSat ), NULL, this ); m_sliderTransparency->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeAlpha ), NULL, this ); m_sliderTransparency->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeAlpha ), NULL, this ); m_sliderTransparency->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeAlpha ), NULL, this ); @@ -289,8 +260,13 @@ COLOR4D_PICKER_DLG_BASE::~COLOR4D_PICKER_DLG_BASE() // Disconnect Events m_RgbBitmap->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onRGBMouseClick ), NULL, this ); m_RgbBitmap->Disconnect( wxEVT_MOTION, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onRGBMouseDrag ), NULL, this ); + m_spinCtrlRed->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditRed ), NULL, this ); + m_spinCtrlGreen->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditGreen ), NULL, this ); + m_spinCtrlBlue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditBlue ), NULL, this ); m_HsvBitmap->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onHSVMouseClick ), NULL, this ); m_HsvBitmap->Disconnect( wxEVT_MOTION, wxMouseEventHandler( COLOR4D_PICKER_DLG_BASE::onHSVMouseDrag ), NULL, this ); + m_spinCtrlHue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditHue ), NULL, this ); + m_spinCtrlSaturation->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditSat ), NULL, this ); m_sliderBrightness->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); @@ -300,11 +276,6 @@ COLOR4D_PICKER_DLG_BASE::~COLOR4D_PICKER_DLG_BASE() m_sliderBrightness->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); m_sliderBrightness->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeBrightness ), NULL, this ); - m_spinCtrlRed->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditRed ), NULL, this ); - m_spinCtrlGreen->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditGreen ), NULL, this ); - m_spinCtrlBlue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditBlue ), NULL, this ); - m_spinCtrlHue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditHue ), NULL, this ); - m_spinCtrlSaturation->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeEditSat ), NULL, this ); m_sliderTransparency->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeAlpha ), NULL, this ); m_sliderTransparency->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeAlpha ), NULL, this ); m_sliderTransparency->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( COLOR4D_PICKER_DLG_BASE::OnChangeAlpha ), NULL, this ); diff --git a/common/widgets/color4Dpickerdlg_base.fbp b/common/widgets/color4Dpickerdlg_base.fbp index d483e07cc7..ce160301cc 100644 --- a/common/widgets/color4Dpickerdlg_base.fbp +++ b/common/widgets/color4Dpickerdlg_base.fbp @@ -44,7 +44,7 @@ COLOR4D_PICKER_DLG_BASE - 707,375 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Color Picker @@ -96,7 +96,7 @@ 5 wxEXPAND - 1 + 0 bSizerUpperMain @@ -105,7 +105,7 @@ 5 wxEXPAND | wxALL - 1 + 0 1 1 @@ -278,27 +278,17 @@ none 5 - wxEXPAND|wxBOTTOM|wxRIGHT - 1 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 wxID_ANY RGB - + -1,-1 sbSizerViewRGB wxVERTICAL 1 none - - 5 - wxALIGN_CENTER_HORIZONTAL - 1 - - 0 - protected - 0 - - 5 wxALL|wxALIGN_CENTER_HORIZONTAL @@ -380,364 +370,10 @@ - - 5 - wxALIGN_CENTER_HORIZONTAL - 1 - - 0 - protected - 0 - - - - - - 5 - wxEXPAND|wxBOTTOM - 1 - - wxID_ANY - Hue and Saturation - - sbSizerViewHSV - wxVERTICAL - 1 - none - - - 5 - wxALIGN_CENTER_HORIZONTAL - 1 - - 0 - protected - 0 - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - -1,-1 - - 0 - 264,264 - 1 - m_HsvBitmap - 1 - - - protected - 1 - - Resizable - 1 - 264,264 - - 0 - - - - - - - - - - - - - onHSVMouseClick - - - - - onHSVMouseDrag - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL - 1 - - 0 - protected - 0 - - - - - - 5 - wxEXPAND - 0 - - - bSizerBright - wxVERTICAL - none - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Value - - 0 - - - 0 - - 1 - m_staticTextBright - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 255 - - 0 - - 0 - - 0 - - 1 - m_sliderBrightness - 1 - - - protected - 1 - - Resizable - 1 - - wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 255 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnChangeBrightness - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bSizerLowerFreeColors - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - wxID_ANY - RGB Values - - sbSizerSetRGB - wxHORIZONTAL - 1 - none - 5 wxEXPAND - 1 + 0 3 wxBOTH @@ -782,7 +418,7 @@ 0 0 wxID_ANY - Red + Red: 0 @@ -865,7 +501,7 @@ 0 0 wxID_ANY - Green + Green: 0 @@ -948,7 +584,7 @@ 0 0 wxID_ANY - Blue + Blue: 0 @@ -1001,7 +637,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -1089,7 +725,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -1177,7 +813,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -1269,13 +905,13 @@ 5 - wxEXPAND - 1 + wxEXPAND|wxBOTTOM|wxRIGHT + 0 wxID_ANY - HS Values + HSV - sbSizerSetHSV + sbSizerViewHSV wxHORIZONTAL 1 none @@ -1283,22 +919,467 @@ 5 wxEXPAND - 1 - - 2 - wxBOTH - 0,1 - - 0 + 0 + - fgSizerHSV - wxFLEX_GROWMODE_SPECIFIED + bSizer10 + wxVERTICAL none - 0 - 0 5 - wxTOP|wxRIGHT|wxLEFT + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + -1,-1 + + 0 + 264,264 + 1 + m_HsvBitmap + 1 + + + protected + 1 + + Resizable + 1 + 264,264 + + 0 + + + + + + + + + + + + + onHSVMouseClick + + + + + onHSVMouseDrag + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 2 + wxBOTH + 0,1 + + 0 + + fgSizerHSV + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hue: + + 0 + + + 0 + + 1 + m_staticTextHue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Saturation: + + 0 + + + 0 + + 1 + m_staticTextSat + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + 80,-1 + 1 + m_spinCtrlHue + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnChangeEditHue + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 128 + 255 + + 0 + + 0 + + 0 + 80,-1 + 1 + m_spinCtrlSaturation + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnChangeEditSat + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizerBright + wxVERTICAL + none + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL 0 1 @@ -1328,7 +1409,7 @@ 0 0 wxID_ANY - Hue + Value: 0 @@ -1336,7 +1417,7 @@ 0 1 - m_staticTextHue + m_staticTextBright 1 @@ -1381,9 +1462,9 @@ 5 - wxTOP|wxRIGHT|wxLEFT - 0 - + wxTOP|wxRIGHT + 1 + 1 1 1 @@ -1411,15 +1492,16 @@ 0 0 wxID_ANY - Saturation + 255 0 + 0 0 1 - m_staticTextSat + m_sliderBrightness 1 @@ -1429,15 +1511,29 @@ Resizable 1 - + wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL 0 + + wxFILTER_NONE + wxDefaultValidator + + 255 - -1 + + + + + + + + + + @@ -1457,187 +1553,21 @@ + OnChangeBrightness + + + + + + + + + - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 359 - - 0 - - 0 - - 0 - 80,-1 - 1 - m_spinCtrlHue - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnChangeEditHue - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 128 - 255 - - 0 - - 0 - - 0 - 80,-1 - 1 - m_spinCtrlSaturation - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnChangeEditSat - - - - - @@ -1732,17 +1662,7 @@ protected 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM 0 10 @@ -1758,16 +1678,6 @@ 0 - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - @@ -1775,7 +1685,7 @@ 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 0 @@ -1784,7 +1694,7 @@ protected 5 - + wxTOP 0 20 @@ -1794,7 +1704,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxALL 0 1 @@ -1824,7 +1734,7 @@ 0 0 wxID_ANY - Opacity % + Opacity: 0 @@ -1832,7 +1742,7 @@ 0 1 - m_staticText9 + m_opacityLabel 1 @@ -1983,362 +1893,23 @@ - - 5 - - 0 - - 20 - protected - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT - 0 - - - bSizerShowColors - wxVERTICAL - none - - 5 - wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Old Color - - 0 - - - 0 - - 1 - m_staticTextOldColor - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_OldColorRect - 1 - - - protected - 1 - - Resizable - 1 - 64,64 - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - New Color - - 0 - - - 0 - - 1 - m_staticTextNewColor - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_NewColorRect - 1 - - - protected - 1 - - Resizable - 1 - 64,64 - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + wxEXPAND|wxRIGHT|wxLEFT + 1 + + 0 + protected + 0 5 - wxEXPAND | wxALL + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -2418,29 +1989,285 @@ - 5 - wxALIGN_RIGHT|wxALL - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 + 10 + wxEXPAND|wxLEFT + 1 + - m_sdbSizer - protected - - - - - - - - + bButtonsSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Preview (old / new): + + 0 + + + 0 + + 1 + m_staticTextOldColor + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 30,22 + 1 + m_OldColorRect + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 30,22 + 1 + m_NewColorRect + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALL + 1 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + + + + + + + + + diff --git a/common/widgets/color4Dpickerdlg_base.h b/common/widgets/color4Dpickerdlg_base.h index fdf3151849..3d33189809 100644 --- a/common/widgets/color4Dpickerdlg_base.h +++ b/common/widgets/color4Dpickerdlg_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 4 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __COLOR4DPICKERDLG_BASE_H__ @@ -10,8 +10,6 @@ #include #include -class DIALOG_SHIM; - #include "dialog_shim.h" #include #include @@ -22,11 +20,11 @@ class DIALOG_SHIM; #include #include #include +#include +#include #include #include -#include #include -#include #include #include #include @@ -47,30 +45,29 @@ class COLOR4D_PICKER_DLG_BASE : public DIALOG_SHIM wxNotebook* m_notebook; wxPanel* m_panelFreeColors; wxStaticBitmap* m_RgbBitmap; - wxStaticBitmap* m_HsvBitmap; - wxStaticText* m_staticTextBright; - wxSlider* m_sliderBrightness; wxStaticText* m_staticTextR; wxStaticText* m_staticTextG; wxStaticText* m_staticTextB; wxSpinCtrl* m_spinCtrlRed; wxSpinCtrl* m_spinCtrlGreen; wxSpinCtrl* m_spinCtrlBlue; + wxStaticBitmap* m_HsvBitmap; wxStaticText* m_staticTextHue; wxStaticText* m_staticTextSat; wxSpinCtrl* m_spinCtrlHue; wxSpinCtrl* m_spinCtrlSaturation; + wxStaticText* m_staticTextBright; + wxSlider* m_sliderBrightness; wxPanel* m_panelDefinedColors; wxBoxSizer* m_SizerDefinedColors; wxFlexGridSizer* m_fgridColor; wxBoxSizer* m_SizerTransparency; - wxStaticText* m_staticText9; + wxStaticText* m_opacityLabel; wxSlider* m_sliderTransparency; + wxStaticLine* m_staticline; wxStaticText* m_staticTextOldColor; wxStaticBitmap* m_OldColorRect; - wxStaticText* m_staticTextNewColor; wxStaticBitmap* m_NewColorRect; - wxStaticLine* m_staticline; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; @@ -78,20 +75,20 @@ class COLOR4D_PICKER_DLG_BASE : public DIALOG_SHIM // Virtual event handlers, overide them in your derived class virtual void onRGBMouseClick( wxMouseEvent& event ) { event.Skip(); } virtual void onRGBMouseDrag( wxMouseEvent& event ) { event.Skip(); } - virtual void onHSVMouseClick( wxMouseEvent& event ) { event.Skip(); } - virtual void onHSVMouseDrag( wxMouseEvent& event ) { event.Skip(); } - virtual void OnChangeBrightness( wxScrollEvent& event ) { event.Skip(); } virtual void OnChangeEditRed( wxSpinEvent& event ) { event.Skip(); } virtual void OnChangeEditGreen( wxSpinEvent& event ) { event.Skip(); } virtual void OnChangeEditBlue( wxSpinEvent& event ) { event.Skip(); } + virtual void onHSVMouseClick( wxMouseEvent& event ) { event.Skip(); } + virtual void onHSVMouseDrag( wxMouseEvent& event ) { event.Skip(); } virtual void OnChangeEditHue( wxSpinEvent& event ) { event.Skip(); } virtual void OnChangeEditSat( wxSpinEvent& event ) { event.Skip(); } + virtual void OnChangeBrightness( wxScrollEvent& event ) { event.Skip(); } virtual void OnChangeAlpha( wxScrollEvent& event ) { event.Skip(); } public: - COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Color Picker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 707,375 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Color Picker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~COLOR4D_PICKER_DLG_BASE(); }; diff --git a/common/widgets/color_swatch.cpp b/common/widgets/color_swatch.cpp index 7890f13614..0fefcadaf9 100644 --- a/common/widgets/color_swatch.cpp +++ b/common/widgets/color_swatch.cpp @@ -161,7 +161,7 @@ void COLOR_SWATCH::GetNewSwatchColor() if( m_arbitraryColors ) { - COLOR4D_PICKER_DLG dialog( this, m_color, true ); + COLOR4D_PICKER_DLG dialog( ::wxGetTopLevelParent( this ), m_color, true ); if( dialog.ShowModal() == wxID_OK ) newColor = dialog.GetColor();