wxPageSetupDialogData*
data)
74, m_OrientationRadioBox(
NULL)
75, m_MarginLeftText(
NULL)
76, m_MarginTopText(
NULL)
77, m_MarginRightText(
NULL)
78, m_MarginBottomText(
NULL)
79, m_PaperTypeChoice(
NULL)
98 size_t n= wxThePrintPaperDatabase->GetCount();
99wxString *choices =
newwxString [
n];
101 for(
size_t i= 0;
i<
n;
i++)
103wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(
i);
104choices[
i] = paper->GetName();
112wxSize(widget_width, wxDefaultCoord),
113(
int)
n, choices );
115wxStaticBoxSizer *paper_choice_sizer =
newwxStaticBoxSizer(
119paper_choice_sizer->Add(
m_PaperTypeChoice, 1, wxEXPAND|wxALL|wxALIGN_BOTTOM, 5 );
120wxBoxSizer *paper_box =
newwxBoxSizer( wxHORIZONTAL );
121paper_box->Add(paper_choice_sizer, 0, wxALL, 5);
123wxString *choices2 =
newwxString[2];
124choices2[0] =
wxT(
"Portrait");
125choices2[1] =
wxT(
"Landscape");
127wxDefaultPosition, wxDefaultSize, 2, choices2, 2);
132mainsizer->Add( paper_box, 0, wxALL|wxALIGN_CENTER, 5 );
137wxBoxSizer *
table=
newwxBoxSizer( wxHORIZONTAL );
139wxBoxSizer *column1 =
newwxBoxSizer( wxVERTICAL );
140column1->Add(
newwxStaticText(
this,
ePrintIDStatic,
wxT(
"Left margin (mm):")),1,wxALL|wxALIGN_CENTER,5 );
141column1->Add(
newwxStaticText(
this,
ePrintIDStatic,
wxT(
"Top margin (mm):")),1,wxALL|wxALIGN_CENTER,5 );
142 table->Add( column1, 0, wxALL |wxEXPAND, 5 );
144wxBoxSizer *column2 =
newwxBoxSizer( wxVERTICAL );
149 table->Add( column2, 0, wxRIGHT|wxTOP|wxBOTTOM |wxEXPAND, 5 );
151wxBoxSizer *column3 =
newwxBoxSizer( wxVERTICAL );
152column3->Add(
newwxStaticText(
this,
ePrintIDStatic,
wxT(
"Right margin (mm):")),1,wxALL|wxALIGN_CENTER,5 );
153column3->Add(
newwxStaticText(
this,
ePrintIDStatic,
wxT(
"Bottom margin (mm):")),1,wxALL|wxALIGN_CENTER,5 );
154 table->Add( column3, 0, wxALL|wxEXPAND, 5 );
156wxBoxSizer *column4 =
newwxBoxSizer( wxVERTICAL );
161 table->Add( column4, 0, wxRIGHT|wxTOP|wxBOTTOM|wxEXPAND, 5 );
163mainsizer->Add(
table, 0, wxALIGN_CENTER );
184 if(
m_PageData.GetPrintData().GetOrientation() == wxPORTRAIT)
192wxPrintPaperType*
type= wxThePrintPaperDatabase->FindPaperType(
195 if(!
type&&
m_PageData.GetPrintData().GetPaperId() != wxPAPER_NONE)
196 type= wxThePrintPaperDatabase->FindPaperType(
m_PageData.GetPrintData().GetPaperId());
214 m_PageData.SetMarginTopLeft( wxPoint(left,top) );
220 m_PageData.SetMarginBottomRight( wxPoint(right,bottom) );
228 m_PageData.GetPrintData().SetOrientation(wxPORTRAIT);
232 m_PageData.GetPrintData().SetOrientation(wxLANDSCAPE);
239 if(selectedItem != -1)
241wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(selectedItem);
244 m_PageData.SetPaperSize(wxSize(paper->GetWidth()/10, paper->GetHeight()/10));
245 m_PageData.GetPrintData().SetPaperId(paper->GetId());
263 size_t n= wxThePrintPaperDatabase->GetCount();
264wxString *choices =
newwxString [
n];
266 for(
size_t i= 0;
i<
n;
i++)
268wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(
i);
269choices[
i] = paper->GetName();
272(void)
newwxStaticText(
this,
ePrintIDStatic,
wxT(
"Paper size"), wxPoint(*x, *y));
275wxComboBox *choice =
newwxComboBox(
this,
277 wxT(
"Paper Size"),
279wxSize(300, wxDefaultCoord),
280(
int)
n, choices );
298wxSize paperSize =
m_PageData.GetPaperSize();
301 floatlarge_side =
std::max(paperSize.GetWidth(), paperSize.GetHeight());
302 floatsmall_side =
std::min(paperSize.GetWidth(), paperSize.GetHeight());
305 floatsmall_side_cm = small_side / 10.0f;
307wxPoint marginTopLeft =
m_PageData.GetMarginTopLeft();
308wxPoint marginBottomRight =
m_PageData.GetMarginBottomRight();
309 intm_margin_left = marginTopLeft.x;
310 intm_margin_right = marginBottomRight.x;
311 intm_margin_top = marginTopLeft.y;
312 intm_margin_bottom = marginBottomRight.y;
314 floatm_units_per_cm = 30.0f;
316 if(
m_PageData.GetPrintData().GetOrientation() == wxPORTRAIT)
318 floatratio = float(large_side - m_margin_top - m_margin_bottom) /
319float(small_side - m_margin_left - m_margin_right);
322m_margin_right/10.0f)*m_units_per_cm);
327 floatratio = float(large_side - m_margin_left - m_margin_right) /
328float(small_side - m_margin_top - m_margin_bottom);
331m_margin_bottom/10.0f)* m_units_per_cm);
338 floatimg_ratio = ((float)image_width)/(float)image_height;
349 if(paper_ratio > 1.0f && img_ratio < 1.0f) {
352img_ratio = 1.0f/img_ratio;
354 else if(paper_ratio < 1.0f && img_ratio > 1.0f) {
357img_ratio = 1.0f/img_ratio;
365ylen = ((float)image_height) * (((float)
m_PrintCoordWidth)/((float)image_width));
virtual void UpdateMargins()
virtual void OnScroll(wxScrollEvent &event)
virtual bool TransferDataFromWindow()
wxRadioBox * m_MultiPageRadioBox
wxSlider * m_PageCountSlider
virtual void OnGuides(wxCommandEvent &event)
virtual void OnMultiPage(wxCommandEvent &event)
CGlPreviewSetupWidget * m_PreviewSetupWidget
virtual bool TransferDataToWindow()
wxTextCtrl * m_MarginRightText
virtual wxPageSetupDialogData & GetPageSetupDialogData()
Required as a subclass of wxPageSetupDialogBase.
wxTextCtrl * m_MarginLeftText
void OnPrinter(wxCommandEvent &event)
virtual ~CPrintSetupDlg()
wxComboBox * m_PaperTypeChoice
virtual bool TransferDataFromWindow()
wxComboBox * CreatePaperTypeChoice(int *x, int *y)
wxPageSetupDialogData m_PageData
virtual void x_Init(wxBoxSizer *mainsizer, int widget_width)
Provide virtual hook for subclasses to add their own controls below the main controls.
virtual bool TransferDataToWindow()
wxRadioBox * m_OrientationRadioBox
wxTextCtrl * m_MarginBottomText
wxTextCtrl * m_MarginTopText
IMPLEMENT_CLASS(CFloatingFrame, CFloatingFrameBaseClass) const static long kFloatFrameStyle
CFloatingFrame.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
WXDLLEXPORT_DATA(wxPrintPaperDatabase *) wxThePrintPaperDatabase
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4