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 }
void setOrientation(QPrinter::Orientation orientation)
Sets the orientation of the canvas which can be Portrait or Landscape.
void setHeightNumber(int number)
Sets the number of new plots vertically.
void setWidthNumber(int number)
Sets the number of new plots horizontally.
bool getAddSelected() const
Returns true if added plots should be selected.
QPrinter::Orientation orientation()
Gets the orientation of the canvas which can be Portrait or Landscape.
void orientationChanged()
Changes the plot matrix orientation.
done(int r)
Accept new setting and retile.
virtual void retile_clicked()
Responds to re-tile button clicked.
QRadioButton * portraitRadioButton
QRadioButton * m_add_selected
QRadioButton * m_visibleMarginRadioButton
Namespace for HippoDraw.
Definition: AxesType.cxx:21
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.
void setAddSelected(bool yes)
Sets the check box of the state of add plots being selected.
int getWidthNumber() const
Returns the number of new plots horizontally.
int getHeightNumber() const
Returns the number of new plots vertically.
bool ignorePrinterMargin() const
Returns true if printer margin should be ignored when inserting new plots.
virtual void saveRetile()
Responds to Save & Retile button.
virtual void portraitRadioButton_toggled(bool)
Responds portrait is clicked.
QRadioButton * landscapeRadioButton
CanvasSettings(QWidget *parent=0, const char *name=0, bool modal=false, Qt::WFlags fl=0)
The constructor.
hippodraw::CanvasSettings class interface
void setPrinterBounds(bool flag)
Gets the flag if the printer margin/bounds should be visible on the canvas or not.
virtual void cancel()
Responds to Cancel button.
QRadioButton * m_invisibleMarginRadioButton

Generated for HippoDraw Class Library by doxygen