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 67 of file dialogs_for_printing.cpp.

Constructor & Destructor Documentation

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 72 of file dialogs_for_printing.cpp.

Referenced by InvokeDialogPrintPreview().

74  :
75  wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
76  {
77  m_parent = aParent;
78  }

Member Function Documentation

bool PLEDITOR_PREVIEW_FRAME::Show ( bool  show)
inlineoverride

Definition at line 80 of file dialogs_for_printing.cpp.

References PCAD2KICAD::Center, s_pos, s_size, wxPoint::x, and wxPoint::y.

Referenced by InvokeDialogPrintPreview().

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

Member Data Documentation

PL_EDITOR_FRAME* PLEDITOR_PREVIEW_FRAME::m_parent
private

Definition at line 69 of file dialogs_for_printing.cpp.

wxPoint PLEDITOR_PREVIEW_FRAME::s_pos
staticprivate

Definition at line 115 of file dialogs_for_printing.cpp.

Referenced by Show().

wxSize PLEDITOR_PREVIEW_FRAME::s_size
staticprivate

Definition at line 116 of file dialogs_for_printing.cpp.

Referenced by Show().


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