mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Print dlgs: add panel printer to select the current printer. Windows only
Other platforms show the available printers in print dialog.
This commit is contained in:
parent
0201e7286c
commit
8a5b71a01b
@ -404,6 +404,9 @@ set( COMMON_DLG_SRCS
|
|||||||
dialogs/panel_plugin_settings.cpp
|
dialogs/panel_plugin_settings.cpp
|
||||||
dialogs/panel_plugin_settings_base.cpp
|
dialogs/panel_plugin_settings_base.cpp
|
||||||
dialogs/panel_setup_netclasses.cpp
|
dialogs/panel_setup_netclasses.cpp
|
||||||
|
dialogs/panel_printer_list.cpp
|
||||||
|
dialogs/panel_printer_list_base.cpp
|
||||||
|
|
||||||
dialogs/panel_setup_netclasses_base.cpp
|
dialogs/panel_setup_netclasses_base.cpp
|
||||||
dialogs/panel_setup_severities.cpp
|
dialogs/panel_setup_severities.cpp
|
||||||
dialogs/panel_text_variables.cpp
|
dialogs/panel_text_variables.cpp
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include <wx/print.h>
|
#include <wx/print.h>
|
||||||
#include <wx/printdlg.h>
|
#include <wx/printdlg.h>
|
||||||
|
|
||||||
|
#include <dialogs/panel_printer_list.h>
|
||||||
|
|
||||||
// Define min and max reasonable values for print scale
|
// Define min and max reasonable values for print scale
|
||||||
static constexpr double MIN_SCALE = 0.01;
|
static constexpr double MIN_SCALE = 0.01;
|
||||||
static constexpr double MAX_SCALE = 100.0;
|
static constexpr double MAX_SCALE = 100.0;
|
||||||
@ -93,6 +95,9 @@ DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SE
|
|||||||
m_scaleValidator.SetRange( 0.0, MAX_SCALE );
|
m_scaleValidator.SetRange( 0.0, MAX_SCALE );
|
||||||
m_scaleCustomText->SetValidator( m_scaleValidator );
|
m_scaleCustomText->SetValidator( m_scaleValidator );
|
||||||
|
|
||||||
|
// Show m_panelPrinters only if there are printers to list:
|
||||||
|
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
|
||||||
|
|
||||||
SetupStandardButtons( { { wxID_OK, _( "Print" ) },
|
SetupStandardButtons( { { wxID_OK, _( "Print" ) },
|
||||||
{ wxID_APPLY, _( "Print Preview" ) },
|
{ wxID_APPLY, _( "Print Preview" ) },
|
||||||
{ wxID_CANCEL, _( "Close" ) } } );
|
{ wxID_CANCEL, _( "Close" ) } } );
|
||||||
@ -245,6 +250,13 @@ void DIALOG_PRINT_GENERIC::onPrintPreview( wxCommandEvent& event )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString selectedPrinterName;
|
||||||
|
|
||||||
|
if( m_panelPrinters )
|
||||||
|
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||||
|
|
||||||
|
s_PrintData->SetPrinterName( selectedPrinterName );
|
||||||
|
|
||||||
// Pass two printout objects: for preview, and possible printing.
|
// Pass two printout objects: for preview, and possible printing.
|
||||||
wxString title = _( "Print Preview" );
|
wxString title = _( "Print Preview" );
|
||||||
wxPrintPreview* preview =
|
wxPrintPreview* preview =
|
||||||
@ -296,6 +308,13 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString selectedPrinterName;
|
||||||
|
|
||||||
|
if( m_panelPrinters )
|
||||||
|
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||||
|
|
||||||
|
s_PrintData->SetPrinterName( selectedPrinterName );
|
||||||
|
|
||||||
wxPrintDialogData printDialogData( *s_PrintData );
|
wxPrintDialogData printDialogData( *s_PrintData );
|
||||||
printDialogData.SetMaxPage( m_settings->m_pageCount );
|
printDialogData.SetMaxPage( m_settings->m_pageCount );
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "dialogs/panel_printer_list.h"
|
||||||
|
|
||||||
#include "dialog_print_generic_base.h"
|
#include "dialog_print_generic_base.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@ -16,6 +18,15 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
|
|||||||
wxBoxSizer* bMainSizer;
|
wxBoxSizer* bMainSizer;
|
||||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
wxBoxSizer* bSizerPanelPrinters;
|
||||||
|
bSizerPanelPrinters = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_panelPrinters = new PANEL_PRINTER_LIST( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
|
bSizerPanelPrinters->Add( m_panelPrinters, 1, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bMainSizer->Add( bSizerPanelPrinters, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
m_bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
wxBoxSizer* bRightCol;
|
wxBoxSizer* bRightCol;
|
||||||
|
@ -65,6 +65,75 @@
|
|||||||
<property name="name">bMainSizer</property>
|
<property name="name">bMainSizer</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="true">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxBoxSizer" expanded="true">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">bSizerPanelPrinters</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="true">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND | wxALL</property>
|
||||||
|
<property name="proportion">1</property>
|
||||||
|
<object class="wxPanel" expanded="true">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer">0</property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position">0</property>
|
||||||
|
<property name="aui_row">0</property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="drag_accept_files">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_panelPrinters</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="subclass">PANEL_PRINTER_LIST; dialogs/panel_printer_list.h; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
<object class="sizeritem" expanded="true">
|
<object class="sizeritem" expanded="true">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND|wxALL</property>
|
<property name="flag">wxEXPAND|wxALL</property>
|
||||||
|
@ -10,17 +10,20 @@
|
|||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
class PANEL_PRINTER_LIST;
|
||||||
|
|
||||||
#include "dialog_shim.h"
|
#include "dialog_shim.h"
|
||||||
#include <wx/string.h>
|
#include <wx/panel.h>
|
||||||
#include <wx/stattext.h>
|
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
|
#include <wx/string.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/stattext.h>
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/gbsizer.h>
|
#include <wx/gbsizer.h>
|
||||||
#include <wx/sizer.h>
|
|
||||||
#include <wx/statbox.h>
|
#include <wx/statbox.h>
|
||||||
#include <wx/radiobut.h>
|
#include <wx/radiobut.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
@ -46,6 +49,7 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
|
|||||||
wxID_PRINT_OPTIONS,
|
wxID_PRINT_OPTIONS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PANEL_PRINTER_LIST* m_panelPrinters;
|
||||||
wxBoxSizer* m_bUpperSizer;
|
wxBoxSizer* m_bUpperSizer;
|
||||||
wxStaticBoxSizer* m_sbOptionsSizer;
|
wxStaticBoxSizer* m_sbOptionsSizer;
|
||||||
wxGridBagSizer* m_gbOptionsSizer;
|
wxGridBagSizer* m_gbOptionsSizer;
|
||||||
|
194
common/dialogs/panel_printer_list.cpp
Normal file
194
common/dialogs/panel_printer_list.cpp
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
|
* Copyright (C) KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dialogs/panel_printer_list.h>
|
||||||
|
|
||||||
|
// Define CUPS_LIST_PRINTERS to allow printer selection in PANEL_PRINTER_LIST
|
||||||
|
// on Unices. It needs cups and cups dev files
|
||||||
|
// Currently not tested and not finished for cups, so disable it
|
||||||
|
// However the code (from wxWidgets forum) is kept here, just in case
|
||||||
|
//#define CUPS_LIST_PRINTERS
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
#include <Windows.h>
|
||||||
|
#elif defined( CUPS_LIST_PRINTERS )
|
||||||
|
#include <cups/cups.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// GetPrinterList code comes from samples on:
|
||||||
|
// https://forums.wxwidgets.org/viewtopic.php?t=13251
|
||||||
|
// https://forums.wxwidgets.org/viewtopic.php?t=43930
|
||||||
|
static bool GetPrinterList(wxArrayString &aPrinterList, wxString &aDefaultPrinterName)
|
||||||
|
{
|
||||||
|
aPrinterList.Empty();
|
||||||
|
aDefaultPrinterName.Empty();
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
DWORD dwSize, dwPrinters;
|
||||||
|
BYTE *pBuffer;
|
||||||
|
|
||||||
|
DWORD szz = 255;
|
||||||
|
WCHAR c[256];
|
||||||
|
GetDefaultPrinter(&c[0], &szz);
|
||||||
|
aDefaultPrinterName = c;
|
||||||
|
|
||||||
|
::EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &dwSize, &dwPrinters);
|
||||||
|
|
||||||
|
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER || dwSize == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
pBuffer = new BYTE[dwSize];
|
||||||
|
::EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 5, pBuffer, dwSize, &dwSize, &dwPrinters);
|
||||||
|
|
||||||
|
if (dwPrinters != 0)
|
||||||
|
{
|
||||||
|
PRINTER_INFO_5 *pPrnInfo = (PRINTER_INFO_5 *)pBuffer;
|
||||||
|
|
||||||
|
for (UINT i = 0; i < dwPrinters; i++)
|
||||||
|
{
|
||||||
|
aPrinterList.Add(pPrnInfo->pPrinterName);
|
||||||
|
pPrnInfo++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pBuffer)
|
||||||
|
{
|
||||||
|
delete[] pBuffer;
|
||||||
|
pBuffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
#elif defined( CUPS_LIST_PRINTERS )
|
||||||
|
cups_dest_t* dests;
|
||||||
|
int num_dests = cupsGetDests(&dests);
|
||||||
|
|
||||||
|
for (int i = 0; i < num_dests; i++)
|
||||||
|
{
|
||||||
|
wxString sz;
|
||||||
|
|
||||||
|
if (dests[i].instance)
|
||||||
|
sz = wxString::Format("%s%s", dests[i].name, dests[i].instance);
|
||||||
|
else
|
||||||
|
sz = wxString::Format("%s", dests[i].name);
|
||||||
|
|
||||||
|
if (dests[i].is_default)
|
||||||
|
aDefaultPrinterName = sz;
|
||||||
|
|
||||||
|
aPrinterList.Add(sz);
|
||||||
|
}
|
||||||
|
|
||||||
|
//free memory from cups data
|
||||||
|
cupsFreeDests(num_dests, dests);
|
||||||
|
|
||||||
|
if(aPrinterList.GetCount())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString PANEL_PRINTER_LIST::m_selectedPrinterName;
|
||||||
|
|
||||||
|
PANEL_PRINTER_LIST::PANEL_PRINTER_LIST( wxWindow* aParent, wxWindowID id,
|
||||||
|
const wxPoint& pos, const wxSize& size, long style,
|
||||||
|
const wxString& name ):
|
||||||
|
PANEL_PRINTER_LIST_BASE( aParent, id, pos, size, style, name )
|
||||||
|
{
|
||||||
|
|
||||||
|
GetPrinterList( m_printer_list, m_defaultPrinterName);
|
||||||
|
|
||||||
|
if( m_printer_list.size() )
|
||||||
|
{
|
||||||
|
m_choicePrinter->Append( m_printer_list );
|
||||||
|
m_stPrinterState->SetLabel( wxEmptyString );
|
||||||
|
|
||||||
|
bool selected = false;
|
||||||
|
|
||||||
|
if( !m_selectedPrinterName.IsEmpty() )
|
||||||
|
{
|
||||||
|
for( size_t ii = 0; ii < m_printer_list.GetCount(); ii++ )
|
||||||
|
{
|
||||||
|
if( m_selectedPrinterName == m_printer_list[ii] )
|
||||||
|
{
|
||||||
|
m_choicePrinter->SetSelection( ii );
|
||||||
|
selected = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !selected )
|
||||||
|
{
|
||||||
|
for( size_t ii = 0; ii < m_printer_list.GetCount(); ii++ )
|
||||||
|
{
|
||||||
|
if( m_defaultPrinterName == m_printer_list[ii] )
|
||||||
|
{
|
||||||
|
m_choicePrinter->SetSelection( ii );
|
||||||
|
m_selectedPrinterName = m_defaultPrinterName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_selectedPrinterName == m_defaultPrinterName )
|
||||||
|
m_stPrinterState->SetLabel( _( "Default printer" ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PANEL_PRINTER_LIST::~PANEL_PRINTER_LIST()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_PRINTER_LIST::AsPrintersAvailable()
|
||||||
|
{
|
||||||
|
return m_choicePrinter->GetCount() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_PRINTER_LIST::onPrinterChoice( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
int select = m_choicePrinter->GetSelection();
|
||||||
|
|
||||||
|
if( m_choicePrinter->GetString( select ) == m_defaultPrinterName )
|
||||||
|
m_stPrinterState->SetLabel( _( "Default printer" ) );
|
||||||
|
else
|
||||||
|
m_stPrinterState->SetLabel( wxEmptyString );
|
||||||
|
|
||||||
|
m_selectedPrinterName = m_choicePrinter->GetString( select );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString PANEL_PRINTER_LIST::GetSelectedPrinterName()
|
||||||
|
{
|
||||||
|
if( AsPrintersAvailable() )
|
||||||
|
{
|
||||||
|
int select = m_choicePrinter->GetSelection();
|
||||||
|
m_selectedPrinterName = m_choicePrinter->GetString( select );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_selectedPrinterName.Empty();
|
||||||
|
|
||||||
|
return m_selectedPrinterName;
|
||||||
|
}
|
57
common/dialogs/panel_printer_list_base.cpp
Normal file
57
common/dialogs/panel_printer_list_base.cpp
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
|
||||||
|
// http://www.wxformbuilder.org/
|
||||||
|
//
|
||||||
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "panel_printer_list_base.h"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
PANEL_PRINTER_LIST_BASE::PANEL_PRINTER_LIST_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
||||||
|
{
|
||||||
|
wxBoxSizer* bSizerMain;
|
||||||
|
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_sbSizerPrinters = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Printers") ), wxVERTICAL );
|
||||||
|
|
||||||
|
wxArrayString m_choicePrinterChoices;
|
||||||
|
m_choicePrinter = new wxChoice( m_sbSizerPrinters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePrinterChoices, 0 );
|
||||||
|
m_choicePrinter->SetSelection( 0 );
|
||||||
|
m_sbSizerPrinters->Add( m_choicePrinter, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
wxBoxSizer* bSizerPrinterState;
|
||||||
|
bSizerPrinterState = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
|
m_staticTextPrn = new wxStaticText( m_sbSizerPrinters->GetStaticBox(), wxID_ANY, _("Info:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_staticTextPrn->Wrap( -1 );
|
||||||
|
bSizerPrinterState->Add( m_staticTextPrn, 0, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bSizerPrinterState->Add( 0, 0, 0, wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
m_stPrinterState = new wxStaticText( m_sbSizerPrinters->GetStaticBox(), wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_stPrinterState->Wrap( -1 );
|
||||||
|
bSizerPrinterState->Add( m_stPrinterState, 0, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
m_sbSizerPrinters->Add( bSizerPrinterState, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bSizerMain->Add( m_sbSizerPrinters, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
this->SetSizer( bSizerMain );
|
||||||
|
this->Layout();
|
||||||
|
|
||||||
|
// Connect Events
|
||||||
|
m_choicePrinter->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_PRINTER_LIST_BASE::onPrinterChoice ), NULL, this );
|
||||||
|
}
|
||||||
|
|
||||||
|
PANEL_PRINTER_LIST_BASE::~PANEL_PRINTER_LIST_BASE()
|
||||||
|
{
|
||||||
|
// Disconnect Events
|
||||||
|
m_choicePrinter->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_PRINTER_LIST_BASE::onPrinterChoice ), NULL, this );
|
||||||
|
|
||||||
|
}
|
289
common/dialogs/panel_printer_list_base.fbp
Normal file
289
common/dialogs/panel_printer_list_base.fbp
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<wxFormBuilder_Project>
|
||||||
|
<FileVersion major="1" minor="16" />
|
||||||
|
<object class="Project" expanded="1">
|
||||||
|
<property name="class_decoration"></property>
|
||||||
|
<property name="code_generation">C++</property>
|
||||||
|
<property name="disconnect_events">1</property>
|
||||||
|
<property name="disconnect_mode">source_name</property>
|
||||||
|
<property name="disconnect_php_events">0</property>
|
||||||
|
<property name="disconnect_python_events">0</property>
|
||||||
|
<property name="embedded_files_path">res</property>
|
||||||
|
<property name="encoding">UTF-8</property>
|
||||||
|
<property name="event_generation">connect</property>
|
||||||
|
<property name="file">panel_printer_list_base</property>
|
||||||
|
<property name="first_id">1000</property>
|
||||||
|
<property name="help_provider">none</property>
|
||||||
|
<property name="image_path_wrapper_function_name"></property>
|
||||||
|
<property name="indent_with_spaces"></property>
|
||||||
|
<property name="internationalize">1</property>
|
||||||
|
<property name="name">panel_printer_list</property>
|
||||||
|
<property name="namespace"></property>
|
||||||
|
<property name="path">.</property>
|
||||||
|
<property name="precompiled_header"></property>
|
||||||
|
<property name="relative_path">1</property>
|
||||||
|
<property name="skip_lua_events">1</property>
|
||||||
|
<property name="skip_php_events">1</property>
|
||||||
|
<property name="skip_python_events">1</property>
|
||||||
|
<property name="ui_table">UI</property>
|
||||||
|
<property name="use_array_enum">0</property>
|
||||||
|
<property name="use_enum">1</property>
|
||||||
|
<property name="use_microsoft_bom">0</property>
|
||||||
|
<object class="Panel" expanded="1">
|
||||||
|
<property name="aui_managed">0</property>
|
||||||
|
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="drag_accept_files">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="event_handler">impl_virtual</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">PANEL_PRINTER_LIST_BASE</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="size">378,136</property>
|
||||||
|
<property name="subclass">; ; forward_declare</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="two_step_creation">0</property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
<object class="wxBoxSizer" expanded="1">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">bSizerMain</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticBoxSizer" expanded="1">
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">Printers</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">m_sbSizerPrinters</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="parent">1</property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxChoice" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="choices"></property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="drag_accept_files">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_choicePrinter</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="selection">0</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass">; ; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="validator_data_type"></property>
|
||||||
|
<property name="validator_style">wxFILTER_NONE</property>
|
||||||
|
<property name="validator_type">wxDefaultValidator</property>
|
||||||
|
<property name="validator_variable"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnChoice">onPrinterChoice</event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxBoxSizer" expanded="1">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">bSizerPrinterState</property>
|
||||||
|
<property name="orient">wxHORIZONTAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxALL</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="drag_accept_files">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">Info:</property>
|
||||||
|
<property name="markup">0</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_staticTextPrn</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass">; ; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<property name="wrap">-1</property>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="spacer" expanded="1">
|
||||||
|
<property name="height">0</property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="width">0</property>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxALL</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="drag_accept_files">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">dummy</property>
|
||||||
|
<property name="markup">0</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_stPrinterState</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass">; ; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<property name="wrap">-1</property>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</wxFormBuilder_Project>
|
50
common/dialogs/panel_printer_list_base.h
Normal file
50
common/dialogs/panel_printer_list_base.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
|
||||||
|
// http://www.wxformbuilder.org/
|
||||||
|
//
|
||||||
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <wx/artprov.h>
|
||||||
|
#include <wx/xrc/xmlres.h>
|
||||||
|
#include <wx/intl.h>
|
||||||
|
#include <wx/string.h>
|
||||||
|
#include <wx/choice.h>
|
||||||
|
#include <wx/gdicmn.h>
|
||||||
|
#include <wx/font.h>
|
||||||
|
#include <wx/colour.h>
|
||||||
|
#include <wx/settings.h>
|
||||||
|
#include <wx/stattext.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/statbox.h>
|
||||||
|
#include <wx/panel.h>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// Class PANEL_PRINTER_LIST_BASE
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
class PANEL_PRINTER_LIST_BASE : public wxPanel
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxStaticBoxSizer* m_sbSizerPrinters;
|
||||||
|
wxChoice* m_choicePrinter;
|
||||||
|
wxStaticText* m_staticTextPrn;
|
||||||
|
wxStaticText* m_stPrinterState;
|
||||||
|
|
||||||
|
// Virtual event handlers, override them in your derived class
|
||||||
|
virtual void onPrinterChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
PANEL_PRINTER_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 378,109 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
|
|
||||||
|
~PANEL_PRINTER_LIST_BASE();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
@ -32,6 +32,12 @@
|
|||||||
#include <wx/print.h>
|
#include <wx/print.h>
|
||||||
#include <wx/printdlg.h>
|
#include <wx/printdlg.h>
|
||||||
#include "dialog_print.h"
|
#include "dialog_print.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <dialogs/panel_printer_list.h>
|
||||||
|
|
||||||
|
#include <advanced_config.h>
|
||||||
|
|
||||||
#include "sch_printout.h"
|
#include "sch_printout.h"
|
||||||
|
|
||||||
|
|
||||||
@ -91,22 +97,27 @@ DIALOG_PRINT::DIALOG_PRINT( SCH_EDIT_FRAME* aParent ) :
|
|||||||
wxASSERT( aParent );
|
wxASSERT( aParent );
|
||||||
m_useCairo = ADVANCED_CFG::GetCfg().m_EnableEeschemaPrintCairo;
|
m_useCairo = ADVANCED_CFG::GetCfg().m_EnableEeschemaPrintCairo;
|
||||||
|
|
||||||
|
// Show m_panelPrinters only if there are printers to list:
|
||||||
|
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
|
||||||
|
|
||||||
SetupStandardButtons( { { wxID_OK, _( "Print" ) },
|
SetupStandardButtons( { { wxID_OK, _( "Print" ) },
|
||||||
{ wxID_APPLY, _( "Print Preview" ) },
|
{ wxID_APPLY, _( "Print Preview" ) },
|
||||||
{ wxID_CANCEL, _( "Close" ) } } );
|
{ wxID_CANCEL, _( "Close" ) } } );
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// Problems with modal on wx-2.9 - Anyway preview is standard for OSX
|
// Problems with modal on wx-2.9 - Anyway preview is standard for OSX
|
||||||
m_sdbSizer1Apply->Hide();
|
m_sdbSizerApply->Hide();
|
||||||
#endif
|
#endif
|
||||||
#if defined(__WXGTK__)
|
#if defined(__WXGTK__)
|
||||||
// Preview using Cairo does not work on GTK,
|
// Preview using Cairo does not work on GTK,
|
||||||
// but this platform provide native print preview
|
// but this platform provide native print preview
|
||||||
if( m_useCairo )
|
if( m_useCairo )
|
||||||
m_sdbSizer1Apply->Hide();
|
m_sdbSizerApply->Hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_sdbSizer1OK->SetFocus();
|
m_sdbSizerOK->SetFocus();
|
||||||
|
|
||||||
|
Layout();
|
||||||
|
|
||||||
finishDialogSettings();
|
finishDialogSettings();
|
||||||
}
|
}
|
||||||
@ -236,12 +247,20 @@ void DIALOG_PRINT::OnPageSetup( wxCommandEvent& event )
|
|||||||
void DIALOG_PRINT::OnPrintPreview( wxCommandEvent& event )
|
void DIALOG_PRINT::OnPrintPreview( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
SavePrintOptions();
|
SavePrintOptions();
|
||||||
|
wxPrintData& prn_data = m_parent->GetPageSetupData().GetPrintData();
|
||||||
|
|
||||||
|
wxString selectedPrinterName;
|
||||||
|
|
||||||
|
if( m_panelPrinters )
|
||||||
|
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||||
|
|
||||||
|
prn_data.SetPrinterName( selectedPrinterName );
|
||||||
|
|
||||||
// Pass two printout objects: for preview, and possible printing.
|
// Pass two printout objects: for preview, and possible printing.
|
||||||
wxString title = _( "Preview" );
|
wxString title = _( "Preview" );
|
||||||
wxPrintPreview* preview = new wxPrintPreview( new SCH_PRINTOUT( m_parent, title, m_useCairo ),
|
wxPrintPreview* preview = new wxPrintPreview( new SCH_PRINTOUT( m_parent, title, m_useCairo ),
|
||||||
new SCH_PRINTOUT( m_parent, title, m_useCairo ),
|
new SCH_PRINTOUT( m_parent, title, m_useCairo ),
|
||||||
&m_parent->GetPageSetupData().GetPrintData() );
|
&prn_data );
|
||||||
|
|
||||||
preview->SetZoom( 100 );
|
preview->SetZoom( 100 );
|
||||||
|
|
||||||
@ -284,7 +303,7 @@ bool DIALOG_PRINT::TransferDataFromWindow()
|
|||||||
|
|
||||||
int sheet_count = m_parent->Schematic().Root().CountSheets();
|
int sheet_count = m_parent->Schematic().Root().CountSheets();
|
||||||
|
|
||||||
wxPrintData data = m_parent->GetPageSetupData().GetPrintData();
|
wxPrintData& data = m_parent->GetPageSetupData().GetPrintData();
|
||||||
|
|
||||||
#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 2, 3 )
|
#if defined( __WXGTK__ ) && !wxCHECK_VERSION( 3, 2, 3 )
|
||||||
// In GTK, the default bottom margin is bigger by 0.31 inches for
|
// In GTK, the default bottom margin is bigger by 0.31 inches for
|
||||||
@ -346,6 +365,12 @@ bool DIALOG_PRINT::TransferDataFromWindow()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxString selectedPrinterName;
|
||||||
|
|
||||||
|
if( m_panelPrinters )
|
||||||
|
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||||
|
data.SetPrinterName( selectedPrinterName );
|
||||||
|
|
||||||
wxPrintDialogData printDialogData( data );
|
wxPrintDialogData printDialogData( data );
|
||||||
printDialogData.SetMaxPage( sheet_count );
|
printDialogData.SetMaxPage( sheet_count );
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "dialogs/panel_printer_list.h"
|
||||||
|
|
||||||
#include "dialog_print_base.h"
|
#include "dialog_print_base.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@ -16,6 +18,15 @@ DIALOG_PRINT_BASE::DIALOG_PRINT_BASE( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
wxBoxSizer* bMainSizer;
|
wxBoxSizer* bMainSizer;
|
||||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
wxBoxSizer* bSizerPrintersPanel;
|
||||||
|
bSizerPrintersPanel = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_panelPrinters = new PANEL_PRINTER_LIST( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
|
bSizerPrintersPanel->Add( m_panelPrinters, 1, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bMainSizer->Add( bSizerPrintersPanel, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bleftSizer;
|
wxBoxSizer* bleftSizer;
|
||||||
bleftSizer = new wxBoxSizer( wxVERTICAL );
|
bleftSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
@ -51,18 +62,18 @@ DIALOG_PRINT_BASE::DIALOG_PRINT_BASE( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
m_checkUseColorTheme->SetValue(true);
|
m_checkUseColorTheme->SetValue(true);
|
||||||
bleftSizer->Add( m_checkUseColorTheme, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
bleftSizer->Add( m_checkUseColorTheme, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizer4;
|
wxBoxSizer* bSizerTheme;
|
||||||
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
|
bSizerTheme = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
wxArrayString m_colorThemeChoices;
|
wxArrayString m_colorThemeChoices;
|
||||||
m_colorTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_colorThemeChoices, 0 );
|
m_colorTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_colorThemeChoices, 0 );
|
||||||
m_colorTheme->SetSelection( 0 );
|
m_colorTheme->SetSelection( 0 );
|
||||||
m_colorTheme->Enable( false );
|
m_colorTheme->Enable( false );
|
||||||
|
|
||||||
bSizer4->Add( m_colorTheme, 1, wxEXPAND|wxLEFT, 20 );
|
bSizerTheme->Add( m_colorTheme, 1, wxEXPAND|wxLEFT, 20 );
|
||||||
|
|
||||||
|
|
||||||
bleftSizer->Add( bSizer4, 1, wxEXPAND, 5 );
|
bleftSizer->Add( bSizerTheme, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bMainSizer->Add( bleftSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
|
bMainSizer->Add( bleftSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
|
||||||
@ -76,16 +87,16 @@ DIALOG_PRINT_BASE::DIALOG_PRINT_BASE( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
|
|
||||||
bbuttonsSizer->Add( 20, 0, 1, wxEXPAND, 5 );
|
bbuttonsSizer->Add( 20, 0, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||||
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||||
m_sdbSizer1Apply = new wxButton( this, wxID_APPLY );
|
m_sdbSizerApply = new wxButton( this, wxID_APPLY );
|
||||||
m_sdbSizer1->AddButton( m_sdbSizer1Apply );
|
m_sdbSizer->AddButton( m_sdbSizerApply );
|
||||||
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
|
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||||
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
|
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||||
m_sdbSizer1->Realize();
|
m_sdbSizer->Realize();
|
||||||
|
|
||||||
bbuttonsSizer->Add( m_sdbSizer1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
bbuttonsSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
|
|
||||||
bMainSizer->Add( bbuttonsSizer, 0, wxEXPAND|wxLEFT, 10 );
|
bMainSizer->Add( bbuttonsSizer, 0, wxEXPAND|wxLEFT, 10 );
|
||||||
@ -100,7 +111,7 @@ DIALOG_PRINT_BASE::DIALOG_PRINT_BASE( wxWindow* parent, wxWindowID id, const wxS
|
|||||||
m_colorPrint->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnOutputChoice ), NULL, this );
|
m_colorPrint->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnOutputChoice ), NULL, this );
|
||||||
m_checkUseColorTheme->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnUseColorThemeChecked ), NULL, this );
|
m_checkUseColorTheme->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnUseColorThemeChecked ), NULL, this );
|
||||||
m_buttonPageSetup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPageSetup ), NULL, this );
|
m_buttonPageSetup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPageSetup ), NULL, this );
|
||||||
m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPrintPreview ), NULL, this );
|
m_sdbSizerApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPrintPreview ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
DIALOG_PRINT_BASE::~DIALOG_PRINT_BASE()
|
DIALOG_PRINT_BASE::~DIALOG_PRINT_BASE()
|
||||||
@ -110,6 +121,6 @@ DIALOG_PRINT_BASE::~DIALOG_PRINT_BASE()
|
|||||||
m_colorPrint->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnOutputChoice ), NULL, this );
|
m_colorPrint->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnOutputChoice ), NULL, this );
|
||||||
m_checkUseColorTheme->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnUseColorThemeChecked ), NULL, this );
|
m_checkUseColorTheme->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnUseColorThemeChecked ), NULL, this );
|
||||||
m_buttonPageSetup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPageSetup ), NULL, this );
|
m_buttonPageSetup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPageSetup ), NULL, this );
|
||||||
m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPrintPreview ), NULL, this );
|
m_sdbSizerApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_BASE::OnPrintPreview ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,75 @@
|
|||||||
<property name="name">bMainSizer</property>
|
<property name="name">bMainSizer</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="true">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxBoxSizer" expanded="true">
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">bSizerPrintersPanel</property>
|
||||||
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="permission">none</property>
|
||||||
|
<object class="sizeritem" expanded="true">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND | wxALL</property>
|
||||||
|
<property name="proportion">1</property>
|
||||||
|
<object class="wxPanel" expanded="true">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer">0</property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position">0</property>
|
||||||
|
<property name="aui_row">0</property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="drag_accept_files">0</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_panelPrinters</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="subclass">PANEL_PRINTER_LIST; dialogs/panel_printer_list.h; forward_declare</property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
<object class="sizeritem" expanded="true">
|
<object class="sizeritem" expanded="true">
|
||||||
<property name="border">10</property>
|
<property name="border">10</property>
|
||||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||||
@ -422,10 +491,10 @@
|
|||||||
<object class="sizeritem" expanded="true">
|
<object class="sizeritem" expanded="true">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxEXPAND</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxBoxSizer" expanded="true">
|
<object class="wxBoxSizer" expanded="true">
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">bSizer4</property>
|
<property name="name">bSizerTheme</property>
|
||||||
<property name="orient">wxHORIZONTAL</property>
|
<property name="orient">wxHORIZONTAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="true">
|
<object class="sizeritem" expanded="true">
|
||||||
@ -605,7 +674,7 @@
|
|||||||
<property name="Save">0</property>
|
<property name="Save">0</property>
|
||||||
<property name="Yes">0</property>
|
<property name="Yes">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">m_sdbSizer1</property>
|
<property name="name">m_sdbSizer</property>
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<event name="OnApplyButtonClick">OnPrintPreview</event>
|
<event name="OnApplyButtonClick">OnPrintPreview</event>
|
||||||
</object>
|
</object>
|
||||||
|
@ -10,16 +10,19 @@
|
|||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
class PANEL_PRINTER_LIST;
|
||||||
|
|
||||||
#include "dialog_shim.h"
|
#include "dialog_shim.h"
|
||||||
#include <wx/string.h>
|
#include <wx/panel.h>
|
||||||
#include <wx/checkbox.h>
|
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
|
#include <wx/string.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/checkbox.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
#include <wx/sizer.h>
|
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
@ -36,6 +39,7 @@ class DIALOG_PRINT_BASE : public DIALOG_SHIM
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
PANEL_PRINTER_LIST* m_panelPrinters;
|
||||||
wxCheckBox* m_checkReference;
|
wxCheckBox* m_checkReference;
|
||||||
wxStaticText* m_staticText1;
|
wxStaticText* m_staticText1;
|
||||||
wxChoice* m_colorPrint;
|
wxChoice* m_colorPrint;
|
||||||
@ -43,10 +47,10 @@ class DIALOG_PRINT_BASE : public DIALOG_SHIM
|
|||||||
wxCheckBox* m_checkUseColorTheme;
|
wxCheckBox* m_checkUseColorTheme;
|
||||||
wxChoice* m_colorTheme;
|
wxChoice* m_colorTheme;
|
||||||
wxButton* m_buttonPageSetup;
|
wxButton* m_buttonPageSetup;
|
||||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
wxStdDialogButtonSizer* m_sdbSizer;
|
||||||
wxButton* m_sdbSizer1OK;
|
wxButton* m_sdbSizerOK;
|
||||||
wxButton* m_sdbSizer1Apply;
|
wxButton* m_sdbSizerApply;
|
||||||
wxButton* m_sdbSizer1Cancel;
|
wxButton* m_sdbSizerCancel;
|
||||||
|
|
||||||
// Virtual event handlers, override them in your derived class
|
// Virtual event handlers, override them in your derived class
|
||||||
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
|
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
|
||||||
|
57
include/dialogs/panel_printer_list.h
Normal file
57
include/dialogs/panel_printer_list.h
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2023 jean-pierre.charras
|
||||||
|
* Copyright (C) Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PANEL_PRINTER_LIST_H
|
||||||
|
#define PANEL_PRINTER_LIST_H
|
||||||
|
|
||||||
|
#include <panel_printer_list_base.h>
|
||||||
|
|
||||||
|
|
||||||
|
class PANEL_PRINTER_LIST : public PANEL_PRINTER_LIST_BASE
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PANEL_PRINTER_LIST( wxWindow* aParent, wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxSize( 378,109 ), long style = wxTAB_TRAVERSAL,
|
||||||
|
const wxString& name = wxEmptyString );
|
||||||
|
|
||||||
|
~PANEL_PRINTER_LIST();
|
||||||
|
|
||||||
|
/// @return the selected printer name or a empty name
|
||||||
|
/// for the default printer
|
||||||
|
wxString GetSelectedPrinterName();
|
||||||
|
|
||||||
|
/// @return false if no printer in list
|
||||||
|
bool AsPrintersAvailable();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void onPrinterChoice( wxCommandEvent& event ) override;
|
||||||
|
|
||||||
|
// The printer name selected in this dialog
|
||||||
|
// static to store the choice during a session
|
||||||
|
static wxString m_selectedPrinterName;
|
||||||
|
// The default printer name selected by the OS
|
||||||
|
wxString m_defaultPrinterName;
|
||||||
|
// The list of available printer names
|
||||||
|
wxArrayString m_printer_list;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user