| 
    KiCad PCB EDA Suite
    
   | 
 
#include <widget_save_restore.h>
Classes | |
| union | CONTROL | 
| union | DATA | 
| struct | WIDGET_CTRL_T | 
| Struct that represents a single bound control.  More... | |
Public Member Functions | |
| WIDGET_SAVE_RESTORE (const EDA_IU_SCALE &aIuScale, bool &aValidFlag) | |
| void | Add (wxRadioBox &ctrl, long &dest) | 
| Bind a radiobox to a choice.   | |
| void | Add (wxRadioButton &ctrl, bool &dest) | 
| Bind a radio button to a binary choice.   | |
| void | Add (wxCheckBox &ctrl, bool &dest) | 
| Bind a check box to a binary choice.   | |
| void | Add (wxTextCtrl &ctrl, wxString &dest) | 
| Bind a text ctrl to a string: the control value is stored directly into the string.   | |
| void | Add (wxTextCtrl &ctrl, long &dest) | 
| Bind a text ctrl to a integer: the control value is converted to and from integer on save/restore.   | |
| void | Add (wxTextCtrl &ctrl, double &dest) | 
| Bind a text ctrl to a double: the control value is converted to and from double on save/restore.   | |
| void | Add (UNIT_BINDER &ctrl, long &dest) | 
| Bind a control managed by a UNIT_BINDER into a integer.   | |
| void | Add (UNIT_BINDER &ctrl, EDA_ANGLE &dest) | 
| Bind a control managed by a UNIT_BINDER into an angle.   | |
| void | Add (wxChoice &ctrl, long &dest) | 
| Bind a choice control into a choice (agnostic to the actual meaning of the choice)   | |
| void | Add (wxNotebook &ctrl, long &dest) | 
| Bind a notebook tab choice to an integer.   | |
| void | ReadConfigFromControls () | 
| Read values of all bound controls into the internally-stored references to the underlying data.   | |
| void | RestoreConfigToControls () | 
| Restore the values from the internally-stored references to the underlying data to each bound control.   | |
Private Types | |
| enum class | WIDGET_CTRL_TYPE_T {  TEXT , TEXT_INTEGER , TEXT_DOUBLE , UNIT_BINDER , UNIT_BINDER_ANGLE , CHECKBOX , RADIOBUTTON , RADIOBOX , CHOICE , TAB }  | 
| Recognised parameters types (encodes an implicit widget type, data type and appropriate conversion).  More... | |
Private Attributes | |
| std::vector< WIDGET_CTRL_T > | m_ctrls | 
| bool & | m_valid | 
Definition at line 41 of file widget_save_restore.h.
      
  | 
  strongprivate | 
Recognised parameters types (encodes an implicit widget type, data type and appropriate conversion).
| Enumerator | |
|---|---|
| TEXT | |
| TEXT_INTEGER | |
| TEXT_DOUBLE | |
| UNIT_BINDER | |
| UNIT_BINDER_ANGLE | |
| CHECKBOX | |
| RADIOBUTTON | |
| RADIOBOX | |
| CHOICE | |
| TAB | |
Definition at line 120 of file widget_save_restore.h.
      
  | 
  inline | 
Definition at line 44 of file widget_save_restore.h.
References m_valid.
| void WIDGET_SAVE_RESTORE::Add | ( | UNIT_BINDER & | ctrl, | 
| EDA_ANGLE & | dest ) | 
Bind a control managed by a UNIT_BINDER into an angle.
Definition at line 78 of file widget_save_restore.cpp.
References m_ctrls, UNIT_BINDER, and UNIT_BINDER_ANGLE.
| void WIDGET_SAVE_RESTORE::Add | ( | UNIT_BINDER & | ctrl, | 
| long & | dest ) | 
Bind a control managed by a UNIT_BINDER into a integer.
Definition at line 72 of file widget_save_restore.cpp.
References m_ctrls, and UNIT_BINDER.
| void WIDGET_SAVE_RESTORE::Add | ( | wxCheckBox & | ctrl, | 
| bool & | dest ) | 
Bind a check box to a binary choice.
Definition at line 48 of file widget_save_restore.cpp.
| void WIDGET_SAVE_RESTORE::Add | ( | wxChoice & | ctrl, | 
| long & | dest ) | 
Bind a choice control into a choice (agnostic to the actual meaning of the choice)
Definition at line 83 of file widget_save_restore.cpp.
| void WIDGET_SAVE_RESTORE::Add | ( | wxNotebook & | ctrl, | 
| long & | dest ) | 
Bind a notebook tab choice to an integer.
Definition at line 89 of file widget_save_restore.cpp.
| void WIDGET_SAVE_RESTORE::Add | ( | wxRadioBox & | ctrl, | 
| long & | dest ) | 
Bind a radiobox to a choice.
Definition at line 36 of file widget_save_restore.cpp.
| void WIDGET_SAVE_RESTORE::Add | ( | wxRadioButton & | ctrl, | 
| bool & | dest ) | 
Bind a radio button to a binary choice.
Definition at line 42 of file widget_save_restore.cpp.
References m_ctrls, and RADIOBUTTON.
| void WIDGET_SAVE_RESTORE::Add | ( | wxTextCtrl & | ctrl, | 
| double & | dest ) | 
Bind a text ctrl to a double: the control value is converted to and from double on save/restore.
Definition at line 66 of file widget_save_restore.cpp.
References m_ctrls, and TEXT_DOUBLE.
| void WIDGET_SAVE_RESTORE::Add | ( | wxTextCtrl & | ctrl, | 
| long & | dest ) | 
Bind a text ctrl to a integer: the control value is converted to and from integer on save/restore.
Definition at line 60 of file widget_save_restore.cpp.
References m_ctrls, and TEXT_INTEGER.
| void WIDGET_SAVE_RESTORE::Add | ( | wxTextCtrl & | ctrl, | 
| wxString & | dest ) | 
Bind a text ctrl to a string: the control value is stored directly into the string.
Definition at line 54 of file widget_save_restore.cpp.
| void WIDGET_SAVE_RESTORE::ReadConfigFromControls | ( | ) | 
Read values of all bound controls into the internally-stored references to the underlying data.
Definition at line 95 of file widget_save_restore.cpp.
References CHECKBOX, CHOICE, m_ctrls, m_valid, RADIOBOX, RADIOBUTTON, TAB, TEXT, TEXT_DOUBLE, TEXT_INTEGER, UNIT_BINDER, and UNIT_BINDER_ANGLE.
| void WIDGET_SAVE_RESTORE::RestoreConfigToControls | ( | ) | 
Restore the values from the internally-stored references to the underlying data to each bound control.
Definition at line 147 of file widget_save_restore.cpp.
References CHECKBOX, CHOICE, m_ctrls, m_valid, RADIOBOX, RADIOBUTTON, TAB, TEXT, TEXT_DOUBLE, TEXT_INTEGER, UNIT_BINDER, and UNIT_BINDER_ANGLE.
      
  | 
  private | 
Definition at line 230 of file widget_save_restore.h.
Referenced by Add(), Add(), Add(), Add(), Add(), Add(), Add(), Add(), Add(), Add(), ReadConfigFromControls(), and RestoreConfigToControls().
      
  | 
  private | 
Definition at line 231 of file widget_save_restore.h.
Referenced by ReadConfigFromControls(), RestoreConfigToControls(), and WIDGET_SAVE_RESTORE().