本文整理汇总了C++中SCH_EDIT_FRAME::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ SCH_EDIT_FRAME::GetSize方法的具体用法?C++ SCH_EDIT_FRAME::GetSize怎么用?C++ SCH_EDIT_FRAME::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCH_EDIT_FRAME
的用法示例。
在下文中一共展示了SCH_EDIT_FRAME::GetSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPrintPreview
/* Open and display a previewer frame for printing
*/
void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
{
SCH_EDIT_FRAME* parent = GetParent();
GetPrintOptions();
// Pass two printout objects: for preview, and possible printing.
wxString title = _( "Preview" );
wxPrintPreview* preview = new wxPrintPreview( new SCH_PRINTOUT( parent, title ),
new SCH_PRINTOUT( parent, title ),
&parent->GetPageSetupData().GetPrintData() );
if( preview == NULL )
{
DisplayError( this, _( "Print preview error!" ) );
return;
}
preview->SetZoom( 100 );
SCH_PREVIEW_FRAME* frame = new SCH_PREVIEW_FRAME( preview, this, title );
frame->SetMinSize( wxSize( 550, 350 ) );
// on first invocation in this runtime session, set to 2/3 size of my parent,
// but will be changed in Show() if not first time as will position.
frame->SetSize( (parent->GetSize() * 2) / 3 );
frame->Center();
// On wxGTK, set the flag wxTOPLEVEL_EX_DIALOG is mandatory, if we want
// close the frame using the X box in caption, when the preview frame is run
// from a dialog
frame->SetExtraStyle( frame->GetExtraStyle() | wxTOPLEVEL_EX_DIALOG );
// We use here wxPreviewFrame_WindowModal option to make the wxPrintPreview frame
// modal for its caller only.
// An other reason is the fact when closing the frame without this option,
// all top level frames are reenabled.
// With this option, only the parent is reenabled.
// Reenabling all top level frames should be made by the parent dialog.
frame->InitializeWithModality( wxPreviewFrame_WindowModal );
frame->Raise(); // Needed on Ubuntu/Unity to display the frame
frame->Show( true );
}