KiCad PCB EDA Suite
PANEL_GERBVIEW_DISPLAY_OPTIONS Class Reference

#include <panel_gerbview_display_options.h>

Inheritance diagram for PANEL_GERBVIEW_DISPLAY_OPTIONS:
PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_GERBVIEW_DISPLAY_OPTIONS (wxWindow *aParent)
 
 ~PANEL_GERBVIEW_DISPLAY_OPTIONS ()
 
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 Attributes

wxBoxSizer * m_UpperSizer
 
wxBoxSizer * m_galOptionsSizer
 
wxStaticText * m_staticText1
 
wxStaticLine * m_staticline1
 
wxCheckBox * m_OptDisplayDCodes
 
wxCheckBox * m_ShowPageLimitsOpt
 
wxStaticText * m_staticText2
 
wxStaticLine * m_staticline2
 
wxCheckBox * m_OptDisplayFlashedItems
 
wxCheckBox * m_OptDisplayLines
 
wxCheckBox * m_OptDisplayPolygons
 
wxStaticText * m_staticText3
 
wxStaticLine * m_staticline3
 
wxRadioBox * m_PageSize
 

Private Member Functions

void loadSettings (GERBVIEW_SETTINGS *aCfg)
 

Private Attributes

GAL_OPTIONS_PANELm_galOptsPanel
 

Detailed Description

Definition at line 33 of file panel_gerbview_display_options.h.

Constructor & Destructor Documentation

◆ PANEL_GERBVIEW_DISPLAY_OPTIONS()

PANEL_GERBVIEW_DISPLAY_OPTIONS::PANEL_GERBVIEW_DISPLAY_OPTIONS ( wxWindow *  aParent)

Definition at line 43 of file panel_gerbview_display_options.cpp.

43 :
44 PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( aParent, wxID_ANY )
45{
46 GERBVIEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
47
48 m_galOptsPanel = new GAL_OPTIONS_PANEL( this, cfg );
49 m_galOptionsSizer->Add( m_galOptsPanel, 0, wxEXPAND | wxLEFT, 5 );
50}
PANEL_GERBVIEW_DISPLAY_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)
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_galOptionsSizer, m_galOptsPanel, and Pgm().

◆ ~PANEL_GERBVIEW_DISPLAY_OPTIONS()

PANEL_GERBVIEW_DISPLAY_OPTIONS::~PANEL_GERBVIEW_DISPLAY_OPTIONS ( )
inline

Definition at line 37 of file panel_gerbview_display_options.h.

37{};

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().

◆ loadSettings()

void PANEL_GERBVIEW_DISPLAY_OPTIONS::loadSettings ( GERBVIEW_SETTINGS aCfg)
private

Definition at line 53 of file panel_gerbview_display_options.cpp.

54{
55 // Show Option Draw polygons
57
58 // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
62
63 for( unsigned i = 0; i < arrayDim( gerberPageSizeList ); ++i )
64 {
66 {
67 m_PageSize->SetSelection( i );
68 break;
69 }
70 }
71
73}
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
GBR_DISPLAY_OPTIONS m_Display
static const wxChar * gerberPageSizeList[]
List of page sizes.

References arrayDim(), gerberPageSizeList, GERBVIEW_SETTINGS::m_Appearance, GERBVIEW_SETTINGS::m_Display, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayPageLimits, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_PageSize, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_ShowPageLimitsOpt, GERBVIEW_SETTINGS::APPEARANCE::page_type, and GERBVIEW_SETTINGS::APPEARANCE::show_dcodes.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_GERBVIEW_DISPLAY_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 106 of file panel_gerbview_display_options.cpp.

107{
109 cfg.Load(); // Loading without a file will init to defaults
110
111 loadSettings( &cfg );
112
113 m_galOptsPanel->ResetPanel( &cfg );
114}
bool ResetPanel(APP_SETTINGS_BASE *aAppSettings)
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
void loadSettings(GERBVIEW_SETTINGS *aCfg)

References JSON_SETTINGS::Load(), loadSettings(), m_galOptsPanel, and GAL_OPTIONS_PANEL::ResetPanel().

◆ TransferDataFromWindow()

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 88 of file panel_gerbview_display_options.cpp.

89{
90 GERBVIEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
91
93
98
99 cfg->m_Appearance.page_type = gerberPageSizeList[ m_PageSize->GetSelection() ];
101
102 return true;
103}
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.

References gerberPageSizeList, GERBVIEW_SETTINGS::m_Appearance, GERBVIEW_SETTINGS::m_Display, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayPageLimits, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, m_galOptsPanel, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_PageSize, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_ShowPageLimitsOpt, GERBVIEW_SETTINGS::APPEARANCE::page_type, Pgm(), GERBVIEW_SETTINGS::APPEARANCE::show_dcodes, and GAL_OPTIONS_PANEL::TransferDataFromWindow().

◆ TransferDataToWindow()

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow ( )
override

Definition at line 76 of file panel_gerbview_display_options.cpp.

77{
79
80 GERBVIEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
81
82 loadSettings( cfg );
83
84 return true;
85}
bool TransferDataToWindow() override
Load the panel controls from the given opt.

References loadSettings(), m_galOptsPanel, Pgm(), and GAL_OPTIONS_PANEL::TransferDataToWindow().

Member Data Documentation

◆ m_galOptionsSizer

wxBoxSizer* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_galOptionsSizer
protectedinherited

◆ m_galOptsPanel

GAL_OPTIONS_PANEL* PANEL_GERBVIEW_DISPLAY_OPTIONS::m_galOptsPanel
private

◆ m_OptDisplayDCodes

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes
protectedinherited

◆ m_OptDisplayFlashedItems

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems
protectedinherited

◆ m_OptDisplayLines

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines
protectedinherited

◆ m_OptDisplayPolygons

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons
protectedinherited

◆ m_PageSize

wxRadioBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_PageSize
protectedinherited

◆ m_ShowPageLimitsOpt

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_ShowPageLimitsOpt
protectedinherited

◆ m_staticline1

wxStaticLine* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_staticline1
protectedinherited

◆ m_staticline2

wxStaticLine* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_staticline2
protectedinherited

◆ m_staticline3

wxStaticLine* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_staticline3
protectedinherited

◆ m_staticText1

wxStaticText* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_staticText1
protectedinherited

◆ m_staticText2

wxStaticText* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_staticText2
protectedinherited

◆ m_staticText3

wxStaticText* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_staticText3
protectedinherited

◆ m_UpperSizer

wxBoxSizer* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_UpperSizer
protectedinherited

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