From e2f2f3518bf72f9c9990bdfc79afc4b76eb79f4a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 23 Dec 2022 15:26:47 +0000 Subject: [PATCH] Minor improvements to tuner panel look & feel. --- eeschema/widgets/tuner_slider.cpp | 21 +- eeschema/widgets/tuner_slider_base.cpp | 61 +- eeschema/widgets/tuner_slider_base.fbp | 1082 ++++++++++++++---------- eeschema/widgets/tuner_slider_base.h | 20 +- 4 files changed, 681 insertions(+), 503 deletions(-) diff --git a/eeschema/widgets/tuner_slider.cpp b/eeschema/widgets/tuner_slider.cpp index 078294aa79..1a4d2829d7 100644 --- a/eeschema/widgets/tuner_slider.cpp +++ b/eeschema/widgets/tuner_slider.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include // log log1p expm1 #include // norm @@ -49,21 +49,24 @@ TUNER_SLIDER::TUNER_SLIDER( SIM_PLOT_FRAME* aFrame, wxWindow* aParent, SCH_SYMBO m_item = aFrame->GetExporter()->FindItem( std::string( ref.ToUTF8() ) ); if( !m_item ) + { throw KI_PARAM_ERROR( wxString::Format( _( "Could not find Spice item with reference '%s'" ), ref ) ); + } m_name->SetLabel( ref ); - + m_closeBtn->SetBitmap( KiBitmap( BITMAPS::small_trash ) ); const SIM_MODEL::PARAM* tunerParam = m_item->model->GetTunerParam(); if( !tunerParam ) - throw KI_PARAM_ERROR( wxString::Format( - _( "Symbol '%s' has simulation model of type '%s %s', which cannot be tuned" ), - ref, - m_item->model->GetDeviceInfo().fieldValue, - m_item->model->GetTypeInfo().fieldValue ) ); - + { + throw KI_PARAM_ERROR( wxString::Format( _( "Symbol '%s' has simulation model of type '%s %s', " + "which cannot be tuned" ), + ref, + m_item->model->GetDeviceInfo().fieldValue, + m_item->model->GetTypeInfo().fieldValue ) ); + } // Special case for potentiometers because we don't have value ranges implemented yet. if( m_item->model->GetType() == SIM_MODEL::TYPE::R_POT ) @@ -93,6 +96,8 @@ TUNER_SLIDER::TUNER_SLIDER( SIM_PLOT_FRAME* aFrame, wxWindow* aParent, SCH_SYMBO m_simTimer.SetOwner( this ); Connect( wxEVT_TIMER, wxTimerEventHandler( TUNER_SLIDER::onSimTimer ), nullptr, this ); + + Layout(); } diff --git a/eeschema/widgets/tuner_slider_base.cpp b/eeschema/widgets/tuner_slider_base.cpp index 2c70896442..454c540354 100644 --- a/eeschema/widgets/tuner_slider_base.cpp +++ b/eeschema/widgets/tuner_slider_base.cpp @@ -1,10 +1,12 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// +#include "widgets/std_bitmap_button.h" + #include "tuner_slider_base.h" /////////////////////////////////////////////////////////////////////////// @@ -14,18 +16,22 @@ TUNER_SLIDER_BASE::TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id, const wxP wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); + m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN|wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizerUpper; - bSizerUpper = new wxBoxSizer( wxHORIZONTAL ); + bSizerUpper = new wxBoxSizer( wxVERTICAL ); - m_name = new wxStaticText( this, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); + m_name = new wxStaticText( m_panel1, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); m_name->Wrap( -1 ); - bSizerUpper->Add( m_name, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_closeBtn = new wxButton( this, wxID_ANY, _(" X "), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); - bSizerUpper->Add( m_closeBtn, 0, wxALL, 5 ); + bSizerUpper->Add( m_name, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - bSizerMain->Add( bSizerUpper, 0, wxALL|wxEXPAND, 5 ); + bSizer6->Add( bSizerUpper, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_staticline4 = new wxStaticLine( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer6->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 3 ); wxBoxSizer* bSizerMiddle; bSizerMiddle = new wxBoxSizer( wxHORIZONTAL ); @@ -33,8 +39,8 @@ TUNER_SLIDER_BASE::TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id, const wxP wxBoxSizer* bSizerSlider; bSizerSlider = new wxBoxSizer( wxVERTICAL ); - m_slider = new wxSlider( this, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LEFT|wxSL_VERTICAL ); - bSizerSlider->Add( m_slider, 1, 0, 5 ); + m_slider = new wxSlider( m_panel1, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LEFT|wxSL_VERTICAL ); + bSizerSlider->Add( m_slider, 1, wxTOP|wxBOTTOM, 5 ); bSizerMiddle->Add( bSizerSlider, 0, wxEXPAND, 5 ); @@ -42,17 +48,17 @@ TUNER_SLIDER_BASE::TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id, const wxP wxGridSizer* gSizerTxtCtr; gSizerTxtCtr = new wxGridSizer( 0, 1, 0, 0 ); - m_maxText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); + m_maxText = new wxTextCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_maxText->SetMinSize( wxSize( 70,-1 ) ); gSizerTxtCtr->Add( m_maxText, 0, wxALIGN_TOP|wxALL, 5 ); - m_valueText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); + m_valueText = new wxTextCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_valueText->SetMinSize( wxSize( 70,-1 ) ); gSizerTxtCtr->Add( m_valueText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_minText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); + m_minText = new wxTextCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_minText->SetMinSize( wxSize( 70,-1 ) ); gSizerTxtCtr->Add( m_minText, 0, wxALIGN_BOTTOM|wxALL, 5 ); @@ -61,17 +67,35 @@ TUNER_SLIDER_BASE::TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id, const wxP bSizerMiddle->Add( gSizerTxtCtr, 1, wxEXPAND, 5 ); - bSizerMain->Add( bSizerMiddle, 1, wxEXPAND, 5 ); + bSizer6->Add( bSizerMiddle, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_saveBtn = new wxButton( this, wxID_ANY, _("Save"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerMain->Add( m_saveBtn, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + wxBoxSizer* bSizerBottom; + bSizerBottom = new wxBoxSizer( wxHORIZONTAL ); + + m_saveBtn = new wxButton( m_panel1, wxID_ANY, _("Save"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBottom->Add( m_saveBtn, 0, wxEXPAND|wxRIGHT|wxLEFT, 3 ); + + + bSizerBottom->Add( 5, 0, 1, wxEXPAND, 5 ); + + m_closeBtn = new STD_BITMAP_BUTTON( m_panel1, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + bSizerBottom->Add( m_closeBtn, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer6->Add( bSizerBottom, 0, wxEXPAND|wxALL, 3 ); + + + m_panel1->SetSizer( bSizer6 ); + m_panel1->Layout(); + bSizer6->Fit( m_panel1 ); + bSizerMain->Add( m_panel1, 1, wxEXPAND|wxRIGHT, 5 ); this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); // Connect Events - m_closeBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( TUNER_SLIDER_BASE::onClose ), NULL, this ); m_slider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( TUNER_SLIDER_BASE::onSliderChanged ), NULL, this ); m_slider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( TUNER_SLIDER_BASE::onSliderChanged ), NULL, this ); m_slider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( TUNER_SLIDER_BASE::onSliderChanged ), NULL, this ); @@ -88,12 +112,12 @@ TUNER_SLIDER_BASE::TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id, const wxP m_minText->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( TUNER_SLIDER_BASE::onMinKillFocus ), NULL, this ); m_minText->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( TUNER_SLIDER_BASE::onMinTextEnter ), NULL, this ); m_saveBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( TUNER_SLIDER_BASE::onSave ), NULL, this ); + m_closeBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( TUNER_SLIDER_BASE::onClose ), NULL, this ); } TUNER_SLIDER_BASE::~TUNER_SLIDER_BASE() { // Disconnect Events - m_closeBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( TUNER_SLIDER_BASE::onClose ), NULL, this ); m_slider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( TUNER_SLIDER_BASE::onSliderChanged ), NULL, this ); m_slider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( TUNER_SLIDER_BASE::onSliderChanged ), NULL, this ); m_slider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( TUNER_SLIDER_BASE::onSliderChanged ), NULL, this ); @@ -110,5 +134,6 @@ TUNER_SLIDER_BASE::~TUNER_SLIDER_BASE() m_minText->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( TUNER_SLIDER_BASE::onMinKillFocus ), NULL, this ); m_minText->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( TUNER_SLIDER_BASE::onMinTextEnter ), NULL, this ); m_saveBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( TUNER_SLIDER_BASE::onSave ), NULL, this ); + m_closeBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( TUNER_SLIDER_BASE::onClose ), NULL, this ); } diff --git a/eeschema/widgets/tuner_slider_base.fbp b/eeschema/widgets/tuner_slider_base.fbp index e8fcae89e5..a929ef4ec2 100644 --- a/eeschema/widgets/tuner_slider_base.fbp +++ b/eeschema/widgets/tuner_slider_base.fbp @@ -45,13 +45,13 @@ TUNER_SLIDER_BASE - 126,283 + -1,-1 0 - wxTAB_TRAVERSAL + wxBORDER_NONE|wxTAB_TRAVERSAL bSizerMain @@ -59,455 +59,9 @@ none 5 - wxALL|wxEXPAND - 0 - - - bSizerUpper - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Name - 0 - - 0 - - - 0 - - 1 - m_name - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - X - - 0 - - 0 - - - 0 - - 1 - m_closeBtn - 1 - - - protected - 1 - - - - Resizable - 1 - - wxBU_EXACTFIT - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onClose - - - - - - 5 - wxEXPAND + wxEXPAND|wxRIGHT 1 - - - bSizerMiddle - wxHORIZONTAL - none - - 5 - wxEXPAND - 0 - - - bSizerSlider - wxVERTICAL - none - - 5 - - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 100 - - 0 - - 0 - - 0 - - 1 - m_slider - 1 - - - protected - 1 - - Resizable - 1 - - wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LEFT|wxSL_VERTICAL - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 50 - - - - onSliderChanged - - - - - - 5 - wxEXPAND - 1 - - 1 - 0 - - gSizerTxtCtr - none - 0 - 0 - - 5 - wxALIGN_TOP|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 70,-1 - 1 - m_maxText - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PROCESS_ENTER - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - onMaxKillFocus - onMaxTextEnter - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 70,-1 - 1 - m_valueText - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PROCESS_ENTER - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - onValueKillFocus - onValueTextEnter - - - - 5 - wxALIGN_BOTTOM|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 70,-1 - 1 - m_minText - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PROCESS_ENTER - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - onMinKillFocus - onMinTextEnter - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - + 1 1 1 @@ -516,34 +70,25 @@ - 0 - 1 0 1 1 - - 0 0 - Dock 0 Left 1 1 - 0 0 wxID_ANY - Save - - 0 0 @@ -551,30 +96,627 @@ 0 1 - m_saveBtn + m_panel1 1 protected 1 - - Resizable 1 - - + ; ; forward_declare 0 - - wxFILTER_NONE - wxDefaultValidator - - - onSave + wxBORDER_SUNKEN|wxTAB_TRAVERSAL + + + bSizer6 + wxVERTICAL + none + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + + bSizerUpper + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Name + 0 + + 0 + + + 0 + + 1 + m_name + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + 3 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline4 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + + bSizerMiddle + wxHORIZONTAL + none + + 5 + wxEXPAND + 0 + + + bSizerSlider + wxVERTICAL + none + + 5 + wxTOP|wxBOTTOM + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 100 + + 0 + + 0 + + 0 + + 1 + m_slider + 1 + + + protected + 1 + + Resizable + 1 + + wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LEFT|wxSL_VERTICAL + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 50 + + + + onSliderChanged + + + + + + 5 + wxEXPAND + 1 + + 1 + 0 + + gSizerTxtCtr + none + 0 + 0 + + 5 + wxALIGN_TOP|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + 70,-1 + 1 + m_maxText + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_ENTER + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onMaxKillFocus + onMaxTextEnter + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + 70,-1 + 1 + m_valueText + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_ENTER + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onValueKillFocus + onValueTextEnter + + + + 5 + wxALIGN_BOTTOM|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + 70,-1 + 1 + m_minText + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_ENTER + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onMinKillFocus + onMinTextEnter + + + + + + + + 3 + wxEXPAND|wxALL + 0 + + + bSizerBottom + wxHORIZONTAL + none + + 3 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Save + + 0 + + 0 + + + 0 + + 1 + m_saveBtn + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onSave + + + + 5 + wxEXPAND + 1 + + 0 + protected + 5 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Delete + + 0 + + 0 + + + 0 + + 1 + m_closeBtn + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onClose + + + + + diff --git a/eeschema/widgets/tuner_slider_base.h b/eeschema/widgets/tuner_slider_base.h index a09298e940..38a382863a 100644 --- a/eeschema/widgets/tuner_slider_base.h +++ b/eeschema/widgets/tuner_slider_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -10,19 +10,23 @@ #include #include #include +class STD_BITMAP_BUTTON; + #include #include #include #include #include #include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -36,16 +40,17 @@ class TUNER_SLIDER_BASE : public wxPanel private: protected: + wxPanel* m_panel1; wxStaticText* m_name; - wxButton* m_closeBtn; + wxStaticLine* m_staticline4; wxSlider* m_slider; wxTextCtrl* m_maxText; wxTextCtrl* m_valueText; wxTextCtrl* m_minText; wxButton* m_saveBtn; + STD_BITMAP_BUTTON* m_closeBtn; // Virtual event handlers, override them in your derived class - virtual void onClose( wxCommandEvent& event ) { event.Skip(); } virtual void onSliderChanged( wxScrollEvent& event ) { event.Skip(); } virtual void onMaxKillFocus( wxFocusEvent& event ) { event.Skip(); } virtual void onMaxTextEnter( wxCommandEvent& event ) { event.Skip(); } @@ -54,11 +59,12 @@ class TUNER_SLIDER_BASE : public wxPanel virtual void onMinKillFocus( wxFocusEvent& event ) { event.Skip(); } virtual void onMinTextEnter( wxCommandEvent& event ) { event.Skip(); } virtual void onSave( wxCommandEvent& event ) { event.Skip(); } + virtual void onClose( wxCommandEvent& event ) { event.Skip(); } public: - TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 126,283 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + TUNER_SLIDER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxBORDER_NONE|wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~TUNER_SLIDER_BASE();