#include <tdetoolbarbutton.h>
Inherits TQToolButton.
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 | |
TDEToolBarButton (const TQString &icon, int id, TQWidget *parent, const char *name=0L, const TQString &txt=TQString::null, TDEInstance *_instance=TDEGlobal::instance()) | |
TDEToolBarButton (const TQPixmap &pixmap, int id, TQWidget *parent, const char *name=0L, const TQString &txt=TQString::null) | |
TDEToolBarButton (TQWidget *parent=0L, const char *name=0L) | |
~TDEToolBarButton () | |
virtual void | setPixmap (const TQPixmap &pixmap) TDE_DEPRECATED |
void | setDefaultPixmap (const TQPixmap &pixmap) TDE_DEPRECATED |
void | setDisabledPixmap (const TQPixmap &pixmap) TDE_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) |
TDE_DEPRECATED void | setIcon (const TQString &icon, bool generate) |
void | setDefaultIcon (const TQString &icon) TDE_DEPRECATED |
void | setDisabledIcon (const TQString &icon) TDE_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 TDEToolBar, use the TDEToolBar methods instead.
Definition at line 44 of file tdetoolbarbutton.h.
Constructor & Destructor Documentation
◆ TDEToolBarButton() [1/3]
TDEToolBarButton::TDEToolBarButton | ( | const TQString & | icon, |
int | id, | ||
TQWidget * | parent, | ||
const char * | name = 0L , |
||
const TQString & | txt = TQString::null , |
||
TDEInstance * | _instance = TDEGlobal::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
-
icon Name of icon to load (may be absolute or relative) id Id of this button parent This button's parent name This button's internal name txt This button's text (in a tooltip or otherwise) _instance the instance to use for this button
Definition at line 115 of file tdetoolbarbutton.cpp.
◆ TDEToolBarButton() [2/3]
TDEToolBarButton::TDEToolBarButton | ( | 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
-
pixmap Name of icon to load (may be absolute or relative) id Id of this button parent This button's parent name This button's internal name txt This button's text (in a tooltip or otherwise)
Definition at line 149 of file tdetoolbarbutton.cpp.
◆ TDEToolBarButton() [3/3]
TDEToolBarButton::TDEToolBarButton | ( | TQWidget * | parent = 0L , |
const char * | name = 0L |
||
) |
Construct a separator button.
- Parameters
-
parent This button's parent name This button's internal name
Definition at line 105 of file tdetoolbarbutton.cpp.
◆ ~TDEToolBarButton()
TDEToolBarButton::~TDEToolBarButton | ( | ) |
Standard destructor.
Definition at line 181 of file tdetoolbarbutton.cpp.
Member Function Documentation
◆ buttonClicked
|
signal |
Emitted when the toolbar button is clicked (with any mouse button)
- Parameters
-
state makes it possible to find out which button was pressed, and whether any keyboard modifiers were held.
- Since
- 3.4
◆ clicked
|
signal |
Emitted when the toolbar button is clicked (with LMB or MMB)
◆ iconTextMode()
|
protected |
- Since
- 3.1
Definition at line 767 of file tdetoolbarbutton.cpp.
◆ id()
int TDEToolBarButton::id | ( | ) | const |
◆ isActive()
|
protected |
- Since
- 3.1
Definition at line 762 of file tdetoolbarbutton.cpp.
◆ isRaised()
|
protected |
- Since
- 3.1
Definition at line 757 of file tdetoolbarbutton.cpp.
◆ 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 tdetoolbarbutton.cpp.
◆ mousePressEvent()
|
protected |
- Since
- 3.4
Definition at line 454 of file tdetoolbarbutton.cpp.
◆ mouseReleaseEvent()
|
protected |
- Since
- 3.4
Definition at line 468 of file tdetoolbarbutton.cpp.
◆ on()
void TDEToolBarButton::on | ( | bool | flag = true | ) |
Turn this button on or off.
- Parameters
-
flag true or false
Definition at line 715 of file tdetoolbarbutton.cpp.
◆ popup()
TQPopupMenu * TDEToolBarButton::popup | ( | ) |
Return a pointer to this button's popup menu (if it exists)
Definition at line 358 of file tdetoolbarbutton.cpp.
◆ setDefaultIcon()
void TDEToolBarButton::setDefaultIcon | ( | const TQString & | icon | ) |
- Deprecated:
- Force the button to use this icon as the default one rather then generating it using effects.
- Parameters
-
icon The icon to use as the default (normal) one
Definition at line 330 of file tdetoolbarbutton.cpp.
◆ setDefaultPixmap()
void TDEToolBarButton::setDefaultPixmap | ( | const TQPixmap & | pixmap | ) |
- Deprecated:
- Force the button to use this pixmap as the default one rather then generating it using effects.
- Parameters
-
pixmap The pixmap to use as the default (normal) one
Definition at line 316 of file tdetoolbarbutton.cpp.
◆ setDelayedPopup()
void TDEToolBarButton::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
-
p the new popup menu unused Has no effect - ignore it.
Definition at line 372 of file tdetoolbarbutton.cpp.
◆ setDisabledIcon()
void TDEToolBarButton::setDisabledIcon | ( | const TQString & | icon | ) |
- Deprecated:
- Force the button to use this icon when disabled one rather then generating it using effects.
- Parameters
-
icon The icon to use when disabled
Definition at line 344 of file tdetoolbarbutton.cpp.
◆ setDisabledPixmap()
void TDEToolBarButton::setDisabledPixmap | ( | const TQPixmap & | pixmap | ) |
- Deprecated:
- Force the button to use this pixmap when disabled one rather then generating it using effects.
- Parameters
-
pixmap The pixmap to use when disabled
Definition at line 323 of file tdetoolbarbutton.cpp.
◆ setIcon() [1/3]
|
inlinevirtual |
- Since
- 3.1
Definition at line 142 of file tdetoolbarbutton.h.
◆ setIcon() [2/3]
|
virtual |
Set the icon for this button.
The icon will be loaded internally with the correct size. This function is preferred over setIconSet
- Parameters
-
icon The name of the icon
Definition at line 284 of file tdetoolbarbutton.cpp.
◆ setIcon() [3/3]
|
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
-
icon The name of the active icon generate If true, then the other icons are automagically generated from this one
Definition at line 165 of file tdetoolbarbutton.h.
◆ setIconSet()
|
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
-
iconset The iconset to use
Definition at line 298 of file tdetoolbarbutton.cpp.
◆ setNoStyle()
void TDEToolBarButton::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_style Will disable styles if true
Definition at line 700 of file tdetoolbarbutton.cpp.
◆ setPixmap()
|
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
-
pixmap The active pixmap
Definition at line 304 of file tdetoolbarbutton.cpp.
◆ setPopup()
void TDEToolBarButton::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
-
p The new popup menu unused Has no effect - ignore it.
Definition at line 365 of file tdetoolbarbutton.cpp.
◆ setRadio()
void TDEToolBarButton::setRadio | ( | bool | f = true | ) |
Turn this button into a radio button.
- Parameters
-
f true or false
Definition at line 709 of file tdetoolbarbutton.cpp.
◆ setText()
|
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
-
text The button (or tooltip) text
Definition at line 278 of file tdetoolbarbutton.cpp.
◆ setToggle()
void TDEToolBarButton::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
-
toggle true or false
Definition at line 733 of file tdetoolbarbutton.cpp.
◆ toggle()
void TDEToolBarButton::toggle | ( | ) |
Toggle this button.
Definition at line 727 of file tdetoolbarbutton.cpp.
The documentation for this class was generated from the following files: