本文整理汇总了C++中SCH_EDIT_FRAME::GetPageSetupData方法的典型用法代码示例。如果您正苦于以下问题:C++ SCH_EDIT_FRAME::GetPageSetupData方法的具体用法?C++ SCH_EDIT_FRAME::GetPageSetupData怎么用?C++ SCH_EDIT_FRAME::GetPageSetupData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCH_EDIT_FRAME
的用法示例。
在下文中一共展示了SCH_EDIT_FRAME::GetPageSetupData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TransferDataFromWindow
bool DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow()
{
SCH_EDIT_FRAME* parent = GetParent();
GetPrintOptions();
wxPrintDialogData printDialogData( parent->GetPageSetupData().GetPrintData() );
printDialogData.SetMaxPage( g_RootSheet->CountSheets() );
if( g_RootSheet->CountSheets() > 1 )
printDialogData.EnablePageNumbers( true );
wxPrinter printer( &printDialogData );
SCH_PRINTOUT printout( parent, _( "Print Schematic" ) );
// Disable 'Print' button to prevent issuing another print
// command before the previous one is finished (causes problems on Windows)
m_sdbSizer1OK->Enable( false );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
wxMessageBox( _( "An error occurred attempting to print the schematic." ),
_( "Printing" ), wxOK );
}
else
{
parent->GetPageSetupData() = printer.GetPrintDialogData().GetPrintData();
}
return true;
}
示例2: OnPrintButtonClick
void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
{
SCH_EDIT_FRAME* parent = GetParent();
GetPrintOptions();
wxPrintDialogData printDialogData( parent->GetPageSetupData().GetPrintData() );
printDialogData.SetMaxPage( g_RootSheet->CountSheets() );
if( g_RootSheet->CountSheets() > 1 )
printDialogData.EnablePageNumbers( true );
wxPrinter printer( &printDialogData );
SCH_PRINTOUT printout( parent, _( "Print Schematic" ) );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
wxMessageBox( _( "An error occurred attempting to print the schematic." ),
_( "Printing" ), wxOK );
}
else
{
parent->GetPageSetupData() = printer.GetPrintDialogData().GetPrintData();
}
}
示例3: OnPageSetup
/* Open a dialog box for printer setup (printer options, page size ...)
*/
void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event )
{
SCH_EDIT_FRAME* parent = GetParent();
wxPageSetupDialog pageSetupDialog( this, &parent->GetPageSetupData() );
pageSetupDialog.ShowModal();
parent->GetPageSetupData() = pageSetupDialog.GetPageSetupDialogData();
}
示例4: OnBeginDocument
bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
{
if( !wxPrintout::OnBeginDocument( startPage, endPage ) )
return false;
#ifdef __WXDEBUG__
wxLogDebug( wxT( "Printer name: " ) +
m_parent->GetPageSetupData().GetPrintData().GetPrinterName() );
wxLogDebug( wxT( "Paper ID: %d" ),
m_parent->GetPageSetupData().GetPrintData().GetPaperId() );
wxLogDebug( wxT( "Color: %d" ),
(int)m_parent->GetPageSetupData().GetPrintData().GetColour() );
wxLogDebug( wxT( "Monochrome: %d" ), m_parent->GetPrintMonochrome() );
wxLogDebug( wxT( "Orientation: %d:" ),
m_parent->GetPageSetupData().GetPrintData().GetOrientation() );
wxLogDebug( wxT( "Quality: %d"),
m_parent->GetPageSetupData().GetPrintData().GetQuality() );
#endif
return true;
}
示例5: 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 );
}
示例6: TransferDataToWindow
bool DIALOG_PRINT_USING_PRINTER::TransferDataToWindow()
{
SCH_EDIT_FRAME* parent = GetParent();
// Initialize page specific print setup dialog settings.
const PAGE_INFO& pageInfo = parent->GetScreen()->GetPageSettings();
wxPageSetupDialogData& pageSetupDialogData = parent->GetPageSetupData();
pageSetupDialogData.SetPaperId( pageInfo.GetPaperId() );
if( pageInfo.IsCustom() )
{
if( pageInfo.IsPortrait() )
pageSetupDialogData.SetPaperSize( wxSize( Mils2mm( pageInfo.GetWidthMils() ),
Mils2mm( pageInfo.GetHeightMils() ) ) );
else
pageSetupDialogData.SetPaperSize( wxSize( Mils2mm( pageInfo.GetHeightMils() ),
Mils2mm( pageInfo.GetWidthMils() ) ) );
}
pageSetupDialogData.GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
return true;
}
示例7: initDialog
void DIALOG_PRINT_USING_PRINTER::initDialog()
{
SCH_EDIT_FRAME* parent = GetParent();
// Initialize page specific print setup dialog settings.
const PAGE_INFO& pageInfo = parent->GetScreen()->GetPageSettings();
wxPageSetupDialogData& pageSetupDialogData = parent->GetPageSetupData();
pageSetupDialogData.SetPaperId( pageInfo.GetPaperId() );
if( pageInfo.IsCustom() )
{
if( pageInfo.IsPortrait() )
pageSetupDialogData.SetPaperSize( wxSize( Mils2mm( pageInfo.GetWidthMils() ),
Mils2mm( pageInfo.GetHeightMils() ) ) );
else
pageSetupDialogData.SetPaperSize( wxSize( Mils2mm( pageInfo.GetHeightMils() ),
Mils2mm( pageInfo.GetWidthMils() ) ) );
}
pageSetupDialogData.GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
if ( GetSizer() )
GetSizer()->SetSizeHints( this );
// Rely on the policy in class DIALOG_SHIM, which centers the dialog
// initially during a runtime session but gives user the ability to move it in
// that session.
// This dialog may get moved and resized in Show(), but in case this is
// the first time, center it for starters.
Center();
m_buttonPrint->SetDefault(); // on linux, this is inadequate to determine
// what ENTER does. Must also SetFocus().
m_buttonPrint->SetFocus();
}