KiCad PCB EDA Suite
PANEL_EESCHEMA_DISPLAY_OPTIONS Class Reference

#include <panel_eeschema_display_options.h>

Inheritance diagram for PANEL_EESCHEMA_DISPLAY_OPTIONS:
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE

Public Member Functions

 PANEL_EESCHEMA_DISPLAY_OPTIONS (SCH_EDIT_FRAME *aFrame, wxWindow *aWindow)
 

Protected Attributes

wxBoxSizer * m_galOptionsSizer
 
wxStaticText * m_busWidthLabel
 
wxTextCtrl * m_busWidthCtrl
 
wxStaticText * m_busWidthUnits
 
wxStaticText * m_lineWidthLabel
 
wxTextCtrl * m_lineWidthCtrl
 
wxStaticText * m_lineWidthUnits
 
wxStaticText * m_jctSizeLabel
 
wxTextCtrl * m_jctSizeCtrl
 
wxStaticText * m_jctSizeUnits
 
wxStaticText * m_staticText26
 
wxChoice * m_choiceSeparatorRefId
 
wxCheckBox * m_checkShowHiddenPins
 
wxCheckBox * m_checkPageLimits
 

Private Member Functions

bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 

Private Attributes

SCH_EDIT_FRAMEm_frame
 
GAL_OPTIONS_PANELm_galOptsPanel
 

Detailed Description

Definition at line 29 of file panel_eeschema_display_options.h.

Constructor & Destructor Documentation

PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS ( SCH_EDIT_FRAME aFrame,
wxWindow *  aWindow 
)

Definition at line 35 of file panel_eeschema_display_options.cpp.

References EDA_DRAW_FRAME::GetGalDisplayOptions(), m_frame, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_galOptionsSizer, and m_galOptsPanel.

36  :
38  m_frame( aFrame )
39 {
41  m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
42 
43  m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
44 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:936
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL)

Member Function Documentation

bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow ( )
overrideprivate

Definition at line 75 of file panel_eeschema_display_options.cpp.

References SCH_BASE_FRAME::GetCanvas(), SCH_BASE_FRAME::GetRenderSettings(), LIB_PART::GetSubpartFirstId(), LIB_PART::GetSubpartIdSeparator(), SCH_DRAW_PANEL::GetView(), INCHES, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_busWidthCtrl, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkPageLimits, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenPins, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_choiceSeparatorRefId, m_frame, m_galOptsPanel, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_jctSizeCtrl, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_lineWidthCtrl, KIGFX::SCH_RENDER_SETTINGS::m_ShowHiddenPins, KIGFX::VIEW::MarkDirty(), SCH_DRAW_PANEL::Refresh(), SCH_EDIT_FRAME::SaveProjectSettings(), SetDefaultBusThickness(), SetDefaultLineThickness(), SCH_EDIT_FRAME::SetShowAllPins(), KIGFX::RENDER_SETTINGS::SetShowPageLimits(), EDA_DRAW_FRAME::SetShowPageLimits(), LIB_PART::SetSubpartIdNotation(), SCH_JUNCTION::SetSymbolSize(), GAL_OPTIONS_PANEL::TransferDataFromWindow(), and ValueFromString().

