KiCad PCB EDA Suite
PANEL_EESCHEMA_ANNOTATION_OPTIONS Class Reference

#include <panel_eeschema_annotation_options.h>

Inheritance diagram for PANEL_EESCHEMA_ANNOTATION_OPTIONS:
PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_EESCHEMA_ANNOTATION_OPTIONS (wxWindow *aWindow, EDA_BASE_FRAME *schSettingsProvider)
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void ResetPanel () override
 Reset the contents of this panel. More...
 
virtual wxString GetResetTooltip () const
 Get the tooltip the reset button should display when showing this panel. More...
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }. More...
 

Protected Member Functions

virtual void OnOptionChanged (wxCommandEvent &event)
 

Protected Attributes

wxCheckBox * m_checkAutoAnnotate
 
wxCheckBox * m_checkRecursive
 
wxRadioButton * m_rbSortBy_X_Position
 
wxStaticBitmap * annotate_down_right_bitmap
 
wxRadioButton * m_rbSortBy_Y_Position
 
wxStaticBitmap * annotate_right_down_bitmap
 
wxRadioButton * m_rbFirstFree
 
wxTextCtrl * m_textNumberAfter
 
wxRadioButton * m_rbSheetX100
 
wxRadioButton * m_rbSheetX1000
 

Private Member Functions

void loadEEschemaSettings (EESCHEMA_SETTINGS *aCfg)
 

Private Attributes

EDA_BASE_FRAMEm_schSettingsProvider
 

Detailed Description

Definition at line 31 of file panel_eeschema_annotation_options.h.

Constructor & Destructor Documentation

◆ PANEL_EESCHEMA_ANNOTATION_OPTIONS()

PANEL_EESCHEMA_ANNOTATION_OPTIONS::PANEL_EESCHEMA_ANNOTATION_OPTIONS ( wxWindow *  aWindow,
EDA_BASE_FRAME schSettingsProvider 
)

Definition at line 35 of file panel_eeschema_annotation_options.cpp.

36 :
38 m_schSettingsProvider( schSettingsProvider )
39{
40}
PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

Member Function Documentation

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint &  aPt,
wxHelpEvent::Origin  aOrigin 
) const
inlineoverrideinherited

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

73 {
74 if( aPt == wxPoint( -INT_MAX, INT_MAX ) )
75 return GetResetTooltip();
76 else
77 return wxPanel::GetHelpTextAtPoint( aPt, aOrigin );
78 }
virtual wxString GetResetTooltip() const
Get the tooltip the reset button should display when showing this panel.

References RESETTABLE_PANEL::GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtualinherited

Get the tooltip the reset button should display when showing this panel.

Returns
the tooltip

Reimplemented in PANEL_COLOR_SETTINGS, and PANEL_HOTKEYS_EDITOR.

Definition at line 64 of file resettable_panel.h.

65 {
66 return _( "Reset all settings on this page to their default" );
67 }
#define _(s)

References _.

Referenced by RESETTABLE_PANEL::GetHelpTextAtPoint().

◆ loadEEschemaSettings()

void PANEL_EESCHEMA_ANNOTATION_OPTIONS::loadEEschemaSettings ( EESCHEMA_SETTINGS aCfg)
private

Definition at line 43 of file panel_eeschema_annotation_options.cpp.

44{
47
48 switch( aCfg->m_AnnotatePanel.sort_order )
49 {
50 default:
51 case 0: m_rbSortBy_X_Position->SetValue( true ); break;
52 case 1: m_rbSortBy_Y_Position->SetValue( true ); break;
53 }
54
55 switch( aCfg->m_AnnotatePanel.method )
56 {
57 default:
58 case 0: m_rbFirstFree->SetValue( true ); break;
59 case 1: m_rbSheetX100->SetValue( true ); break;
60 case 2: m_rbSheetX1000->SetValue( true ); break;
61 }
62
63
64 int annotateStartNum = 0; // Default "start after" value for annotation
65
66 // See if we can get a "start after" value from the project settings
67 SCH_EDIT_FRAME* schFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_schSettingsProvider );
68
69 if( schFrame )
70 {
71 SCHEMATIC_SETTINGS& projSettings = schFrame->Schematic().Settings();
72 annotateStartNum = projSettings.m_AnnotateStartNum;
73 }
74
75 m_textNumberAfter->SetValue( wxString::Format( wxT( "%d" ), annotateStartNum ) );
76
79}
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
@ annotate_down_right
@ annotate_right_down
PANEL_ANNOTATE m_AnnotatePanel
These settings were stored in SCH_BASE_FRAME previously.
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:172
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References annotate_down_right, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::annotate_down_right_bitmap, annotate_right_down, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::annotate_right_down_bitmap, EESCHEMA_SETTINGS::PANEL_ANNOTATE::automatic, Format(), KiBitmap(), EESCHEMA_SETTINGS::m_AnnotatePanel, SCHEMATIC_SETTINGS::m_AnnotateStartNum, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_checkAutoAnnotate, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_checkRecursive, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbFirstFree, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSheetX100, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSheetX1000, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSortBy_X_Position, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSortBy_Y_Position, m_schSettingsProvider, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_textNumberAfter, EESCHEMA_SETTINGS::PANEL_ANNOTATE::method, EESCHEMA_SETTINGS::PANEL_ANNOTATE::recursive, SCH_EDIT_FRAME::Schematic(), SCHEMATIC::Settings(), and EESCHEMA_SETTINGS::PANEL_ANNOTATE::sort_order.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ OnOptionChanged()

