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

tdeui

tdetoolbarradiogroup.cpp

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1997, 1998 Stephan Kulow (coolo@kde.org)
00003               (C) 1997, 1998 Mark Donohoe (donohoe@kde.org)
00004               (C) 1997, 1998 Sven Radej (radej@kde.org)
00005               (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)
00006               (C) 1999 Chris Schlaeger (cs@kde.org)
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License version 2 as published by the Free Software Foundation.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include <config.h>
00024 
00025 #include "tdetoolbarradiogroup.h"
00026 #include "tdetoolbar.h"
00027 #include "tdetoolbarbutton.h"
00028 
00029 /*************************************************************************
00030  *                          TDEToolBarRadioGroup                                  *
00031  *************************************************************************/
00032 
00033 
00034 TDEToolBarRadioGroup::TDEToolBarRadioGroup (TDEToolBar *_parent, const char *_name)
00035 : TQObject(_parent, _name)
00036 {
00037   buttons = new TDEToolBarButtonList();
00038   tb = _parent;
00039   connect (tb, TQT_SIGNAL(toggled(int)), this, TQT_SLOT(slotToggled(int)));
00040 }
00041 
00042 TDEToolBarRadioGroup::~TDEToolBarRadioGroup()
00043 {
00044   delete buttons;
00045 }
00046 
00047 void TDEToolBarRadioGroup::addButton (int id)
00048 {
00049     TDEToolBarButton *b = tb->getButton( id );
00050     b->setRadio( true );
00051     buttons->insert( id, b );
00052 }
00053 
00054 void TDEToolBarRadioGroup::removeButton (int id)
00055 {
00056   if (!buttons->find(id))
00057      return;
00058   buttons->find(id)->setRadio(false);
00059   buttons->remove(id);
00060 }
00061 
00062 void TDEToolBarRadioGroup::slotToggled(int id)
00063 {
00064   if (buttons->find(id) && buttons->find(id)->isOn())
00065   {
00066     TQIntDictIterator<TDEToolBarButton> it(*buttons);
00067     while (it.current())
00068     {
00069       if (it.currentKey() != id)
00070         it.current()->on(false);
00071       ++it;
00072     }
00073   }
00074 }
00075 
00076 #include "tdetoolbarradiogroup.moc"
00077 

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.6.3
This website is maintained by Timothy Pearson.