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

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

References m_parent.

Referenced by InvokeDialogPrintPreview().

Member Function Documentation

◆ Show()

bool PLEDITOR_PREVIEW_FRAME::Show ( bool  show)
inlineoverride

Definition at line 86 of file dialogs_for_printing.cpp.

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