Change binding with units

This commit is contained in:
Seth Hillbrand 2022-12-05 15:34:20 -08:00
parent 38a509e768
commit 77b763f8ba
2 changed files with 26 additions and 2 deletions

View File

@ -619,3 +619,28 @@ PROPERTY_EDITOR_UNIT_BINDER::PROPERTY_EDITOR_UNIT_BINDER( EDA_DRAW_FRAME* aParen
PROPERTY_EDITOR_UNIT_BINDER::~PROPERTY_EDITOR_UNIT_BINDER() PROPERTY_EDITOR_UNIT_BINDER::~PROPERTY_EDITOR_UNIT_BINDER()
{ {
} }
void PROPERTY_EDITOR_UNIT_BINDER::SetControl( wxWindow* aControl )
{
if( m_valueCtrl )
{
m_valueCtrl->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onSetFocus ),
nullptr, this );
m_valueCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onKillFocus ),
nullptr, this );
m_valueCtrl->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onClick ),
nullptr, this );
}
m_valueCtrl = aControl;
if( m_valueCtrl )
{
m_valueCtrl->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onSetFocus ),
nullptr, this );
m_valueCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onKillFocus ),
nullptr, this );
m_valueCtrl->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onClick ),
nullptr, this );
}
}

View File

@ -37,7 +37,6 @@ class wxTextEntry;
class wxSpinButton; class wxSpinButton;
class wxStaticText; class wxStaticText;
class UNIT_BINDER : public wxEvtHandler class UNIT_BINDER : public wxEvtHandler
{ {
public: public:
@ -266,7 +265,7 @@ public:
virtual ~PROPERTY_EDITOR_UNIT_BINDER(); virtual ~PROPERTY_EDITOR_UNIT_BINDER();
void SetControl( wxWindow* aControl ) { m_valueCtrl = aControl; } void SetControl( wxWindow* aControl );
}; };
#endif /* __UNIT_BINDER_H_ */ #endif /* __UNIT_BINDER_H_ */