#include <tdetoolbar.h>
Inherits TQToolBar.
Public Types | |
enum | IconText { IconOnly = 0 , IconTextRight , TextOnly , IconTextBottom } |
enum | BarStatus { Toggle , Show , Hide } |
enum | BarPosition { Unmanaged , Floating , Top , Bottom , Right , Left , Flat } |
Public Slots | |
virtual void | setIconText (const TQString &txt) |
Signals | |
void | clicked (int id) |
void | doubleClicked (int id) |
void | pressed (int) |
void | released (int) |
void | toggled (int) |
void | highlighted (int id, bool isHighlighted) |
void | highlighted (int id) |
void | moved (BarPosition) |
void | modechange () |
void | toolbarDestroyed () |
Public Member Functions | |
TDEToolBar (TQWidget *parent, const char *name=0, bool honorStyle=false, bool readConfig=true) | |
TDEToolBar (TQMainWindow *parentWindow, TQMainWindow::ToolBarDock dock, bool newLine=false, const char *name=0, bool honorStyle=false, bool readConfig=true) | |
TDEToolBar (TQMainWindow *parentWindow, TQWidget *dock, bool newLine=false, const char *name=0, bool honorStyle=false, bool readConfig=true) | |
virtual | ~TDEToolBar () |
int | insertButton (const TQString &icon, int id, bool enabled=true, const TQString &text=TQString::null, int index=-1, TDEInstance *_instance=TDEGlobal::instance()) |
int | insertButton (const TQString &icon, int id, const char *signal, const TQObject *receiver, const char *slot, bool enabled=true, const TQString &text=TQString::null, int index=-1, TDEInstance *_instance=TDEGlobal::instance()) |
int | insertButton (const TQPixmap &pixmap, int id, bool enabled=true, const TQString &text=TQString::null, int index=-1) |
int | insertButton (const TQPixmap &pixmap, int id, const char *signal, const TQObject *receiver, const char *slot, bool enabled=true, const TQString &text=TQString::null, int index=-1) |
int | insertButton (const TQString &icon, int id, TQPopupMenu *popup, bool enabled, const TQString &_text, int index=-1) |
int | insertButton (const TQPixmap &pixmap, int id, TQPopupMenu *popup, bool enabled, const TQString &_text, int index=-1) |
int | insertLined (const TQString &text, int id, const char *signal, const TQObject *receiver, const char *slot, bool enabled=true, const TQString &toolTipText=TQString::null, int size=70, int index=-1) |
int | insertCombo (const TQStringList &list, int id, bool writable, const char *signal, const TQObject *receiver, const char *slot, bool enabled=true, const TQString &tooltiptext=TQString::null, int size=70, int index=-1, TQComboBox::Policy policy=TQComboBox::AtBottom) |
int | insertCombo (const TQString &text, int id, bool writable, const char *signal, TQObject *receiver, const char *slot, bool enabled=true, const TQString &tooltiptext=TQString::null, int size=70, int index=-1, TQComboBox::Policy policy=TQComboBox::AtBottom) |
int | insertSeparator (int index=-1, int id=-1) |
int | insertLineSeparator (int index=-1, int id=-1) |
int | insertWidget (int id, int width, TQWidget *_widget, int index=-1) |
int | insertAnimatedWidget (int id, TQObject *receiver, const char *slot, const TQString &icons, int index=-1) |
KAnimWidget * | animatedWidget (int id) |
void | addConnection (int id, const char *signal, const TQObject *receiver, const char *slot) |
void | setItemEnabled (int id, bool enabled) |
void | setButtonIcon (int id, const TQString &_icon) |
void | setButtonPixmap (int id, const TQPixmap &_pixmap) |
void | setButtonIconSet (int id, const TQIconSet &iconset) |
void | setDelayedPopup (int id, TQPopupMenu *_popup, bool toggle=false) |
void | setAutoRepeat (int id, bool flag=true) |
void | setToggle (int id, bool flag=true) |
void | toggleButton (int id) |
void | setButton (int id, bool flag) |
bool | isButtonOn (int id) const |
void | setLinedText (int id, const TQString &text) |
TQString | getLinedText (int id) const |
void | insertComboItem (int id, const TQString &text, int index) |
void | insertComboList (int id, const TQStringList &list, int index) |
void | removeComboItem (int id, int index) |
void | setCurrentComboItem (int id, int index) |
void | changeComboItem (int id, const TQString &text, int index=-1) |
void | clearCombo (int id) |
TQString | getComboItem (int id, int index=-1) const |
KComboBox * | getCombo (int id) |
KLineEdit * | getLined (int id) |
TDEToolBarButton * | getButton (int id) |
void | alignItemRight (int id, bool right=true) |
TQWidget * | getWidget (int id) |
void | setItemAutoSized (int id, bool yes=true) |
void | clear () |
void | removeItem (int id) |
void | removeItemDelayed (int id) |
void | hideItem (int id) |
void | showItem (int id) |
int | itemIndex (int id) |
int | idAt (int index) |
void | setFullSize (bool flag=true) |
bool | fullSize () const |
void | enableMoving (bool flag=true) TDE_DEPRECATED |
void | setBarPos (BarPosition bpos) |
BarPosition | barPos () const |
bool | enable (BarStatus stat) TDE_DEPRECATED |
void | setMaxHeight (int h) TDE_DEPRECATED |
int | maxHeight () TDE_DEPRECATED |
void | setMaxWidth (int dw) TDE_DEPRECATED |
int | maxWidth () TDE_DEPRECATED |
void | setTitle (const TQString &_title) |
void | enableFloating (bool flag) TDE_DEPRECATED |
void | setIconText (IconText it) |
void | setIconText (IconText it, bool update) |
IconText | iconText () const |
void | setIconSize (int size) |
void | setIconSize (int size, bool update) |
int | iconSize () const |
int | iconSizeDefault () const |
void | setEnableContextMenu (bool enable=true) |
bool | contextMenuEnabled () const |
void | setItemNoStyle (int id, bool no_style=true) |
void | setFlat (bool flag) |
int | count () const |
void | saveState () |
void | saveSettings (TDEConfig *config, const TQString &configGroup) |
void | applySettings (TDEConfig *config, const TQString &configGroup, bool force) |
void | applySettings (TDEConfig *config, const TQString &configGroup) |
void | setXMLGUIClient (KXMLGUIClient *client) |
void | setText (const TQString &txt) |
TQString | text () const |
void | setStretchableWidget (TQWidget *w) |
TQSizePolicy | sizePolicy () const |
bool | highlight () const |
TQSize | sizeHint () const |
TQSize | minimumSizeHint () const |
TQSize | minimumSize () const |
void | hide () |
void | show () |
void | updateRects (bool=false) |
void | loadState (const TQDomElement &e) |
void | saveState (TQDomElement &e) |
void | positionYourself (bool force=false) |
Static Public Member Functions | |
static bool | highlightSetting () |
static bool | transparentSetting () |
static IconText | iconTextSetting () |
Protected Member Functions | |
void | mousePressEvent (TQMouseEvent *) |
void | childEvent (TQChildEvent *e) |
void | showEvent (TQShowEvent *e) |
void | resizeEvent (TQResizeEvent *e) |
bool | event (TQEvent *e) |
void | applyAppearanceSettings (TDEConfig *config, const TQString &_configGroup, bool forceGlobal=false) |
TQString | settingsGroup () const |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
Floatable toolbar with auto resize.
A KDE-style toolbar.
TDEToolBar can be dragged around in and between different docks.
A TDEToolBar can contain all sorts of widgets.
TDEToolBar can be used as a standalone widget, but TDEMainWindow provides easy factories and management of one or more toolbars. Once you have a TDEToolBar object, you can insert items into it with the insert... methods, or remove them with the removeItem() method. This can be done at any time; the toolbar will be automatically updated. There are also many methods to set per-child properties like alignment and toggle behavior.
TDEToolBar uses a global config group to load toolbar settings on construction. It will reread this config group on a TDEApplication::appearanceChanged() signal.
Definition at line 104 of file tdetoolbar.h.
Member Enumeration Documentation
◆ BarPosition
Possible bar positions.
Definition at line 125 of file tdetoolbar.h.
◆ BarStatus
Constructor & Destructor Documentation
◆ TDEToolBar() [1/3]
TDEToolBar::TDEToolBar | ( | TQWidget * | parent, |
const char * | name = 0 , |
||
bool | honorStyle = false , |
||
bool | readConfig = true |
||
) |
Normal constructor.
This constructor is used by the XML-GUI. If you use it, you need to call TQMainWindow::addToolBar to specify the position of the toolbar. So it's simpler to use the other constructor.
The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle
is set to true. All other toolbars will be IconOnly and use Medium icons.
- Parameters
-
parent The standard toolbar parent (usually a TDEMainWindow) name The standard internal name honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)
Definition at line 196 of file tdetoolbar.cpp.
◆ TDEToolBar() [2/3]
TDEToolBar::TDEToolBar | ( | TQMainWindow * | parentWindow, |
TQMainWindow::ToolBarDock | dock, | ||
bool | newLine = false , |
||
const char * | name = 0 , |
||
bool | honorStyle = false , |
||
bool | readConfig = true |
||
) |
Constructor for non-XML-GUI applications.
The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle
is set to true. All other toolbars will be IconOnly and use Medium icons.
- Parameters
-
parentWindow The window that should be the parent of this toolbar dock The position of the toolbar. Usually TQMainWindow::Top. newLine If true, start a new line in the dock for this toolbar. name The standard internal name honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)
Definition at line 205 of file tdetoolbar.cpp.
◆ TDEToolBar() [3/3]
TDEToolBar::TDEToolBar | ( | TQMainWindow * | parentWindow, |
TQWidget * | dock, | ||
bool | newLine = false , |
||
const char * | name = 0 , |
||
bool | honorStyle = false , |
||
bool | readConfig = true |
||
) |
Constructor for non-XML-GUI applications.
The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle
is set to true. All other toolbars will be IconOnly and use Medium icons.
- Parameters
-
parentWindow The window that should be the parent of this toolbar dock Another widget than the mainwindow to dock toolbar to. newLine If true, start a new line in the dock for this toolbar. name The standard internal name honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)
Definition at line 213 of file tdetoolbar.cpp.
◆ ~TDEToolBar()
|
virtual |
Destructor.
Definition at line 221 of file tdetoolbar.cpp.
Member Function Documentation
◆ addConnection()
void TDEToolBar::addConnection | ( | int | id, |
const char * | signal, | ||
const TQObject * | receiver, | ||
const char * | slot | ||
) |
Adds connections to items.
It is important that you know the id
of particular item. Nothing happens if you forget id
.
Definition at line 458 of file tdetoolbar.cpp.
◆ alignItemRight()
void TDEToolBar::alignItemRight | ( | int | id, |
bool | right = true |
||
) |
Align item to the right.
This works only if toolbar is set to full width.
- See also
- setFullWidth()
Definition at line 640 of file tdetoolbar.cpp.
◆ animatedWidget()
KAnimWidget * TDEToolBar::animatedWidget | ( | int | id | ) |
This will return a pointer to the animated widget with the given id
, if it exists.
- See also
- insertAnimatedWidget
- Parameters
-
id The id for the widget you want to get a pointer to
- Returns
- A pointer to the current animated widget or 0L
Definition at line 430 of file tdetoolbar.cpp.
◆ applySettings()
void TDEToolBar::applySettings | ( | TDEConfig * | config, |
const TQString & | configGroup, | ||
bool | force | ||
) |
Read the toolbar settings from group configGroup
in config
and apply them.
Even default settings are re-applied if force
is set.
Definition at line 1645 of file tdetoolbar.cpp.
◆ barPos()
TDEToolBar::BarPosition TDEToolBar::barPos | ( | ) | const |
Returns the toolbar position.
- Returns
- position of toolbar.
Definition at line 771 of file tdetoolbar.cpp.
◆ changeComboItem()
void TDEToolBar::changeComboItem | ( | int | id, |
const TQString & | text, | ||
int | index = -1 |
||
) |
Changes item index
in combobox id
to text.
index
= -1 refers current item (one displayed in the button).
Definition at line 590 of file tdetoolbar.cpp.
◆ clear()
void TDEToolBar::clear | ( | ) |
◆ clearCombo()
void TDEToolBar::clearCombo | ( | int | id | ) |
Clears the combobox id
.
Does not delete it or hide it.
Definition at line 598 of file tdetoolbar.cpp.
◆ clicked
|
signal |
Emitted when button id
is clicked.
◆ contextMenuEnabled()
bool TDEToolBar::contextMenuEnabled | ( | ) | const |
Returns the context menu enabled flag.
- Returns
- true if the context menu is disabled
Definition at line 927 of file tdetoolbar.cpp.
◆ count()
int TDEToolBar::count | ( | ) | const |
Returns the total number of items in the toolbar.
- Returns
- the total number of items in the toolbar
Definition at line 956 of file tdetoolbar.cpp.
◆ doubleClicked
|
signal |
Emitted when button id
is double-clicked.
Note: you will always recive two clicked() , pressed() and released() signals. There is no way to avoid it - at least no easy way. If you need to resolve this all you can do is set up timers which wait for TQApplication::doubleClickInterval() to expire. If in that time you don't get this signal, you may belive that button was only clicked and not double-clicked. And please note that butons with popup menus do not emit this signal, but those with delayed popup do.
◆ enable()
bool TDEToolBar::enable | ( | BarStatus | stat | ) |
Show, hide, or toggle toolbar.
This method is provided for compatibility only, please use show() and/or hide() instead.
- See also
- BarStatus
Definition at line 786 of file tdetoolbar.cpp.
◆ enableFloating()
void TDEToolBar::enableFloating | ( | bool | flag | ) |
◆ enableMoving()
void TDEToolBar::enableMoving | ( | bool | flag = true | ) |
Enable or disable moving of toolbar.
- Deprecated:
- use setMovingEnabled(bool) instead.
Definition at line 756 of file tdetoolbar.cpp.
◆ fullSize()
bool TDEToolBar::fullSize | ( | ) | const |
Returns the full-size mode enabled flag.
- Returns
true
if the full-size mode is enabled.
Definition at line 750 of file tdetoolbar.cpp.
◆ getButton()
TDEToolBarButton * TDEToolBar::getButton | ( | int | id | ) |
Returns a pointer to TDEToolBarButton.
Example:
That way you can get access to other public methods that TDEToolBarButton provides.
Using this method is not recommended.
Definition at line 631 of file tdetoolbar.cpp.
◆ getCombo()
KComboBox * TDEToolBar::getCombo | ( | int | id | ) |
Returns a pointer to the combobox with id
.
- Returns
- a pointer to the combobox with
id
.
Example:
That way you can get access to other public methods that KComboBox provides.
Definition at line 613 of file tdetoolbar.cpp.
◆ getComboItem()
TQString TDEToolBar::getComboItem | ( | int | id, |
int | index = -1 |
||
) | const |
Returns text of item index
from combobox id
.
- Returns
- text of item
index
from comboboxid
.
index
= -1 refers to current item.
Definition at line 606 of file tdetoolbar.cpp.
◆ getLined()
KLineEdit * TDEToolBar::getLined | ( | int | id | ) |
Returns a pointer to TDEToolBarLined with id
.
- Returns
- a pointer to TDEToolBarLined with
id
.
Example:
That way you can get access to other public methods that KLineEdit provides. KLineEdit is the same thing as TQLineEdit plus completion signals.
Definition at line 622 of file tdetoolbar.cpp.
◆ getLinedText()
TQString TDEToolBar::getLinedText | ( | int | id | ) | const |
Returns the line editor text.
- Returns
- the line editor text.
Definition at line 552 of file tdetoolbar.cpp.
◆ getWidget()
TQWidget * TDEToolBar::getWidget | ( | int | id | ) |
Returns a pointer to the widget corresponding to id
.
- Returns
- a pointer to the widget corresponding to
id
.
Wrong ids are not tested. You can do with this whatever you want, except change its height (hardcoded). If you change its width you will probably have to call TQToolBar::updateRects(true)
- See also
- TQWidget
- updateRects()
Definition at line 652 of file tdetoolbar.cpp.
◆ hideItem()
void TDEToolBar::hideItem | ( | int | id | ) |
Hide item id
.
Definition at line 715 of file tdetoolbar.cpp.
◆ highlighted [1/2]
|
signal |
This signal is emitted when item id
gets highlighted/unhighlighted (i.e when mouse enters/exits).
Note that this signal is emitted from all buttons (normal, disabled and toggle) even when there is no visible change in buttons (i.e., buttons do not raise when mouse enters).
◆ highlighted [2/2]
|
signal |
This signal is emitted when item id
gets highlighted/unhighlighted (i.e when mouse enters/exits).
Note that this signal is emitted from all buttons (normal, disabled and toggle) even when there is no visible change in buttons (i.e., buttons do not raise when mouse enters). The parameter isHighlighted
is true
when mouse enters and false
when mouse exits.
◆ highlightSetting()
|
static |
Returns the global setting for "Highlight buttons under mouse".
- Returns
- global setting for "Highlight buttons under mouse"
Definition at line 1487 of file tdetoolbar.cpp.
◆ iconSize()
int TDEToolBar::iconSize | ( | ) | const |
Returns the current icon size for buttons.
- Returns
- the current icon size for buttons.
Definition at line 905 of file tdetoolbar.cpp.
◆ iconSizeDefault()
int TDEToolBar::iconSizeDefault | ( | ) | const |
Returns the default size for this type of toolbar.
- Returns
- the default size for this type of toolbar.
Definition at line 913 of file tdetoolbar.cpp.
◆ iconText()
TDEToolBar::IconText TDEToolBar::iconText | ( | ) | const |
Returns the current text style for buttons.
- Returns
- the current text style for buttons.
Definition at line 869 of file tdetoolbar.cpp.
◆ iconTextSetting()
|
static |
Returns the global setting for "Icon Text".
- Returns
- global setting for "Icon Text"
Definition at line 1503 of file tdetoolbar.cpp.
◆ idAt()
int TDEToolBar::idAt | ( | int | index | ) |
Returns the id of the item at the given index.
- Since
- 3.2
Definition at line 737 of file tdetoolbar.cpp.
◆ insertAnimatedWidget()
int TDEToolBar::insertAnimatedWidget | ( | int | id, |
TQObject * | receiver, | ||
const char * | slot, | ||
const TQString & | icons, | ||
int | index = -1 |
||
) |
Inserts an animated widget.
A KAnimWidget will be created internally using the icon name you provide. This will emit a signal (clicked()) whenever the animation widget is clicked.
- See also
- animatedWidget()
- Parameters
-
id The id for this toolbar item receiver The parent of your slot slot The slot to receive the clicked() signal icons The name of the animation icon group to use index The item index
- Returns
- The item index
Definition at line 418 of file tdetoolbar.cpp.
◆ insertButton() [1/6]
int TDEToolBar::insertButton | ( | const TQPixmap & | pixmap, |
int | id, | ||
bool | enabled = true , |
||
const TQString & | text = TQString::null , |
||
int | index = -1 |
||
) |
Inserts a button (a TDEToolBarButton) with the specified pixmap.
This pixmap will be used as the "active" one and the disabled and default ones will be autogenerated.
It is recommended that you use the insertButton function that allows you to specify the icon name rather then the pixmap itself. Specifying the icon name is much more flexible.
You should connect to one or more signals in TDEToolBar: clicked() , pressed() , released() , or highlighted() and if the button is a toggle button ( setToggle() ) toggled() . Those signals have id
of a button that caused the signal. If you want to bind a popup to button, see setButton().
- Parameters
-
pixmap The active pixmap id The id of this button enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end).
- Returns
- The item index.
Definition at line 284 of file tdetoolbar.cpp.
◆ insertButton() [2/6]
int TDEToolBar::insertButton | ( | const TQPixmap & | pixmap, |
int | id, | ||
const char * | signal, | ||
const TQObject * | receiver, | ||
const char * | slot, | ||
bool | enabled = true , |
||
const TQString & | text = TQString::null , |
||
int | index = -1 |
||
) |
This is the same as above, but with specified signals and slots to which this button will be connected.
You can add more signals with addConnection().
- Parameters
-
pixmap The name of the icon to use as the active pixmap id The id of this button signal The signal to connect to receiver The slot's parent slot The slot to receive the signal specified in that argument. enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end).
- Returns
- The item index.
Definition at line 295 of file tdetoolbar.cpp.
◆ insertButton() [3/6]
int TDEToolBar::insertButton | ( | const TQPixmap & | pixmap, |
int | id, | ||
TQPopupMenu * | popup, | ||
bool | enabled, | ||
const TQString & | _text, | ||
int | index = -1 |
||
) |
Inserts a button with popupmenu.
Button will have small triangle. You have to connect to popup's signals. The signals KButton::pressed(), KButton::released(), KButton::clicked() or KButton::doubleClicked() are not
emmited by this button (see setDelayedPopup() for that). You can add custom popups which inherit TQPopupMenu to get popups with tables, drawings etc. Just don't fiddle with events there.
Definition at line 321 of file tdetoolbar.cpp.
◆ insertButton() [4/6]
int TDEToolBar::insertButton | ( | const TQString & | icon, |
int | id, | ||
bool | enabled = true , |
||
const TQString & | text = TQString::null , |
||
int | index = -1 , |
||
TDEInstance * | _instance = TDEGlobal::instance() |
||
) |
Insert a button (a TDEToolBarButton) with a pixmap.
The pixmap is loaded by the button itself based on the global icon settings.
You should connect to one or more signals in TDEToolBar: clicked() , pressed() , released() , or highlighted() and if the button is a toggle button ( setToggle() ) toggled() . Those signals have id
of a button that caused the signal. If you want to bind a popup to button, see setButton().
- Parameters
-
icon The name of the icon to use as the active pixmap id The id of this button enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end). _instance instance this button will belong to
- Returns
- The item index.
Definition at line 259 of file tdetoolbar.cpp.
◆ insertButton() [5/6]
int TDEToolBar::insertButton | ( | const TQString & | icon, |
int | id, | ||
const char * | signal, | ||
const TQObject * | receiver, | ||
const char * | slot, | ||
bool | enabled = true , |
||
const TQString & | text = TQString::null , |
||
int | index = -1 , |
||
TDEInstance * | _instance = TDEGlobal::instance() |
||
) |
This is the same as above, but with specified signals and slots to which this button will be connected.
You can add more signals with addConnection().
- Parameters
-
icon The name of the icon to use as the active pixmap id The id of this button signal The signal to connect to receiver The slot's parent slot The slot to receive the signal specified in that argument. enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end). _instance instance this button will belong to
- Returns
- The item index.
Definition at line 271 of file tdetoolbar.cpp.
◆ insertButton() [6/6]
int TDEToolBar::insertButton | ( | const TQString & | icon, |
int | id, | ||
TQPopupMenu * | popup, | ||
bool | enabled, | ||
const TQString & | _text, | ||
int | index = -1 |
||
) |
Inserts a button with popupmenu.
Button will have small triangle. You have to connect to popup's signals. The signals KButton::pressed(), KButton::released(), KButton::clicked() or KButton::doubleClicked() are not
emmited by this button (see setDelayedPopup() for that). You can add custom popups which inherit TQPopupMenu to get popups with tables, drawings etc. Just don't fiddle with events there.
Definition at line 309 of file tdetoolbar.cpp.
◆ insertCombo() [1/2]
int TDEToolBar::insertCombo | ( | const TQString & | text, |
int | id, | ||
bool | writable, | ||
const char * | signal, | ||
TQObject * | receiver, | ||
const char * | slot, | ||
bool | enabled = true , |
||
const TQString & | tooltiptext = TQString::null , |
||
int | size = 70 , |
||
int | index = -1 , |
||
TQComboBox::Policy | policy = TQComboBox::AtBottom |
||
) |
Insert a KComboBox with text.
The rest is the same as above.
- See also
- setItemAutoSized()
- KComboBox
- Returns
- Item index.
Definition at line 376 of file tdetoolbar.cpp.
◆ insertCombo() [2/2]
int TDEToolBar::insertCombo | ( | const TQStringList & | list, |
int | id, | ||
bool | writable, | ||
const char * | signal, | ||
const TQObject * | receiver, | ||
const char * | slot, | ||
bool | enabled = true , |
||
const TQString & | tooltiptext = TQString::null , |
||
int | size = 70 , |
||
int | index = -1 , |
||
TQComboBox::Policy | policy = TQComboBox::AtBottom |
||
) |
Inserts a KComboBox with list.
Can be writable, but cannot contain pixmaps. By default inserting policy is AtBottom, i.e. typed items are placed at the bottom of the list. Can be autosized. If the size argument is specified as -1, the width of the combobox is automatically computed.
- See also
- setFullWidth()
- setItemAutoSized()
- KComboBox
- Returns
- Item index.
Definition at line 352 of file tdetoolbar.cpp.
◆ insertComboItem()
void TDEToolBar::insertComboItem | ( | int | id, |
const TQString & | text, | ||
int | index | ||
) |
Inserts text
in combobox id
at position index
.
Definition at line 559 of file tdetoolbar.cpp.
◆ insertComboList()
void TDEToolBar::insertComboList | ( | int | id, |
const TQStringList & | list, | ||
int | index | ||
) |
Inserts list
in combobox id
at position index
.
Definition at line 566 of file tdetoolbar.cpp.
◆ insertLined()
int TDEToolBar::insertLined | ( | const TQString & | text, |
int | id, | ||
const char * | signal, | ||
const TQObject * | receiver, | ||
const char * | slot, | ||
bool | enabled = true , |
||
const TQString & | toolTipText = TQString::null , |
||
int | size = 70 , |
||
int | index = -1 |
||
) |
Inserts a KLineEdit.
You have to specify signals and slots to which KLineEdit will be connected. KLineEdit has all slots QLineEdit has, plus signals KLineEdit::completion and KLineEdit::textRotation KLineEdit can be set to autoresize itself to full free width in toolbar, that is to last right aligned item. For that, toolbar must be set to full width (which it is by default).
- See also
- setFullWidth()
- setItemAutoSized()
- KLineEdit
- Returns
- Item index.
Definition at line 333 of file tdetoolbar.cpp.
◆ insertLineSeparator()
int TDEToolBar::insertLineSeparator | ( | int | index = -1 , |
int | id = -1 |
||
) |
Inserts a line separator into the toolbar with the given id
.
- Returns
- the separator's index
Definition at line 403 of file tdetoolbar.cpp.
◆ insertSeparator()
int TDEToolBar::insertSeparator | ( | int | index = -1 , |
int | id = -1 |
||
) |
Inserts a separator into the toolbar with the given id
.
- Returns
- the separator's index
Definition at line 396 of file tdetoolbar.cpp.
◆ insertWidget()
int TDEToolBar::insertWidget | ( | int | id, |
int | width, | ||
TQWidget * | _widget, | ||
int | index = -1 |
||
) |
Inserts a user-defined widget.
The widget must
have this toolbar as its parent.
Widget must have a TQWidget for base class. Widget can be autosized to full width. If you forget about it, you can get a pointer to this widget with getWidget().
- See also
- setItemAutoSized()
- Returns
- Item index.
Definition at line 411 of file tdetoolbar.cpp.
◆ isButtonOn()
bool TDEToolBar::isButtonOn | ( | int | id | ) | const |
Returns true
if button is on and is a toggle button.
- Returns
true
if button is on and is a toggle button
- See also
- setToggle()
Definition at line 537 of file tdetoolbar.cpp.
◆ itemIndex()
int TDEToolBar::itemIndex | ( | int | id | ) |
Returns the index of the item id
.
- Returns
- the index of the item
id
.
- Since
- 3.2
Definition at line 731 of file tdetoolbar.cpp.
◆ loadState()
void TDEToolBar::loadState | ( | const TQDomElement & | e | ) |
Load state from an XML element, called by KXMLGUIBuilder.
Definition at line 1779 of file tdetoolbar.cpp.
◆ maxHeight()
int TDEToolBar::maxHeight | ( | ) |
Returns the value set with setMaxHeight().
- Deprecated:
- Use maximumHeight() instead.
- Returns
- the value set with setMaxHeight().
Definition at line 804 of file tdetoolbar.cpp.
◆ maxWidth()
int TDEToolBar::maxWidth | ( | ) |
Returns the value set with setMaxWidth().
Use maximumWidth() instead.
- Returns
- the value set with setMaxWidth().
Definition at line 816 of file tdetoolbar.cpp.
◆ modechange
|
signal |
This signal is emitted when toolbar detects changing of following parameters: highlighting, button-size, button-mode.
This signal is internal, aimed to buttons.
◆ moved
|
signal |
Emitted when toolbar changes position, or when an item is removed from toolbar.
If you subclass TDEMainWindow and reimplement TDEMainWindow::resizeEvent() be sure to connect to this signal. Note: You can connect this signal to a slot that doesn't take parameter.
◆ positionYourself()
void TDEToolBar::positionYourself | ( | bool | force = false | ) |
Definition at line 2011 of file tdetoolbar.cpp.
◆ pressed
|
signal |
Emitted when button id
is pressed.
◆ released
|
signal |
Emits when button id
is released.
◆ removeComboItem()
void TDEToolBar::removeComboItem | ( | int | id, |
int | index | ||
) |
Removes item index
from combobox id
.
Definition at line 574 of file tdetoolbar.cpp.
◆ removeItem()
void TDEToolBar::removeItem | ( | int | id | ) |
Remove item id
.
Item is deleted. Toolbar is redrawn after it.
Definition at line 680 of file tdetoolbar.cpp.
◆ removeItemDelayed()
void TDEToolBar::removeItemDelayed | ( | int | id | ) |
Remove item id
.
Item is deleted when toolbar is redrawn.
Definition at line 696 of file tdetoolbar.cpp.
◆ saveSettings()
void TDEToolBar::saveSettings | ( | TDEConfig * | config, |
const TQString & | configGroup | ||
) |
Save the toolbar settings to group configGroup
in config
.
Definition at line 1043 of file tdetoolbar.cpp.
◆ saveState()
void TDEToolBar::saveState | ( | ) |
Instruct the toolbar to save it's current state to either the app config file or to the XML-GUI resource file (whichever has precedence).
Definition at line 962 of file tdetoolbar.cpp.
◆ setAutoRepeat()
void TDEToolBar::setAutoRepeat | ( | int | id, |
bool | flag = true |
||
) |
Turns a button into an autorepeat button.
Toggle buttons, buttons with menus, or buttons with delayed menus cannot be made into autorepeat buttons. Moreover, you can and will receive only the signal clicked(), but not pressed() or released(). When the user presses this button, you will receive the signal clicked(), and if the button is still pressed after some time, you will receive more clicked() signals separated by regular intervals. Since this uses TQButton::setAutoRepeat() , I can't quantify 'some'.
Definition at line 505 of file tdetoolbar.cpp.
◆ setBarPos()
void TDEToolBar::setBarPos | ( | BarPosition | bpos | ) |
◆ setButton()
void TDEToolBar::setButton | ( | int | id, |
bool | flag | ||
) |
Sets a toggle button state.
If the button is a toggle button (see setToggle()) this will set its state flag. This will also emit the signal KButton::toggled().
- See also
- setToggle()
Definition at line 529 of file tdetoolbar.cpp.
◆ setButtonIcon()
void TDEToolBar::setButtonIcon | ( | int | id, |
const TQString & | _icon | ||
) |
Sets the icon for a button.
Can be used while button is visible.
Definition at line 482 of file tdetoolbar.cpp.
◆ setButtonIconSet()
void TDEToolBar::setButtonIconSet | ( | int | id, |
const TQIconSet & | iconset | ||
) |
Sets a button icon from a TQIconSet.
Can be used while button is visible.
Definition at line 489 of file tdetoolbar.cpp.
◆ setButtonPixmap()
void TDEToolBar::setButtonPixmap | ( | int | id, |
const TQPixmap & | _pixmap | ||
) |
Sets button pixmap.
Can be used while button is visible.
Definition at line 474 of file tdetoolbar.cpp.
◆ setCurrentComboItem()
void TDEToolBar::setCurrentComboItem | ( | int | id, |
int | index | ||
) |
Sets item index
to be current item in combobox id
.
Definition at line 582 of file tdetoolbar.cpp.
◆ setDelayedPopup()
void TDEToolBar::setDelayedPopup | ( | int | id, |
TQPopupMenu * | _popup, | ||
bool | toggle = false |
||
) |
Sets a delayed popup for a button.
Delayed popup is what you see in Netscape Navigator's Previous and Next buttons: If you click them you go back or forth. If you press them long enough, you get a history-menu. This is exactly what we do here.
You will insert a normal button with connection (or use signals from toolbar):
And then add a delayed popup:
Don't add delayed popups to buttons which have normal popups.
You may add popups which are derived from TQPopupMenu. You may add popups that are already in the menu bar or are submenus of other popups.
Definition at line 497 of file tdetoolbar.cpp.
◆ setEnableContextMenu()
void TDEToolBar::setEnableContextMenu | ( | bool | enable = true | ) |
This allows you to enable or disable the context menu.
- Parameters
-
enable If false, then the context menu will be disabled
Definition at line 921 of file tdetoolbar.cpp.
◆ setFullSize()
void TDEToolBar::setFullSize | ( | bool | flag = true | ) |
Set toolbar to full parent size (default).
In full size mode the bar extends over the parent's full width or height. If the mode is disabled the toolbar tries to take as much space as it needs without wrapping, but it does not exceed the parent box. You can force a certain width or height with setMaxWidth() or setMaxHeight().
If you want to use right-aligned items or auto-sized items you must use full size mode.
Definition at line 743 of file tdetoolbar.cpp.
◆ setIconSize() [1/2]
void TDEToolBar::setIconSize | ( | int | size | ) |
Set the icon size to load.
Usually you should not call this, the icon size is taken care of by TDEIconLoader and globally configured. By default, the toolbar will load icons of size 32 for main toolbars and 22 for other toolbars
- See also
- TDEIconLoader.
- Parameters
-
size The size to use
Definition at line 875 of file tdetoolbar.cpp.
◆ setIconSize() [2/2]
void TDEToolBar::setIconSize | ( | int | size, |
bool | update | ||
) |
Same as setIconText(int size) but allows you to disable the toolbar update.
- Parameters
-
size The size to use update If true, then the toolbar will be updated after this
Definition at line 880 of file tdetoolbar.cpp.
◆ setIconText() [1/2]
void TDEToolBar::setIconText | ( | IconText | it | ) |
Set the kind of painting for buttons.
Choose from:
- IconOnly (only icons),
- IconTextRight (icon and text, text is left from icons),
- TextOnly (only text),
- IconTextBottom (icons and text, text is under icons).
- See also
- IconText
Definition at line 833 of file tdetoolbar.cpp.
◆ setIconText() [2/2]
void TDEToolBar::setIconText | ( | IconText | it, |
bool | update | ||
) |
Similar to setIconText(IconText it) but allows you to disable or enable updating.
If update
is false, then the buttons will not be updated. This is useful only if you know that you will be forcing an update later.
Definition at line 839 of file tdetoolbar.cpp.
◆ setItemAutoSized()
void TDEToolBar::setItemAutoSized | ( | int | id, |
bool | yes = true |
||
) |
Set item autosized.
This works only if the toolbar is set to full width. Only one
item can be autosized, and it has to be the last left-aligned item. Items that come after this must be right aligned. Items that can be right aligned are Lineds, Frames, Widgets and Combos. An autosized item will resize itself whenever the toolbar geometry changes to the last right-aligned item (or to end of toolbar if there are no right-aligned items.)
- See also
- setFullWidth()
- alignItemRight()
Definition at line 659 of file tdetoolbar.cpp.
◆ setItemEnabled()
void TDEToolBar::setItemEnabled | ( | int | id, |
bool | enabled | ||
) |
Enables/disables item.
Definition at line 466 of file tdetoolbar.cpp.
◆ setItemNoStyle()
void TDEToolBar::setItemNoStyle | ( | int | id, |
bool | no_style = true |
||
) |
This will inform a toolbar button to ignore certain style changes.
Specifically, it will ignore IconText (always IconOnly) and will not allow image effects to apply.
- Parameters
-
id The button to exclude from styles no_style If true, then it is excluded (default: true).
Definition at line 933 of file tdetoolbar.cpp.
◆ setLinedText()
void TDEToolBar::setLinedText | ( | int | id, |
const TQString & | text | ||
) |
Sets the text of a line editor.
Cursor is set at end of text.
Definition at line 544 of file tdetoolbar.cpp.
◆ setMaxHeight()
void TDEToolBar::setMaxHeight | ( | int | h | ) |
◆ setMaxWidth()
void TDEToolBar::setMaxWidth | ( | int | dw | ) |
Use setMaximumWidth() instead.
Set maximal width of horizontal (top or bottom) toolbar.
Definition at line 810 of file tdetoolbar.cpp.
◆ setText()
void TDEToolBar::setText | ( | const TQString & | txt | ) |
Assign a (translated) text to this toolbar.
This is used for the tooltip on the handle, and when listing the toolbars.
Definition at line 1134 of file tdetoolbar.cpp.
◆ setTitle()
void TDEToolBar::setTitle | ( | const TQString & | _title | ) |
Set title for toolbar when it floats.
Titles are however not (yet) visible. You can't change toolbar's title while it's floating.
Definition at line 822 of file tdetoolbar.cpp.
◆ setToggle()
void TDEToolBar::setToggle | ( | int | id, |
bool | flag = true |
||
) |
Turns button into a toggle button if flag
is true.
Definition at line 513 of file tdetoolbar.cpp.
◆ showItem()
void TDEToolBar::showItem | ( | int | id | ) |
Show item id
.
Definition at line 723 of file tdetoolbar.cpp.
◆ text()
TQString TDEToolBar::text | ( | ) | const |
Returns the toolbar's text.
- Returns
- the toolbar's text.
Definition at line 1140 of file tdetoolbar.cpp.
◆ toggleButton()
void TDEToolBar::toggleButton | ( | int | id | ) |
Toggles a togglebutton.
If the button is a toggle button (see setToggle()) the button state will be toggled. This will also cause the toolbar to emit the signal KButton::toggled() with parameter id
. You must connect to this signal, or use addConnection() to connect directly to the button signal KButton::toggled().
Definition at line 521 of file tdetoolbar.cpp.
◆ toggled
|
signal |
Emitted when a toggle button changes state.
Emitted also if you change state with setButton() or toggleButton() If you make a button normal again, with setToggle(false), this signal won't be emitted.
◆ toolbarDestroyed
|
signal |
This signal is emitted when the toolbar is getting deleted, and before ~TDEToolbar finishes (so it's still time to remove widgets from the toolbar).
Used by KWidgetAction.
- Since
- 3.2
◆ transparentSetting()
|
static |
Returns the global setting for "Toolbars transparent when moving".
- Returns
- global setting for "Toolbars transparent when moving"
Definition at line 1495 of file tdetoolbar.cpp.
The documentation for this class was generated from the following files: