Changeset 584 for trunk/geant4/visualization/OpenGL/src
- Timestamp:
- Sep 26, 2007, 12:17:22 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc
r583 r584 101 101 BW->setChecked( false ); 102 102 103 connect( color, SIGNAL( clicked() ), BW, SLOT( to ogle() ) );104 connect( BW, SIGNAL( clicked() ), color, SLOT( to ogle() ) );103 connect( color, SIGNAL( clicked() ), BW, SLOT( toggle() ) ); 104 connect( BW, SIGNAL( clicked() ), color, SLOT( toggle() ) ); 105 105 106 106 … … 132 132 } 133 133 134 // size box 134 // size box 135 135 QGroupBox *sizeGroupBox = new QGroupBox(tr("Size")); 136 136 QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout; 137 137 138 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout; 139 QWidget* modifyAndRatioWidget = new QWidget; 140 141 // original button 138 142 original = new QRadioButton("Original"); 143 original->setChecked( true ); 144 sizeGroupBoxLayout->addWidget(original); 145 146 // modify and ratio 139 147 modify = new QRadioButton("Modify"); 140 original->setChecked( true );141 148 modify->setChecked( false ); 142 143 sizeGroupBoxLayout->addWidget(original); 144 sizeGroupBoxLayout->addWidget(modify); 149 150 ratioCheckBox = new QCheckBox( "Keep ratio" ); 151 ratioCheckBox->setChecked( true ); 152 153 modifyAndRatioLayout->addWidget(modify); 154 modifyAndRatioLayout->addWidget(ratioCheckBox); 155 modifyAndRatioWidget->setLayout(modifyAndRatioLayout); 156 sizeGroupBoxLayout->addWidget(modifyAndRatioWidget); 157 ratioCheckBox->setVisible(modify->isChecked()); 158 145 159 connect( original, SIGNAL( clicked() ), modify, SLOT( toogle() ) ); 146 160 connect( modify, SIGNAL( clicked() ), original, SLOT( toogle() ) ); 147 161 connect( modify, SIGNAL( toggled(bool) ), this, SLOT( changeSizeBox(bool) ) ); 148 162 163 // height 149 164 QHBoxLayout *heightLineLayout = new QHBoxLayout; 150 165 heightWidget = new QWidget; … … 155 170 height->setMaxLength(5); 156 171 heightLineLayout->addWidget(height); 157 ratioCheckBox = new QCheckBox( "Keep ratio" );158 ratioCheckBox->setChecked( true );159 heightLineLayout->addWidget(ratioCheckBox);160 172 heightWidget->setLayout(heightLineLayout); 161 173 sizeGroupBoxLayout->addWidget(heightWidget); 162 connect( ratioCheckBox, SIGNAL( toogle() ), this, SLOT( keepRatio() ) ); 163 174 connect( height, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textHeightChanged(const QString &) ) ); 175 176 177 // width 164 178 QHBoxLayout *widthLineLayout = new QHBoxLayout; 165 179 widthWidget = new QWidget; … … 171 185 widthWidget->setLayout(widthLineLayout); 172 186 sizeGroupBoxLayout->addWidget(widthWidget); 187 connect( width, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textWidthChanged(const QString &) ) ); 173 188 174 189 sizeGroupBox->setLayout(sizeGroupBoxLayout); … … 178 193 widthWidget->setVisible(false); 179 194 180 195 // button ok/cancel box 181 196 182 197 QGroupBox *buttonGroupBox = new QGroupBox(); … … 214 229 heightWidget->setVisible(modify->isChecked()); 215 230 widthWidget->setVisible(modify->isChecked()); 216 } 217 218 void G4OpenGLQtExportDialog::keepRatio() 219 { 220 } 221 231 ratioCheckBox->setVisible(modify->isChecked()); 232 } 233 234 void G4OpenGLQtExportDialog::textWidthChanged( 235 const QString & s 236 ) 237 { 238 printf("new Width : %s\n",s.toStdString().c_str()); 239 if (ratioCheckBox->isChecked()){ 240 QString tmp; 241 width->setText(tmp.setNum(s.toInt()*originalHeight/originalHeight)); 242 } 243 } 244 245 void G4OpenGLQtExportDialog:: textHeightChanged( 246 const QString & s 247 ) 248 { 249 printf("new Height : %s\n",s.toStdString().c_str()); 250 if (ratioCheckBox->isChecked()){ 251 QString tmp; 252 width->setText(tmp.setNum(s.toInt()*originalWidth/originalWidth)); 253 } 254 } 222 255 223 256 G4OpenGLQtExportDialog::~G4OpenGLQtExportDialog()
Note: See TracChangeset
for help on using the changeset viewer.