karbon

vreference.cc

00001 /* This file is part of the KDE project
00002    Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
00003    Copyright (C) 2002, The Karbon Developers
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 /* vreference.cc */
00022 
00023 #include <qbuttongroup.h>
00024 #include <qlayout.h>
00025 #include <qradiobutton.h>
00026 
00027 #include "vreference.h"
00028 
00029 VReference::VReference( QWidget *parent, const char *name ) : QFrame ( parent, name )
00030 {
00031     QVBoxLayout* layout = new QVBoxLayout( this );
00032     mButtonGroup = new QButtonGroup (3, Vertical, this );
00033     QRadioButton* radio = new QRadioButton ( mButtonGroup );
00034     mButtonGroup->insert( radio, TopLeft );
00035     radio = new QRadioButton ( mButtonGroup );
00036     mButtonGroup->insert( radio, Left );
00037     radio = new QRadioButton ( mButtonGroup );
00038     mButtonGroup->insert( radio, BottomLeft );
00039     radio = new QRadioButton ( mButtonGroup );
00040     mButtonGroup->insert( radio, Top );
00041     radio = new QRadioButton ( mButtonGroup );
00042     mButtonGroup->insert( radio, Center );
00043     radio = new QRadioButton ( mButtonGroup );
00044     mButtonGroup->insert( radio, Bottom );
00045     radio = new QRadioButton ( mButtonGroup );
00046     mButtonGroup->insert( radio, TopRight );
00047     radio = new QRadioButton ( mButtonGroup );
00048     mButtonGroup->insert( radio, Right );
00049     radio = new QRadioButton ( mButtonGroup );
00050     mButtonGroup->insert( radio, BottomRight );
00051     
00052     connect(
00053         mButtonGroup, SIGNAL( clicked( int ) ),
00054         this, SLOT( setReferencePoint( int ) ) );
00055     
00056     mButtonGroup->setButton( Center );
00057     layout->addWidget( mButtonGroup );
00058     layout->activate();
00059     setReferencePoint( Center );
00060 }
00061 
00062 void VReference::setReferencePoint ( int i )
00063 {
00064     m_referencePoint = i;
00065     emit referencePointChanged( m_referencePoint );
00066 }
00067 
00068 int VReference::referencePoint()
00069 {
00070     return( m_referencePoint );
00071 }
00072 
00073 #include "vreference.moc"
00074 
KDE Home | KDE Accessibility Home | Description of Access Keys