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

kdeui

  • kdeui
ktoolbarradiogroup.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 "ktoolbarradiogroup.h"
26 #include "ktoolbar.h"
27 #include "ktoolbarbutton.h"
28 
29 /*************************************************************************
30  * KToolBarRadioGroup *
31  *************************************************************************/
32 
33 
34 KToolBarRadioGroup::KToolBarRadioGroup (KToolBar *_parent, const char *_name)
35 : TQObject(_parent, _name)
36 {
37  buttons = new KToolBarButtonList();
38  tb = _parent;
39  connect (tb, TQT_SIGNAL(toggled(int)), this, TQT_SLOT(slotToggled(int)));
40 }
41 
42 KToolBarRadioGroup::~KToolBarRadioGroup()
43 {
44  delete buttons;
45 }
46 
47 void KToolBarRadioGroup::addButton (int id)
48 {
49  KToolBarButton *b = tb->getButton( id );
50  b->setRadio( true );
51  buttons->insert( id, b );
52 }
53 
54 void KToolBarRadioGroup::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 KToolBarRadioGroup::slotToggled(int id)
63 {
64  if (buttons->find(id) && buttons->find(id)->isOn())
65  {
66  TQIntDictIterator<KToolBarButton> 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 "ktoolbarradiogroup.moc"
77 
KToolBarButtonList
List of KToolBarButton objects.
Definition: ktoolbarbutton.h:325
KToolBarButton
A toolbar button.
Definition: ktoolbarbutton.h:45
KToolBarButton::setRadio
void setRadio(bool f=true)
Turn this button into a radio button.
Definition: ktoolbarbutton.cpp:709
KToolBarRadioGroup::removeButton
void removeButton(int id)
Removes button from group, making it again toggle button (i.e.
Definition: ktoolbarradiogroup.cpp:54
KToolBarRadioGroup::slotToggled
void slotToggled(int)
Internal - nothing for you here.
Definition: ktoolbarradiogroup.cpp:62
KToolBarRadioGroup::KToolBarRadioGroup
KToolBarRadioGroup(KToolBar *_parent, const char *_name=0)
Constructor.
Definition: ktoolbarradiogroup.cpp:34
KToolBarRadioGroup::~KToolBarRadioGroup
~KToolBarRadioGroup()
Destructor.
Definition: ktoolbarradiogroup.cpp:42
KToolBarRadioGroup::addButton
void addButton(int id)
Adds button to group.
Definition: ktoolbarradiogroup.cpp:47
KToolBar
Floatable toolbar with auto resize.
Definition: ktoolbar.h:105
KToolBar::getButton
KToolBarButton * getButton(int id)
Returns a pointer to KToolBarButton.
Definition: ktoolbar.cpp:631

kdeui

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

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |