KiCad PCB EDA Suite
PANEL_PCBNEW_DISPLAY_ORIGIN Class Reference

#include <panel_pcbnew_display_origin.h>

Inheritance diagram for PANEL_PCBNEW_DISPLAY_ORIGIN:
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE

Public Member Functions

 PANEL_PCBNEW_DISPLAY_ORIGIN (PCB_EDIT_FRAME *aFrame, PAGED_DIALOG *aWindow)
 

Protected Member Functions

bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 

Protected Attributes

wxRadioBox * m_DisplayOrigin
 
wxRadioBox * m_XAxisDirection
 
wxRadioBox * m_YAxisDirection
 

Private Attributes

PCB_EDIT_FRAMEm_Frame
 

Detailed Description

Definition at line 33 of file panel_pcbnew_display_origin.h.

Constructor & Destructor Documentation

◆ PANEL_PCBNEW_DISPLAY_ORIGIN()

PANEL_PCBNEW_DISPLAY_ORIGIN::PANEL_PCBNEW_DISPLAY_ORIGIN ( PCB_EDIT_FRAME aFrame,
PAGED_DIALOG aWindow 
)

Definition at line 37 of file panel_pcbnew_display_origin.cpp.

39  : PANEL_PCBNEW_DISPLAY_ORIGIN_BASE( aParent->GetTreebook() ),
40  m_Frame( aFrame )
41 {
42 }
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

Member Function Documentation

◆ TransferDataFromWindow()

bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataFromWindow ( )
overrideprotected

Definition at line 66 of file panel_pcbnew_display_origin.cpp.

67 {
69 
70  switch( m_DisplayOrigin->GetSelection() )
71  {
72  case 0: displ_opts.m_DisplayOrigin = PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE; break;
73  case 1: displ_opts.m_DisplayOrigin = PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX; break;
74  case 2: displ_opts.m_DisplayOrigin = PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID; break;
75  }
76 
77  displ_opts.m_DisplayInvertXAxis = m_XAxisDirection->GetSelection() != 0;
78  displ_opts.m_DisplayInvertYAxis = m_YAxisDirection->GetSelection() == 0;
79 
80  m_Frame->SetDisplayOptions( displ_opts );
81 
82  return true;
83 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions, bool aRefresh=true)
Updates the current display options from the given options struct.
Container for display options like enable/disable some optional drawings.
PCB_DISPLAY_ORIGIN_OPTIONS_T m_DisplayOrigin
Which origin is used for display transforms.

References PCB_BASE_FRAME::GetDisplayOptions(), PCB_DISPLAY_OPTIONS::m_DisplayInvertXAxis, PCB_DISPLAY_OPTIONS::m_DisplayInvertYAxis, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_DisplayOrigin, PCB_DISPLAY_OPTIONS::m_DisplayOrigin, m_Frame, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_XAxisDirection, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_YAxisDirection, PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX, PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID, PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE, and PCB_BASE_FRAME::SetDisplayOptions().

◆ TransferDataToWindow()

bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataToWindow ( )
overrideprotected

Definition at line 45 of file panel_pcbnew_display_origin.cpp.

46 {
47  const PCB_DISPLAY_OPTIONS& displ_opts = m_Frame->GetDisplayOptions();
48 
49  int origin = 0;
50 
51  switch( displ_opts.m_DisplayOrigin )
52  {
53  case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: origin = 0; break;
54  case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = 1; break;
55  case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID: origin = 2; break;
56  }
57 
58  m_DisplayOrigin->SetSelection( origin );
59  m_XAxisDirection->SetSelection( displ_opts.m_DisplayInvertXAxis ? 1 : 0 );
60  m_YAxisDirection->SetSelection( displ_opts.m_DisplayInvertYAxis ? 0 : 1 );
61 
62  return true;
63 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
Container for display options like enable/disable some optional drawings.
PCB_DISPLAY_ORIGIN_OPTIONS_T m_DisplayOrigin
Which origin is used for display transforms.

References PCB_BASE_FRAME::GetDisplayOptions(), PCB_DISPLAY_OPTIONS::m_DisplayInvertXAxis, PCB_DISPLAY_OPTIONS::m_DisplayInvertYAxis, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_DisplayOrigin, PCB_DISPLAY_OPTIONS::m_DisplayOrigin, m_Frame, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_XAxisDirection, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_YAxisDirection, PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX, PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID, and PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE.

Member Data Documentation

◆ m_DisplayOrigin

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_DisplayOrigin
protectedinherited

◆ m_Frame

PCB_EDIT_FRAME* PANEL_PCBNEW_DISPLAY_ORIGIN::m_Frame
private

Definition at line 43 of file panel_pcbnew_display_origin.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

◆ m_XAxisDirection

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_XAxisDirection
protectedinherited

◆ m_YAxisDirection

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_YAxisDirection
protectedinherited

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