2
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3
* http://www.gnu.org/licenses/lgpl-3.0.html
6
* $Id: printing_types.cpp 9426 2013-11-02 19:42:20Z alpha0010 $
7
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/sdk/printing_types.cpp $
10
#include "sdk_precomp.h"
11
#include "printing_types.h"
15
#include "configmanager.h"
18
// NOTE (Tiwag#1#): 061012 global wxPrinter, used in cbeditorprintout
19
// to get correct settings if changed in printer dialog
20
wxPrinter* g_printer = nullptr;
22
// TODO (Tiwag#1#): 061012 Page Setup not implemented
23
// wxPageSetupData* g_pageSetupData = 0;
29
g_printer = new wxPrinter;
30
int paperid = Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperid"), wxPAPER_A4 );
31
#if wxCHECK_VERSION(2, 9, 1)
32
wxPrintOrientation paperorientation = static_cast<wxPrintOrientation>( Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperorientation"), wxPORTRAIT ) );
34
int paperorientation = Manager::Get()->GetConfigManager(_T("app"))->ReadInt(_T("/printerdialog/paperorientation"), wxPORTRAIT );
36
wxPrintData* ppd = &(g_printer->GetPrintDialogData().GetPrintData());
37
ppd->SetPaperId((wxPaperSize)paperid);
38
#if wxCHECK_VERSION(2, 9, 1)
39
if (paperorientation == wxPORTRAIT)
40
ppd->SetOrientation(wxPORTRAIT);
42
ppd->SetOrientation(wxLANDSCAPE);
44
ppd->SetOrientation(paperorientation);
48
// if (!g_pageSetupData)
49
// g_pageSetupData = new wxPageSetupDialogData;
56
// delete g_pageSetupData;
57
// g_pageSetupData = 0;