Highlight currently active inspector Apply button.
This commit is contained in:
parent
71f188f3de
commit
899c8ccc8d
|
@ -670,6 +670,7 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c
|
|||
this->Layout();
|
||||
|
||||
// Connect Events
|
||||
m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( PANEL_PROPERTIES_BASE::OnPageChanged ), NULL, this );
|
||||
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PROPERTIES_BASE::OnAcceptPrms ), NULL, this );
|
||||
m_buttonDefault->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PROPERTIES_BASE::OnSetDefaultValues ), NULL, this );
|
||||
m_buttonGeneralOptsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PROPERTIES_BASE::OnAcceptPrms ), NULL, this );
|
||||
|
@ -678,6 +679,7 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c
|
|||
PANEL_PROPERTIES_BASE::~PANEL_PROPERTIES_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( PANEL_PROPERTIES_BASE::OnPageChanged ), NULL, this );
|
||||
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PROPERTIES_BASE::OnAcceptPrms ), NULL, this );
|
||||
m_buttonDefault->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PROPERTIES_BASE::OnSetDefaultValues ), NULL, this );
|
||||
m_buttonGeneralOptsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PROPERTIES_BASE::OnAcceptPrms ), NULL, this );
|
||||
|
|
|
@ -156,7 +156,7 @@
|
|||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnNotebookPageChanged"></event>
|
||||
<event name="OnNotebookPageChanged">OnPageChanged</event>
|
||||
<event name="OnNotebookPageChanging"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
|
|
|
@ -145,6 +145,7 @@ class PANEL_PROPERTIES_BASE : public wxPanel
|
|||
wxButton* m_buttonGeneralOptsOK;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnPageChanged( wxNotebookEvent& event ) { event.Skip(); }
|
||||
virtual void OnAcceptPrms( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSetDefaultValues( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ PROPERTIES_FRAME::PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ):
|
|||
infoFont.SetSymbolicSize( wxFONTSIZE_X_SMALL );
|
||||
m_staticTextSizeInfo->SetFont( infoFont );
|
||||
m_staticTextInfoThickness->SetFont( infoFont );
|
||||
|
||||
m_buttonOK->SetDefault();
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,6 +50,17 @@ PROPERTIES_FRAME::~PROPERTIES_FRAME()
|
|||
}
|
||||
|
||||
|
||||
void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
|
||||
{
|
||||
if( event.GetSelection() == 0 )
|
||||
m_buttonOK->SetDefault();
|
||||
else
|
||||
m_buttonGeneralOptsOK->SetDefault();
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
wxSize PROPERTIES_FRAME::GetMinSize() const
|
||||
{
|
||||
return wxSize( 150, -1 );
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
~PROPERTIES_FRAME();
|
||||
|
||||
// Event functions
|
||||
void OnPageChanged( wxNotebookEvent& event ) override;
|
||||
void OnAcceptPrms( wxCommandEvent& event ) override;
|
||||
void OnSetDefaultValues( wxCommandEvent& event ) override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue