CanvasSettings.cxx
Go to the documentation of this file.
1 
12 #include "CanvasSettings.h"
13 
14 #include <qspinbox.h>
15 #include <qcheckbox.h>
16 #include <qradiobutton.h>
17 
18 using namespace hippodraw;
19 
20 // #if QT_VERSION < 0x040000
23  const char * name,
24  bool modal,
25  Qt::WFlags flags )
26  : CanvasSettingsBase ( parent, name, modal, flags )
27 {
28 // #else
29 // CanvasSettings::
30 // CanvasSettings ( QWidget * parent )
31 // : QDialog ( parent )
32 // {
33 // setupUi ( this );
34 // #endif
35 }
36 
37 void
40 {
42 }
43 
44 void
47 {
49 }
50 
51 void
54 {
56 }
57 
58 int
61 {
62  return m_h_spin -> value();
63 }
64 
65 void
67 setWidthNumber ( int number )
68 {
69  m_h_spin -> setValue ( number );
70 }
71 
72 int
75 {
76  return m_v_spin -> value();
77 }
78 
79 void
81 setHeightNumber ( int number )
82 {
83  m_v_spin -> setValue ( number );
84 }
85 
86 void
89 {
91 }
92 
93 void
96 {
97  int vSpinNumber = getHeightNumber ();
98  int hSpinNumber = getWidthNumber ();
99 
100  setHeightNumber( hSpinNumber );
101  setWidthNumber( vSpinNumber );
102 
103 }
104 
105 QPrinter::Orientation
107 {
108  if ( portraitRadioButton -> isChecked() ) {
109  return QPrinter::Portrait;
110  }
111  else {
112  return QPrinter::Landscape;
113  }
114 
115  return QPrinter::Portrait;
116 }
117 
118 void CanvasSettings::setOrientation( QPrinter::Orientation orientation )
119 {
120  if ( orientation == QPrinter::Portrait ) {
121  portraitRadioButton -> setChecked( true );
122  }
123  else {
124  landscapeRadioButton -> setChecked( true );
125  }
126 }
127 
129 {
130  return m_visibleMarginRadioButton -> isChecked();
131 }
132 
134 {
135  if( flag == true )
136  m_visibleMarginRadioButton -> setChecked( true );
137  else
138  m_invisibleMarginRadioButton -> setChecked( true );
139 }
140 
141 bool
144 {
145  return m_add_selected -> isChecked ();
146 }
147 
148 void
150 setAddSelected ( bool yes )
151 {
152  m_add_selected -> setChecked ( yes );
153 }
154 
155 bool
158 {
159  return ignore_margin -> isChecked ();
160 }
161 
162 void
165 {
166  ignore_margin -> setChecked ( yes );
167 }
hippodraw::CanvasSettings class interface
int getHeightNumber() const
Returns the number of new plots vertically.
QRadioButton * m_visibleMarginRadioButton
void orientationChanged()
Changes the plot matrix orientation.
void setIgnorePrinterMargin(bool yes)
Sets the status of the ignore printer margins check box.
bool printerBounds()
Sets the if the printer margin/bounds should be visible on the canvas or not.
QRadioButton * portraitRadioButton
done(int r)
void setHeightNumber(int number)
Sets the number of new plots vertically.
QRadioButton * m_invisibleMarginRadioButton
Accept new setting and retile.
QRadioButton * m_add_selected
CanvasSettings(QWidget *parent=0, const char *name=0, bool modal=false, Qt::WFlags fl=0)
The constructor.
bool ignorePrinterMargin() const
Returns true if printer margin should be ignored when inserting new plots.
void setWidthNumber(int number)
Sets the number of new plots horizontally.
virtual void portraitRadioButton_toggled(bool)
Responds portrait is clicked.
Namespace for HippoDraw.
Definition: AxesType.cxx:21
virtual void cancel()
Responds to Cancel button.
void setPrinterBounds(bool flag)
Gets the flag if the printer margin/bounds should be visible on the canvas or not.
void setAddSelected(bool yes)
Sets the check box of the state of add plots being selected.
virtual void saveRetile()
Responds to Save & Retile button.
QRadioButton * landscapeRadioButton
void setOrientation(QPrinter::Orientation orientation)
Sets the orientation of the canvas which can be Portrait or Landscape.
bool getAddSelected() const
Returns true if added plots should be selected.
int getWidthNumber() const
Returns the number of new plots horizontally.
QPrinter::Orientation orientation()
Gets the orientation of the canvas which can be Portrait or Landscape.
virtual void retile_clicked()
Responds to re-tile button clicked.

Generated for HippoDraw Class Library by doxygen