76 {
77  // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
78  int firstRefId, refSeparator;
79 
80  switch( m_choiceSeparatorRefId->GetSelection() )
81  {
82  default:
83  case 0: firstRefId = 'A'; refSeparator = 0; break;
84  case 1: firstRefId = 'A'; refSeparator = '.'; break;
85  case 2: firstRefId = 'A'; refSeparator = '-'; break;
86  case 3: firstRefId = 'A'; refSeparator = '_'; break;
87  case 4: firstRefId = '1'; refSeparator = '.'; break;
88  case 5: firstRefId = '1'; refSeparator = '-'; break;
89  case 6: firstRefId = '1'; refSeparator = '_'; break;
90  }
91 
92  if( refSeparator != LIB_PART::GetSubpartIdSeparator() ||
93  firstRefId != LIB_PART::GetSubpartFirstId() )
94  {
95  LIB_PART::SetSubpartIdNotation( refSeparator, firstRefId );
96  m_frame->SaveProjectSettings( false );
97  }
98 
104 
105  // Update canvas
109  m_frame->GetCanvas()->Refresh();
110 
112 
113  return true;
114 }
void SetDefaultBusThickness(int aThickness)
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue, bool aUseMils)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:409
void SaveProjectSettings(bool aAskForSave) override
Save changes to the project settings to the project (.pro) file.
static void SetSymbolSize(int aSize)
Definition: sch_junction.h:54
void SetDefaultLineThickness(int aThickness)
static int GetSubpartIdSeparator()
static int GetSubpartFirstId()
Definition: common.h:160
SCH_DRAW_PANEL * GetCanvas() const override
KIGFX::SCH_VIEW * GetView() const
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or &#39;...
void SetShowPageLimits(bool aShow)
Definition: draw_frame.h:386
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void SetShowAllPins(bool aEnable)
void SetShowPageLimits(bool aDraw)
Definition: painter.h:186
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow ( )
overrideprivate

Definition at line 47 of file panel_eeschema_display_options.cpp.

References GetDefaultBusThickness(), GetDefaultLineThickness(), SCH_EDIT_FRAME::GetShowAllPins(), LIB_PART::GetSubpartFirstId(), LIB_PART::GetSubpartIdSeparator(), SCH_JUNCTION::GetSymbolSize(), INCHES, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_busWidthCtrl, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkPageLimits, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenPins, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_choiceSeparatorRefId, m_frame, m_galOptsPanel, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_jctSizeCtrl, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_lineWidthCtrl, EDA_DRAW_FRAME::ShowPageLimits(), StringFromValue(), and GAL_OPTIONS_PANEL::TransferDataToWindow().

48 {
49  // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
50  int refStyleSelection;
51 
53  {
54  default:
55  case 0: refStyleSelection = 0; break;
56  case '.': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 4 : 1; break;
57  case '-': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 5 : 2; break;
58  case '_': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 6 : 3; break;
59  }
60 
61  m_choiceSeparatorRefId->SetSelection( refStyleSelection );
62 
63  m_busWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultBusThickness(), false, true ) );
64  m_lineWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) );
65  m_jctSizeCtrl->SetValue( StringFromValue( INCHES, SCH_JUNCTION::GetSymbolSize(), false, true ) );
68 
70 
71  return true;
72 }
bool ShowPageLimits() const
Definition: draw_frame.h:385
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
static int GetSubpartIdSeparator()
bool TransferDataToWindow() override
Load the panel controls from the given opt.
static int GetSubpartFirstId()
bool GetShowAllPins() const
Definition: common.h:160
static int GetSymbolSize()
Definition: sch_junction.h:53
wxString StringFromValue(EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:210
int GetDefaultBusThickness()
Default line thickness used to draw/plot busses.

Member Data Documentation

wxTextCtrl* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_busWidthCtrl
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_busWidthLabel
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_busWidthUnits
protectedinherited
wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkPageLimits
protectedinherited
wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenPins
protectedinherited
wxChoice* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_choiceSeparatorRefId
protectedinherited
SCH_EDIT_FRAME* PANEL_EESCHEMA_DISPLAY_OPTIONS::m_frame
private
wxBoxSizer* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_galOptionsSizer
protectedinherited
GAL_OPTIONS_PANEL* PANEL_EESCHEMA_DISPLAY_OPTIONS::m_galOptsPanel
private
wxTextCtrl* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_jctSizeCtrl
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_jctSizeLabel
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_jctSizeUnits
protectedinherited
wxTextCtrl* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_lineWidthCtrl
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_lineWidthLabel
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_lineWidthUnits
protectedinherited
wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_staticText26
protectedinherited

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