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

kdeui

Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions
KToolBarButton Class Reference

#include <ktoolbarbutton.h>

Inherits TQToolButton.

List of all members.

Public Slots

void modeChange ()
virtual void setTextLabel (const TQString &, bool tipToo)

Signals

void clicked (int)
void buttonClicked (int, TQt::ButtonState state)
void doubleClicked (int)
void pressed (int)
void released (int)
void toggled (int)
void highlighted (int, bool)

Public Member Functions

 KToolBarButton (const TQString &icon, int id, TQWidget *parent, const char *name=0L, const TQString &txt=TQString::null, KInstance *_instance=KGlobal::instance())
 KToolBarButton (const TQPixmap &pixmap, int id, TQWidget *parent, const char *name=0L, const TQString &txt=TQString::null)
 KToolBarButton (TQWidget *parent=0L, const char *name=0L)
 ~KToolBarButton ()
virtual void setPixmap (const TQPixmap &pixmap) KDE_DEPRECATED
void setDefaultPixmap (const TQPixmap &pixmap) KDE_DEPRECATED
void setDisabledPixmap (const TQPixmap &pixmap) KDE_DEPRECATED
virtual void setText (const TQString &text)
virtual void setIcon (const TQString &icon)
virtual void setIcon (const TQPixmap &pixmap)
virtual void setIconSet (const TQIconSet &iconset)
KDE_DEPRECATED void setIcon (const TQString &icon, bool generate)
void setDefaultIcon (const TQString &icon) KDE_DEPRECATED
void setDisabledIcon (const TQString &icon) KDE_DEPRECATED
void on (bool flag=true)
void toggle ()
void setToggle (bool toggle=true)
TQPopupMenu * popup ()
int id () const
void setPopup (TQPopupMenu *p, bool unused=false)
void setDelayedPopup (TQPopupMenu *p, bool unused=false)
void setRadio (bool f=true)
void setNoStyle (bool no_style=true)

Protected Slots

void slotClicked ()
void slotPressed ()
void slotReleased ()
void slotToggled ()
void slotDelayTimeout ()

Protected Member Functions

bool event (TQEvent *e)
void paletteChange (const TQPalette &)
void leaveEvent (TQEvent *e)
void enterEvent (TQEvent *e)
void drawButton (TQPainter *p)
bool eventFilter (TQObject *o, TQEvent *e)
void mousePressEvent (TQMouseEvent *)
void mouseReleaseEvent (TQMouseEvent *)
void showMenu ()
TQSize sizeHint () const
TQSize minimumSizeHint () const
TQSize minimumSize () const
bool isRaised () const
bool isActive () const
int iconTextMode () const
virtual void virtual_hook (int id, void *data)

Detailed Description

A toolbar button.

This is used internally by KToolBar, use the KToolBar methods instead.

Definition at line 44 of file ktoolbarbutton.h.


Constructor & Destructor Documentation

KToolBarButton::KToolBarButton ( const TQString &  icon,
int  id,
TQWidget *  parent,
const char *  name = 0L,
const TQString &  txt = TQString::null,
KInstance *  _instance = KGlobal::instance() 
)

Construct a button with an icon loaded by the button itself.

This will trust the button to load the correct icon with the correct size.

Parameters:
iconName of icon to load (may be absolute or relative)
idId of this button
parentThis button's parent
nameThis button's internal name
txtThis button's text (in a tooltip or otherwise)
_instancethe instance to use for this button

Definition at line 115 of file ktoolbarbutton.cpp.

KToolBarButton::KToolBarButton ( const TQPixmap &  pixmap,
int  id,
TQWidget *  parent,
const char *  name = 0L,
const TQString &  txt = TQString::null 
)

Construct a button with an existing pixmap.

It is not recommended that you use this as the internal icon loading code will almost always get it "right".

Parameters:
pixmapName of icon to load (may be absolute or relative)
idId of this button
parentThis button's parent
nameThis button's internal name
txtThis button's text (in a tooltip or otherwise)

Definition at line 149 of file ktoolbarbutton.cpp.

KToolBarButton::KToolBarButton ( TQWidget *  parent = 0L,
const char *  name = 0L 
)

Construct a separator button.

Parameters:
parentThis button's parent
nameThis button's internal name

Definition at line 105 of file ktoolbarbutton.cpp.

KToolBarButton::~KToolBarButton ( )

Standard destructor.

Definition at line 181 of file ktoolbarbutton.cpp.


Member Function Documentation

void KToolBarButton::buttonClicked ( int  ,
TQt::ButtonState  state 
) [signal]

Emitted when the toolbar button is clicked (with any mouse button)

Parameters:
statemakes it possible to find out which button was pressed, and whether any keyboard modifiers were held.
Since:
3.4
void KToolBarButton::clicked ( int  ) [signal]

Emitted when the toolbar button is clicked (with LMB or MMB)

int KToolBarButton::iconTextMode ( ) const [protected]
Since:
3.1

Definition at line 767 of file ktoolbarbutton.cpp.

int KToolBarButton::id ( ) const

Returns the button's id.

Since:
3.2

Definition at line 772 of file ktoolbarbutton.cpp.

bool KToolBarButton::isActive ( ) const [protected]
Since:
3.1

Definition at line 762 of file ktoolbarbutton.cpp.

bool KToolBarButton::isRaised ( ) const [protected]
Since:
3.1

Definition at line 757 of file ktoolbarbutton.cpp.

void KToolBarButton::modeChange ( ) [slot]

This slot should be called whenever the toolbar mode has potentially changed.

This includes such events as text changing, orientation changing, etc.

