KiCad PCB EDA Suite
ENABLER Class Reference

Simple class to automatically enable/disable widgets. More...

#include <enabler.h>

Public Member Functions

 ENABLER (wxWindow &aObject, bool aState)
 Constructor. More...
 
 ~ENABLER ()
 

Private Attributes

wxWindow & m_object
 
bool m_state
 

Detailed Description

Simple class to automatically enable/disable widgets.

As long as an ENABLER object exists, the handled widget will be kept in the requested state.

Definition at line 29 of file enabler.h.

Constructor & Destructor Documentation

ENABLER::ENABLER ( wxWindow &  aObject,
bool  aState 
)
inline

Constructor.

Parameters
aObjectis the object to be temporarily enabled or disabled.
aStateis the requested temporary state (true for enabled, false for disabled).

Definition at line 38 of file enabler.h.

References m_object, and m_state.

39  : m_object( aObject ), m_state( aState )
40  {
41  m_object.Enable( m_state );
42  }
wxWindow & m_object
Definition: enabler.h:50
bool m_state
Definition: enabler.h:51
ENABLER::~ENABLER ( )
inline

Definition at line 44 of file enabler.h.

References m_object, and m_state.

45  {
46  m_object.Enable( !m_state );
47  }
wxWindow & m_object
Definition: enabler.h:50
bool m_state
Definition: enabler.h:51

Member Data Documentation

wxWindow& ENABLER::m_object
private

Definition at line 50 of file enabler.h.

Referenced by ENABLER(), and ~ENABLER().

bool ENABLER::m_state
private

Definition at line 51 of file enabler.h.

Referenced by ENABLER(), and ~ENABLER().


The documentation for this class was generated from the following file: