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

kdeui

ktoolbarlabelaction.cpp
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2004 Felix Berger <felixberger@beldesign.de>
00003     
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License version 2 as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include "ktoolbarlabelaction.h"
00020 
00021 #include <tqlabel.h>
00022 #include <tqapplication.h>
00023 
00024 class KToolBarLabelAction::KToolBarLabelActionPrivate
00025 {
00026 public:
00027   KToolBarLabelActionPrivate()
00028     : m_label(0)
00029   {
00030   }
00031   TQLabel* m_label;
00032 };
00033 
00034 
00035 KToolBarLabelAction::KToolBarLabelAction(const TQString &text,
00036                      const KShortcut &cut,
00037                      const TQObject *receiver, 
00038                      const char *slot,
00039                      KActionCollection *parent,
00040                      const char *name)
00041   : KWidgetAction(new TQLabel(text, 0, "kde toolbar widget"), text, cut,
00042           receiver, slot, parent, name), 
00043     d(new KToolBarLabelActionPrivate)
00044 {
00045   init();
00046 }
00047 
00048 KToolBarLabelAction::KToolBarLabelAction(TQWidget* buddy, 
00049                      const TQString &text,
00050                      const KShortcut &cut,
00051                      const TQObject *receiver, 
00052                      const char *slot,
00053                      KActionCollection *parent, 
00054                      const char *name)
00055   : KWidgetAction(new TQLabel(buddy, text, 0, "kde toolbar widget"), text, 
00056           cut, receiver, slot, parent, name),
00057     d(new KToolBarLabelActionPrivate)
00058 {
00059   init();
00060 }
00061 
00062 KToolBarLabelAction::KToolBarLabelAction(TQLabel* label, 
00063                      const KShortcut &cut, 
00064                      const TQObject *receiver,
00065                      const char *slot,
00066                      KActionCollection* parent, 
00067                      const char *name)
00068   : KWidgetAction(label, label->text(), cut, receiver, slot, parent, name),
00069     d(new KToolBarLabelActionPrivate)
00070 {
00071   Q_ASSERT(TQString::fromLatin1("kde toolbar widget") == label->name());
00072   init();
00073 }
00074 
00075 KToolBarLabelAction::~KToolBarLabelAction()
00076 {
00077   delete d;
00078   d = 0;
00079 }
00080 
00081 void KToolBarLabelAction::init()
00082 {
00083   d->m_label = static_cast<TQLabel*>(widget());
00084   /* these lines were copied from Konqueror's KonqDraggableLabel class in
00085      konq_misc.cc */
00086   d->m_label->setBackgroundMode(TQt::PaletteButton);
00087   d->m_label->setAlignment((TQApplication::reverseLayout()
00088              ? Qt::AlignRight : Qt::AlignLeft) |
00089             Qt::AlignVCenter | TQt::ShowPrefix );
00090   d->m_label->adjustSize();
00091 }
00092 
00093 void KToolBarLabelAction::setText(const TQString& text)
00094 {
00095   KWidgetAction::setText(text);
00096   d->m_label->setText(text);
00097 }
00098 
00099 void KToolBarLabelAction::setBuddy(TQWidget* buddy)
00100 {
00101   d->m_label->setBuddy(buddy);
00102 }
00103 
00104 TQWidget* KToolBarLabelAction::buddy() const
00105 {
00106   return d->m_label->buddy();
00107 }
00108 
00109 TQLabel* KToolBarLabelAction::label() const
00110 {
00111   return d->m_label;
00112 }
00113 
00114 void KToolBarLabelAction::virtual_hook(int, void*)
00115 {
00116 
00117 }

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.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |