KiCad PCB EDA Suite
CHANGED_HOTKEY Class Reference

Class that manages a hotkey that can be changed, reset to its old value, a default or saved. More...

#include <hotkey_store.h>

Public Member Functions

 CHANGED_HOTKEY (EDA_HOTKEY &aHotkey, const wxString &aTag)
 
EDA_HOTKEYGetCurrentValue ()
 
const EDA_HOTKEYGetCurrentValue () const
 
const EDA_HOTKEYGetOriginalValue () const
 Gets the original value of the hotkey. More...
 
void SaveHotkey ()
 Save changed hotkey to the original location. More...
 
bool HasUnsavedChange () const
 Return true if the hotkey doesn't match the original (i.e. More...
 
const wxString & GetSectionTag () const
 

Private Attributes

EDA_HOTKEYm_orig
 
EDA_HOTKEY m_changed
 
const wxString & m_tag
 

Detailed Description

Class that manages a hotkey that can be changed, reset to its old value, a default or saved.

Definition at line 39 of file hotkey_store.h.

Constructor & Destructor Documentation

◆ CHANGED_HOTKEY()

CHANGED_HOTKEY::CHANGED_HOTKEY ( EDA_HOTKEY aHotkey,
const wxString &  aTag 
)
inline

Definition at line 42 of file hotkey_store.h.

42  :
43  m_orig( aHotkey ),
44  m_changed( aHotkey ),
45  m_tag( aTag )
46  {}
EDA_HOTKEY m_changed
Definition: hotkey_store.h:96
EDA_HOTKEY & m_orig
Definition: hotkey_store.h:93
const wxString & m_tag
Definition: hotkey_store.h:99

Member Function Documentation

◆ GetCurrentValue() [1/2]

EDA_HOTKEY& CHANGED_HOTKEY::GetCurrentValue ( )
inline

Definition at line 48 of file hotkey_store.h.

49  {
50  return m_changed;
51  }
EDA_HOTKEY m_changed
Definition: hotkey_store.h:96

References m_changed.

Referenced by WIDGET_HOTKEY_LIST::changeHotkey(), and HOTKEY_STORE::FindHotkey().

◆ GetCurrentValue() [2/2]

const EDA_HOTKEY& CHANGED_HOTKEY::GetCurrentValue ( ) const
inline

Definition at line 53 of file hotkey_store.h.

54  {
55  return m_changed;
56  }
EDA_HOTKEY m_changed
Definition: hotkey_store.h:96

References m_changed.

◆ GetOriginalValue()

const EDA_HOTKEY& CHANGED_HOTKEY::GetOriginalValue ( ) const
inline

Gets the original value of the hotkey.

This is what the hotkey used to be, and what it would be set to if reset.

Returns
reference to the original hotkey.

Definition at line 64 of file hotkey_store.h.

65  {
66  return m_orig;
67  }
EDA_HOTKEY & m_orig
Definition: hotkey_store.h:93

References m_orig.

Referenced by WIDGET_HOTKEY_LIST::ResetItem().

◆ GetSectionTag()

const wxString& CHANGED_HOTKEY::GetSectionTag ( ) const
inline

Definition at line 86 of file hotkey_store.h.

87  {
88  return m_tag;
89  }
const wxString & m_tag
Definition: hotkey_store.h:99

References m_tag.

Referenced by WIDGET_HOTKEY_LIST::changeHotkey().

◆ HasUnsavedChange()

bool CHANGED_HOTKEY::HasUnsavedChange ( ) const
inline

Return true if the hotkey doesn't match the original (i.e.

it has been changed)

Definition at line 81 of file hotkey_store.h.

82  {
84  }
EDA_HOTKEY m_changed
Definition: hotkey_store.h:96
EDA_HOTKEY & m_orig
Definition: hotkey_store.h:93

References m_changed, EDA_HOTKEY::m_KeyCode, and m_orig.

◆ SaveHotkey()

void CHANGED_HOTKEY::SaveHotkey ( )
inline

Save changed hotkey to the original location.

Definition at line 72 of file hotkey_store.h.

73  {
74  m_orig = m_changed;
75  }
EDA_HOTKEY m_changed
Definition: hotkey_store.h:96
EDA_HOTKEY & m_orig
Definition: hotkey_store.h:93

References m_changed, and m_orig.

Member Data Documentation

◆ m_changed

EDA_HOTKEY CHANGED_HOTKEY::m_changed
private

Definition at line 96 of file hotkey_store.h.

Referenced by GetCurrentValue(), HasUnsavedChange(), and SaveHotkey().

◆ m_orig

EDA_HOTKEY& CHANGED_HOTKEY::m_orig
private

Definition at line 93 of file hotkey_store.h.

Referenced by GetOriginalValue(), HasUnsavedChange(), and SaveHotkey().

◆ m_tag

const wxString& CHANGED_HOTKEY::m_tag
private

Definition at line 99 of file hotkey_store.h.

Referenced by GetSectionTag().


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