1 |
/* Eliot */ |
/* Eliot */ |
2 |
/* Copyright (C) 1999 Antoine Fraboulet */ |
/* Copyright (C) 1999 Antoine Fraboulet */ |
|
/* Antoine.Fraboulet@free.fr */ |
|
3 |
/* */ |
/* */ |
4 |
/* This program is free software; you can redistribute it and/or modify */ |
/* This file is part of Eliot. */ |
5 |
|
/* */ |
6 |
|
/* Eliot is free software; you can redistribute it and/or modify */ |
7 |
/* it under the terms of the GNU General Public License as published by */ |
/* it under the terms of the GNU General Public License as published by */ |
8 |
/* the Free Software Foundation; either version 2 of the License, or */ |
/* the Free Software Foundation; either version 2 of the License, or */ |
9 |
/* (at your option) any later version. */ |
/* (at your option) any later version. */ |
10 |
/* */ |
/* */ |
11 |
/* This program is distributed in the hope that it will be useful, */ |
/* Eliot is distributed in the hope that it will be useful, */ |
12 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
13 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
14 |
/* GNU General Public License for more details. */ |
/* GNU General Public License for more details. */ |
19 |
|
|
20 |
/* $Id$ */ |
/* $Id$ */ |
21 |
|
|
22 |
|
/** |
23 |
|
* \file confdimdlg.cc |
24 |
|
* \brief Print configuration dialog |
25 |
|
* \author Antoine Fraboulet |
26 |
|
* \date 2002 |
27 |
|
*/ |
28 |
|
|
29 |
#include "wx/printdlg.h" |
#include "wx/printdlg.h" |
30 |
|
|
31 |
#include "ewx.h" |
#include "ewx.h" |
67 |
} |
} |
68 |
|
|
69 |
|
|
70 |
ConfDimDlg::ConfDimDlg(wxWindow* parent, wxPrintData pd, wxPageSetupData psd) |
ConfDimDlg::ConfDimDlg(wxWindow* parent, wxPrintData pd, wxPageSetupDialogData psd) |
71 |
: wxDialog(parent, -1, wxString(wxT("Eliot : Impression"))) |
: wxDialog(parent, -1, wxString(wxT("Eliot : Impression"))) |
72 |
{ |
{ |
73 |
int i; |
int i; |
74 |
wxString choices[3]; |
wxString choices[3]; |
75 |
choices[0] = wxT("gauche"); |
choices[0] = wxT("gauche"); |
76 |
choices[1] = wxT("centré"); |
// ## choices[1] = wxT("centré"); |
77 |
|
choices[1] = wxT("centre"); |
78 |
choices[2] = wxT("droite"); |
choices[2] = wxT("droite"); |
79 |
wxStaticText* Hcomment[5]; |
wxStaticText* Hcomment[5]; |
80 |
wxRect Hcommentrect[5]; |
wxRect Hcommentrect[5]; |
89 |
wxRect Tspacesrect[5]; |
wxRect Tspacesrect[5]; |
90 |
|
|
91 |
printdata = pd; |
printdata = pd; |
92 |
pagesetupdata = psd; |
pagesetupdialogdata = psd; |
93 |
|
|
94 |
// |
// |
95 |
// Head |
// Head |
135 |
wxRect spacerect = space->GetRect(); |
wxRect spacerect = space->GetRect(); |
136 |
|
|
137 |
// heading, first part |
// heading, first part |
138 |
bfontheader = new wxButton(this,Button_FontHeader,wxT("Caractères"),HFONT); |
// ## bfontheader = new wxButton(this,Button_FontHeader,wxT("Caractères"),HFONT); |
139 |
|
bfontheader = new wxButton(this,Button_FontHeader,wxT("Caracteres"),HFONT); |
140 |
wxRect bfontheadrect = bfontheader->GetRect(); |
wxRect bfontheadrect = bfontheader->GetRect(); |
141 |
for(i=0; i<5; i++) |
for(i=0; i<5; i++) |
142 |
{ |
{ |
147 |
} |
} |
148 |
|
|
149 |
// text, first part |
// text, first part |
150 |
bfonttext = new wxButton(this,Button_FontText,wxT("Caractères"),TFONT); |
// ## bfonttext = new wxButton(this,Button_FontText,wxT("Caractères"),TFONT); |
151 |
|
bfonttext = new wxButton(this,Button_FontText,wxT("Caracteres"),TFONT); |
152 |
wxRect bfonttextrect = bfonttext->GetRect(); |
wxRect bfonttextrect = bfonttext->GetRect(); |
153 |
for(i=0; i<5; i++) |
for(i=0; i<5; i++) |
154 |
{ |
{ |
171 |
|
|
172 |
Hspaces[i] = new wxTextCtrl(this,-1,wxT("00"),HSPACES(i),ESPSIZE); |
Hspaces[i] = new wxTextCtrl(this,-1,wxT("00"),HSPACES(i),ESPSIZE); |
173 |
Hspacesrect[i] = Hspaces[i]->GetRect(); |
Hspacesrect[i] = Hspaces[i]->GetRect(); |
174 |
Hspaces[i]->SetToolTip(wxT("Espacement des caractères du titre")); |
// ## Hspaces[i]->SetToolTip(wxT("Espacement des caractères du titre")); |
175 |
|
Hspaces[i]->SetToolTip(wxT("Espacement des caracteres du titre")); |
176 |
} |
} |
177 |
|
|
178 |
|
|
181 |
{ |
{ |
182 |
Tdim[i] = new wxTextCtrl(this,-1,wxT(""),TDIM(i),wxSize(50,-1)); |
Tdim[i] = new wxTextCtrl(this,-1,wxT(""),TDIM(i),wxSize(50,-1)); |
183 |
Tdimrect[i] = Tdim[i]->GetRect(); |
Tdimrect[i] = Tdim[i]->GetRect(); |
184 |
Tdim[i]->SetToolTip(wxT("Dimension intérieure de la colonne (en mm)")); |
// ## Tdim[i]->SetToolTip(wxT("Dimension intérieure de la colonne (en mm)")); |
185 |
|
Tdim[i]->SetToolTip(wxT("Dimension interieure de la colonne (en mm)")); |
186 |
|
|
187 |
Tunit[i] = new wxStaticText(this,-1,wxT("mm"), |
Tunit[i] = new wxStaticText(this,-1,wxT("mm"), |
188 |
wxPoint(Tdimrect[i].GetRight()+ |
wxPoint(Tdimrect[i].GetRight()+ |
195 |
|
|
196 |
Tspaces[i] = new wxTextCtrl(this,-1,wxT(""),TSPACES(i),ESPSIZE); |
Tspaces[i] = new wxTextCtrl(this,-1,wxT(""),TSPACES(i),ESPSIZE); |
197 |
Tspacesrect[i] = Tspaces[i]->GetRect(); |
Tspacesrect[i] = Tspaces[i]->GetRect(); |
198 |
Tspaces[i]->SetToolTip(wxT("Espacement des caractères")); |
// ## Tspaces[i]->SetToolTip(wxT("Espacement des caractères")); |
199 |
|
Tspaces[i]->SetToolTip(wxT("Espacement des caracteres")); |
200 |
} |
} |
201 |
|
|
202 |
justif->Move(wxPoint(Tjustrect[0].GetLeft(),bfontheadrect.GetBottom() |
justif->Move(wxPoint(Tjustrect[0].GetLeft(),bfontheadrect.GetBottom() |
458 |
void |
void |
459 |
ConfDimDlg::OnConfPage(wxCommandEvent& event) |
ConfDimDlg::OnConfPage(wxCommandEvent& event) |
460 |
{ |
{ |
461 |
//#if defined(__WXGTK__) |
//#if defined(__WXGTK__) |
462 |
pagesetupdata = printdata; |
pagesetupdialogdata = printdata; |
463 |
wxPageSetupDialog pageSetupDialog(this, &pagesetupdata); |
wxPageSetupDialog pageSetupDialog(this, &pagesetupdialogdata); |
464 |
pageSetupDialog.ShowModal(); |
pageSetupDialog.ShowModal(); |
465 |
printdata = pageSetupDialog.GetPageSetupData().GetPrintData(); |
printdata = pageSetupDialog.GetPageSetupData().GetPrintData(); |
466 |
pagesetupdata = pageSetupDialog.GetPageSetupData(); |
pagesetupdialogdata = pageSetupDialog.GetPageSetupData(); |
467 |
// #else |
// #else |
468 |
// wxPageSetupDialog pageSetupDialog(this, & pagesetupdata); |
// wxPageSetupDialog pageSetupDialog(this, & pagesetupdata); |
469 |
// pageSetupDialog.ShowModal(); |
// pageSetupDialog.ShowModal(); |
474 |
void |
void |
475 |
ConfDimDlg::OnConfPrinter(wxCommandEvent& event) |
ConfDimDlg::OnConfPrinter(wxCommandEvent& event) |
476 |
{ |
{ |
477 |
//#if defined(__WXGTK__) |
//#if defined(__WXGTK__) |
478 |
wxPrintDialogData printDialogData(printdata); |
wxPrintDialogData printDialogData(printdata); |
479 |
wxPrintDialog printerDialog(this, & printDialogData); |
wxPrintDialog printerDialog(this, & printDialogData); |
480 |
printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); |
printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); |
500 |
textfont = config.ChooseFont((wxFrame*)this,textfont); |
textfont = config.ChooseFont((wxFrame*)this,textfont); |
501 |
} |
} |
502 |
|
|
503 |
wxPrintData |
wxPrintData& |
504 |
ConfDimDlg::getPrintData() |
ConfDimDlg::getPrintData() |
505 |
{ |
{ |
506 |
return printdata; |
return printdata; |
507 |
} |
} |
508 |
|
|
509 |
wxPageSetupData |
wxPageSetupDialogData& |
510 |
ConfDimDlg::getPageSetupData() |
ConfDimDlg::getPageSetupDialogData() |
511 |
{ |
{ |
512 |
return pagesetupdata; |
return pagesetupdialogdata; |
513 |
} |
} |