• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
tdetoolbarradiogroup.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997, 1998 Stephan Kulow (coolo@kde.org)
3  (C) 1997, 1998 Mark Donohoe (donohoe@kde.org)
4  (C) 1997, 1998 Sven Radej (radej@kde.org)
5  (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)
6  (C) 1999 Chris Schlaeger (cs@kde.org)
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License version 2 as published by the Free Software Foundation.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #include <config.h>
24 
25 #include "tdetoolbarradiogroup.h"
26 #include "tdetoolbar.h"
27 #include "tdetoolbarbutton.h"
28 
29 /*************************************************************************
30  * TDEToolBarRadioGroup *
31  *************************************************************************/
32 
33 
34 TDEToolBarRadioGroup::TDEToolBarRadioGroup (TDEToolBar *_parent, const char *_name)
35 : TQObject(_parent, _name)
36 {
37  buttons = new TDEToolBarButtonList();
38  tb = _parent;
39  connect (tb, TQT_SIGNAL(toggled(int)), this, TQT_SLOT(slotToggled(int)));
40 }
41 
42 TDEToolBarRadioGroup::~TDEToolBarRadioGroup()
43 {
44  delete buttons;
45 }
46 
47 void TDEToolBarRadioGroup::addButton (int id)
48 {
49  TDEToolBarButton *b = tb->getButton( id );
50  b->setRadio( true );
51  buttons->insert( id, b );
52 }
53 
54 void TDEToolBarRadioGroup::removeButton (int id)
55 {
56  if (!buttons->find(id))
57  return;
58  buttons->find(id)->setRadio(false);
59  buttons->remove(id);
60 }
61 
62 void TDEToolBarRadioGroup::slotToggled(int id)
63 {
64  if (buttons->find(id) && buttons->find(id)->isOn())
65  {
66  TQIntDictIterator<TDEToolBarButton> it(*buttons);
67  while (it.current())
68  {
69  if (it.currentKey() != id)
70  it.current()->on(false);
71  ++it;
72  }
73  }
74 }
75 
76 #include "tdetoolbarradiogroup.moc"
77 
TDEToolBarRadioGroup::TDEToolBarRadioGroup
TDEToolBarRadioGroup(TDEToolBar *_parent, const char *_name=0)
Constructor.
Definition: tdetoolbarradiogroup.cpp:34
TDEToolBarButton
A toolbar button.
Definition: tdetoolbarbutton.h:44
TDEToolBarRadioGroup::slotToggled
void slotToggled(int)
Internal - nothing for you here.
Definition: tdetoolbarradiogroup.cpp:62
TDEToolBarRadioGroup::~TDEToolBarRadioGroup
~TDEToolBarRadioGroup()
Destructor.
Definition: tdetoolbarradiogroup.cpp:42
TDEToolBar
Floatable toolbar with auto resize.
Definition: tdetoolbar.h:104
TDEToolBar::getButton
TDEToolBarButton * getButton(int id)
Returns a pointer to TDEToolBarButton.
Definition: tdetoolbar.cpp:631
TDEToolBarButton::setRadio
void setRadio(bool f=true)
Turn this button into a radio button.
Definition: tdetoolbarbutton.cpp:709
TDEToolBarRadioGroup::addButton
void addButton(int id)
Adds button to group.
Definition: tdetoolbarradiogroup.cpp:47
TDEToolBarRadioGroup::removeButton
void removeButton(int id)
Removes button from group, making it again toggle button (i.e.
Definition: tdetoolbarradiogroup.cpp:54
TDEToolBarButtonList
List of TDEToolBarButton objects.
Definition: tdetoolbarbutton.h:324

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.