Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

layereditdlg.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  *                                                                             *
00003  *   Copyright (C) 2003  Erik Sjolund,  (<html>Erik Sj&ouml;lund</html>)       *
00004  *                       Center for Genomics and Bioinformatics,               *
00005  *                       Karolinska Institutet,                                *
00006  *                       Stockholm,                                            *
00007  *                       Sweden                                                *
00008  *                                                                             *
00009  *  Author: Erik Sjolund                                                       *
00010  *  Email: erik.sjolund@adivo.se                                               *
00011  *                                                                             *
00012  *******************************************************************************
00013  */
00014 #include "layereditdlg.h"
00015 #include "ui_layereditwidget.h"
00016 
00017 #include <qlayout.h>
00018 #include <qspinbox.h>
00019 #include <qcheckbox.h>
00020 #include <qpushbutton.h>
00021 #include <qstring.h>
00022 
00023 
00024 LayerEditDlg::LayerEditDlg( int & _height, QString & _allowOverlapStr,
00025              QWidget * parent, const char * name )
00026         : QDialog( parent, name, TRUE /* modal */ ), height( _height ), 
00027         allowOverlapStr( _allowOverlapStr )
00028 {
00029     uiWidget = new UI_LayerEditWidget( this );
00030     setCaption("Edit show modes");
00031     QBoxLayout * l = new QVBoxLayout( this );
00032     l->addWidget( uiWidget );
00033     connect( uiWidget->buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
00034     connect( uiWidget->buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00035     const int minValue = 1;
00036     Q_ASSERT( height >= minValue );
00037     uiWidget->spinBoxHeight->setMinValue( minValue );
00038     uiWidget->spinBoxHeight->setValue( height );
00039     
00040   bool allowOverlap;  
00041   if ( allowOverlapStr == "true" )
00042   { 
00043   allowOverlap = true;
00044   }
00045   else{
00046   allowOverlap = false;
00047   }
00048     
00049     
00050     uiWidget->checkBoxAllowOverlap->setChecked( allowOverlap );
00051 }
00052 
00053 void LayerEditDlg::accept()
00054 {
00055     allowOverlapStr = uiWidget->checkBoxAllowOverlap->isChecked() ? "true" : "false";
00056     height = uiWidget->spinBoxHeight->value();
00057     QDialog::accept();
00058 }
00059 
00060 LayerEditDlg::~LayerEditDlg()
00061 {
00062 }

Generated on Fri Mar 17 17:44:24 2006 for trapper by  doxygen 1.4.4