virtual void PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::OnOptionChanged ( wxCommandEvent &  event)
inlineprotectedvirtualinherited

◆ ResetPanel()

void PANEL_EESCHEMA_ANNOTATION_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 125 of file panel_eeschema_annotation_options.cpp.

126{
128 cfg.Load(); // Loading without a file will init to defaults
129
130 loadEEschemaSettings( &cfg );
131}
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.

References JSON_SETTINGS::Load(), and loadEEschemaSettings().

◆ TransferDataFromWindow()

bool PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 93 of file panel_eeschema_annotation_options.cpp.

94{
95 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
97
100
104
105 if( m_rbSheetX100->GetValue() )
107 else if( m_rbSheetX1000->GetValue() )
109 else
111
112
113 SCH_EDIT_FRAME* schFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_schSettingsProvider );
114
115 if( schFrame )
116 {
117 SCHEMATIC_SETTINGS& projSettings = schFrame->Schematic().Settings();
119 }
120
121 return true;
122}
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
long long int ValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: eda_units.cpp:530
@ SORT_BY_X_POSITION
Annotate by X position from left to right.
@ SORT_BY_Y_POSITION
Annotate by Y position from top to bottom.
@ SHEET_NUMBER_X_1000
Annotate using the first free reference number starting at the sheet number * 1000.
@ INCREMENTAL_BY_REF
Annotate incrementally using the first free reference number.
@ SHEET_NUMBER_X_100
Annotate using the first free reference number starting at the sheet number * 100.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References EESCHEMA_SETTINGS::PANEL_ANNOTATE::automatic, SETTINGS_MANAGER::GetAppSettings(), INCREMENTAL_BY_REF, EESCHEMA_SETTINGS::m_AnnotatePanel, SCHEMATIC_SETTINGS::m_AnnotateStartNum, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_checkAutoAnnotate, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_checkRecursive, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSheetX100, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSheetX1000, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSortBy_Y_Position, m_schSettingsProvider, PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_textNumberAfter, EESCHEMA_SETTINGS::PANEL_ANNOTATE::method, Pgm(), EESCHEMA_SETTINGS::PANEL_ANNOTATE::recursive, SHEET_NUMBER_X_100, SHEET_NUMBER_X_1000, SORT_BY_X_POSITION, SORT_BY_Y_POSITION, EESCHEMA_SETTINGS::PANEL_ANNOTATE::sort_order, and EDA_UNIT_UTILS::UI::ValueFromString().

◆ TransferDataToWindow()

bool PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataToWindow ( )
override

Definition at line 82 of file panel_eeschema_annotation_options.cpp.

83{
84 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
86
88
89 return true;
90}

References SETTINGS_MANAGER::GetAppSettings(), loadEEschemaSettings(), and Pgm().

Member Data Documentation

◆ annotate_down_right_bitmap

wxStaticBitmap* PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::annotate_down_right_bitmap
protectedinherited

◆ annotate_right_down_bitmap

wxStaticBitmap* PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::annotate_right_down_bitmap
protectedinherited

◆ m_checkAutoAnnotate

wxCheckBox* PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_checkAutoAnnotate
protectedinherited

◆ m_checkRecursive

wxCheckBox* PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_checkRecursive
protectedinherited

◆ m_rbFirstFree

◆ m_rbSheetX100

◆ m_rbSheetX1000

◆ m_rbSortBy_X_Position

wxRadioButton* PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::m_rbSortBy_X_Position
protectedinherited

◆ m_rbSortBy_Y_Position

◆ m_schSettingsProvider

EDA_BASE_FRAME* PANEL_EESCHEMA_ANNOTATION_OPTIONS::m_schSettingsProvider
private

◆ m_textNumberAfter


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