Definition at line 186 of file ktoolbarbutton.cpp.

void KToolBarButton::mousePressEvent ( TQMouseEvent *  e) [protected]
Since:
3.4

Definition at line 454 of file ktoolbarbutton.cpp.

void KToolBarButton::mouseReleaseEvent ( TQMouseEvent *  e) [protected]
Since:
3.4

Definition at line 468 of file ktoolbarbutton.cpp.

void KToolBarButton::on ( bool  flag = true)

Turn this button on or off.

Parameters:
flagtrue or false

Definition at line 715 of file ktoolbarbutton.cpp.

TQPopupMenu * KToolBarButton::popup ( )

Return a pointer to this button's popup menu (if it exists)

Definition at line 358 of file ktoolbarbutton.cpp.

void KToolBarButton::setDefaultIcon ( const TQString &  icon)
Deprecated:
Force the button to use this icon as the default one rather then generating it using effects.
Parameters:
iconThe icon to use as the default (normal) one

Definition at line 330 of file ktoolbarbutton.cpp.

void KToolBarButton::setDefaultPixmap ( const TQPixmap &  pixmap)
Deprecated:
Force the button to use this pixmap as the default one rather then generating it using effects.
Parameters:
pixmapThe pixmap to use as the default (normal) one

Definition at line 316 of file ktoolbarbutton.cpp.

void KToolBarButton::setDelayedPopup ( TQPopupMenu *  p,
bool  unused = false 
)

Gives this button a delayed popup menu.

This function allows you to add a delayed popup menu to the button. The popup menu is then only displayed when the button is pressed and held down for about half a second.

Parameters:
pthe new popup menu
unusedHas no effect - ignore it.

Definition at line 372 of file ktoolbarbutton.cpp.

void KToolBarButton::setDisabledIcon ( const TQString &  icon)
Deprecated:
Force the button to use this icon when disabled one rather then generating it using effects.
Parameters:
iconThe icon to use when disabled

Definition at line 344 of file ktoolbarbutton.cpp.

void KToolBarButton::setDisabledPixmap ( const TQPixmap &  pixmap)
Deprecated:
Force the button to use this pixmap when disabled one rather then generating it using effects.
Parameters:
pixmapThe pixmap to use when disabled

Definition at line 323 of file ktoolbarbutton.cpp.

void KToolBarButton::setIcon ( const TQString &  icon) [virtual]

Set the icon for this button.

The icon will be loaded internally with the correct size. This function is preferred over setIconSet

Parameters:
iconThe name of the icon

Definition at line 284 of file ktoolbarbutton.cpp.

virtual void KToolBarButton::setIcon ( const TQPixmap &  pixmap) [inline, virtual]
Since:
3.1

Definition at line 142 of file ktoolbarbutton.h.

KDE_DEPRECATED void KToolBarButton::setIcon ( const TQString &  icon,
bool  generate 
) [inline]
Deprecated:
Set the active icon for this button.

The pixmap itself is loaded internally based on the icon size... .. the disabled and default pixmaps, however will only be constructed if generate is true. This function is preferred over setPixmap

Parameters:
iconThe name of the active icon
generateIf true, then the other icons are automagically generated from this one

Definition at line 165 of file ktoolbarbutton.h.

void KToolBarButton::setIconSet ( const TQIconSet &  iconset) [virtual]

Set the pixmaps for this toolbar button from a TQIconSet.

If you call this you don't need to call any of the other methods that set icons or pixmaps.

Parameters:
iconsetThe iconset to use

Definition at line 298 of file ktoolbarbutton.cpp.

void KToolBarButton::setNoStyle ( bool  no_style = true)

Toolbar buttons naturally will assume the global styles concerning icons, icons sizes, etc.

You can use this function to explicitly turn this off, if you like.

Parameters:
no_styleWill disable styles if true

Definition at line 700 of file ktoolbarbutton.cpp.

void KToolBarButton::setPixmap ( const TQPixmap &  pixmap) [virtual]
Deprecated:
Set the pixmap directly for this button.

This pixmap should be the active one... the dimmed and disabled pixmaps are constructed based on this one. However, don't use this function unless you are positive that you don't want to use setIcon.

Parameters:
pixmapThe active pixmap

Definition at line 304 of file ktoolbarbutton.cpp.

void KToolBarButton::setPopup ( TQPopupMenu *  p,
bool  unused = false 
)

Give this button a popup menu.

There will not be a delay when you press the button. Use setDelayedPopup if you want that behavior.

Parameters:
pThe new popup menu
unusedHas no effect - ignore it.

Definition at line 365 of file ktoolbarbutton.cpp.

void KToolBarButton::setRadio ( bool  f = true)

Turn this button into a radio button.

Parameters:
ftrue or false

Definition at line 709 of file ktoolbarbutton.cpp.

void KToolBarButton::setText ( const TQString &  text) [virtual]

Set the text for this button.

The text will be either used as a tooltip (IconOnly) or will be along side the icon

Parameters:
textThe button (or tooltip) text

Definition at line 278 of file ktoolbarbutton.cpp.

void KToolBarButton::setToggle ( bool  toggle = true)

Turn this button into a toggle button or disable the toggle aspects of it.

This does not toggle the button itself. Use toggle() for that.

Parameters:
toggletrue or false

Definition at line 733 of file ktoolbarbutton.cpp.

void KToolBarButton::toggle ( )

Toggle this button.

Definition at line 727 of file ktoolbarbutton.cpp.


The documentation for this class was generated from the following files:
  • ktoolbarbutton.h
  • ktoolbarbutton.cpp

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. |