Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

Name_Abbrev_wdgt.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Graeme Foster                                   *
00003  *   email    foster.graeme@gmail.com                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #include "Name_Abbrev_wdgt.h"
00021 
00022 #define SPACE 8
00023 
00024 NameAbbrevWidget::NameAbbrevWidget(int nameWidth
00025                                   ,QString nameLabel
00026                                   ,int abbrevWidth
00027                                   ,QString abbrevLabel
00028                                   ,QWidget * widgetParent
00029                                   ,QBoxLayout * layoutParent
00030                                   ,QDialog * dialogParent)
00031         : QWidget(widgetParent)
00032 {
00033         int frameHeight, dialogHeight;
00034         int frameWidth, dialogWidth;
00035 
00036         wdgt.setupUi(this);
00037         setNameLabel(nameLabel);
00038         setAbbrevLabel(abbrevLabel);
00039         setNameLength(nameWidth);
00040         setAbbrevLength(abbrevWidth);
00041         
00042         vboxLayout = new QVBoxLayout();
00043         vboxLayout->setSpacing(6);
00044         vboxLayout->setMargin(0);
00045         vboxLayout->addWidget(this);
00046         layoutParent->addLayout(vboxLayout);
00047         
00048         frameHeight = height();
00049         dialogHeight = dialogParent->height() + frameHeight;
00050         frameWidth = SPACE+width()+SPACE;
00051         if (widgetParent->width() > frameWidth)
00052                 frameWidth = widgetParent->width();
00053         dialogWidth = SPACE+frameWidth+SPACE;
00054         
00055         dialogParent->resize(dialogWidth,dialogHeight);
00056         widgetParent->resize(frameWidth,frameHeight);
00057         dialogParent->setMaximumSize(dialogWidth,dialogHeight);
00058         dialogParent->setMinimumSize(dialogWidth,dialogHeight);
00059 
00060 }

Generated on Thu Apr 6 16:27:17 2006 for time-table by  doxygen 1.4.4