KiCad PCB EDA Suite
PLEDITOR_PREVIEW_FRAME Class Reference

Custom print preview frame. More...

Inheritance diagram for PLEDITOR_PREVIEW_FRAME:

Public Member Functions

 PLEDITOR_PREVIEW_FRAME (wxPrintPreview *aPreview, PL_EDITOR_FRAME *aParent, const wxString &aTitle, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize)
 
bool Show (bool show) override
 

Private Attributes

PL_EDITOR_FRAMEm_parent
 

Static Private Attributes

static wxPoint s_pos
 
static wxSize s_size
 

Detailed Description

Custom print preview frame.

Definition at line 71 of file dialogs_for_printing.cpp.

Constructor & Destructor Documentation

◆ PLEDITOR_PREVIEW_FRAME()

PLEDITOR_PREVIEW_FRAME::PLEDITOR_PREVIEW_FRAME ( wxPrintPreview *  aPreview,
PL_EDITOR_FRAME aParent,
const wxString &  aTitle,
const wxPoint &  aPos = wxDefaultPosition,
const wxSize &  aSize = wxDefaultSize 
)
inline

Definition at line 76 of file dialogs_for_printing.cpp.

78  :
79  wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
80  {
81  m_parent = aParent;
82  }

References m_parent.

Referenced by InvokeDialogPrintPreview().

Member Function Documentation

◆ Show()

bool PLEDITOR_PREVIEW_FRAME::Show ( bool  show)
inlineoverride

Definition at line 84 of file dialogs_for_printing.cpp.

85  {
86  bool ret;
87 
88  // Show or hide the window. If hiding, save current position and size.
89  // If showing, use previous position and size.
90  if( show )
91  {
92  bool centre = false;
93 
94  if( s_size.x == 0 || s_size.y == 0 )
95  {
96  s_size = ( m_parent->GetSize() * 3 ) / 4;
97  s_pos = wxDefaultPosition;
98  centre = true;
99  }
100 
101  SetSize( s_pos.x, s_pos.y, s_size.x, s_size.y, 0 );
102 
103  if( centre )
104  Center();
105 
106  ret = wxPreviewFrame::Show( show );
107  }
108  else
109  {
110  // Save the dialog's position & size before hiding
111  s_size = GetSize();
112  s_pos = GetPosition();
113 
114  ret = wxPreviewFrame::Show( show );
115  }
116 
117  return ret;
118  }

References PCAD2KICAD::Center, m_parent, s_pos, and s_size.

Referenced by InvokeDialogPrintPreview().

Member Data Documentation

◆ m_parent

PL_EDITOR_FRAME* PLEDITOR_PREVIEW_FRAME::m_parent
private

◆ s_pos

wxPoint PLEDITOR_PREVIEW_FRAME::s_pos
staticprivate

Definition at line 121 of file dialogs_for_printing.cpp.

Referenced by Show().

◆ s_size

wxSize PLEDITOR_PREVIEW_FRAME::s_size
staticprivate

Definition at line 122 of file dialogs_for_printing.cpp.

Referenced by Show().


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