karbon

vreference.cpp
1/* This file is part of the KDE project
2 Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
3 Copyright (C) 2002, The Karbon Developers
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21/* vreference.cpp */
22
23#include <tqbuttongroup.h>
24#include <tqlayout.h>
25#include <tqradiobutton.h>
26
27#include "vreference.h"
28
29VReference::VReference( TQWidget *parent, const char *name ) : TQFrame ( parent, name )
30{
31 TQVBoxLayout* layout = new TQVBoxLayout( this );
32 mButtonGroup = new TQButtonGroup (3,TQt::Vertical, this );
33 TQRadioButton* radio = new TQRadioButton ( mButtonGroup );
34 mButtonGroup->insert( radio, TopLeft );
35 radio = new TQRadioButton ( mButtonGroup );
36 mButtonGroup->insert( radio, Left );
37 radio = new TQRadioButton ( mButtonGroup );
38 mButtonGroup->insert( radio, BottomLeft );
39 radio = new TQRadioButton ( mButtonGroup );
40 mButtonGroup->insert( radio, Top );
41 radio = new TQRadioButton ( mButtonGroup );
42 mButtonGroup->insert( radio, Center );
43 radio = new TQRadioButton ( mButtonGroup );
44 mButtonGroup->insert( radio, Bottom );
45 radio = new TQRadioButton ( mButtonGroup );
46 mButtonGroup->insert( radio, TopRight );
47 radio = new TQRadioButton ( mButtonGroup );
48 mButtonGroup->insert( radio, Right );
49 radio = new TQRadioButton ( mButtonGroup );
50 mButtonGroup->insert( radio, BottomRight );
51
52 connect(
53 mButtonGroup, TQ_SIGNAL( clicked( int ) ),
54 this, TQ_SLOT( setReferencePoint( int ) ) );
55
56 mButtonGroup->setButton( Center );
57 layout->addWidget( mButtonGroup );
58 layout->activate();
59 setReferencePoint( Center );
60}
61
62void VReference::setReferencePoint ( int i )
63{
64 m_referencePoint = i;
65 emit referencePointChanged( m_referencePoint );
66}
67
68int VReference::referencePoint()
69{
70 return( m_referencePoint );
71}
72
73#include "vreference.moc"
74