#include <kedittoolbar.h>
Signals | |
void | newToolbarConfig () |
Signals inherited from KDialogBase | |
void | helpClicked () |
void | defaultClicked () |
void | user3Clicked () |
void | user2Clicked () |
void | user1Clicked () |
void | applyClicked () |
void | tryClicked () |
void | okClicked () |
void | yesClicked () |
void | noClicked () |
void | cancelClicked () |
void | closeClicked () |
void | apply () |
void | backgroundChanged () |
void | hidden () |
void | finished () |
void | aboutToShowDetails () |
void | aboutToShowPage (TQWidget *page) |
Signals inherited from KDialog | |
void | layoutHintChanged () |
Public Member Functions | |
KEditToolbar (TDEActionCollection *collection, const TQString &xmlfile=TQString::null, bool global=true, TQWidget *parent=0, const char *name=0) | |
KEditToolbar (const TQString &defaultToolbar, TDEActionCollection *collection, const TQString &xmlfile=TQString::null, bool global=true, TQWidget *parent=0, const char *name=0) | |
KEditToolbar (KXMLGUIFactory *factory, TQWidget *parent=0, const char *name=0) | |
KEditToolbar (const TQString &defaultToolbar, KXMLGUIFactory *factory, TQWidget *parent=0, const char *name=0) | |
~KEditToolbar () | |
Public Member Functions inherited from KDialogBase | |
KDialogBase (TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem()) | |
KDialogBase (int dialogFace, const TQString &caption, int buttonMask, ButtonCode defaultButton, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem()) | |
KDialogBase (KDialogBase::DialogType dialogFace, WFlags f, TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem()) | |
KDialogBase (const TQString &caption, int buttonMask=Yes|No|Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &yes=KStdGuiItem::yes(), const KGuiItem &no=KStdGuiItem::no(), const KGuiItem &cancel=KStdGuiItem::cancel()) | |
~KDialogBase () | |
void | setButtonBoxOrientation (int orientation) |
void | setEscapeButton (ButtonCode id) |
virtual void | adjustSize () |
virtual TQSize | sizeHint () const |
virtual TQSize | minimumSizeHint () const |
TQFrame * | plainPage () |
TQFrame * | addPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQFrame * | addPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQVBox * | addVBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQVBox * | addVBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQHBox * | addHBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQHBox * | addHBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQGrid * | addGridPage (int n, Orientation dir, const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQGrid * | addGridPage (int n, Orientation dir, const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
void | setFolderIcon (const TQStringList &path, const TQPixmap &pixmap) |
TQFrame * | makeMainWidget () |
TQVBox * | makeVBoxMainWidget () |
TQHBox * | makeHBoxMainWidget () |
TQGrid * | makeGridMainWidget (int n, Orientation dir) |
void | enableButtonSeparator (bool state) |
void | showButton (ButtonCode id, bool state) |
void | showButtonOK (bool state) |
void | showButtonApply (bool state) |
void | showButtonCancel (bool state) |
bool | showPage (int index) |
int | activePageIndex () const |
int | pageIndex (TQWidget *widget) const |
void | setMainWidget (TQWidget *widget) |
TQWidget * | mainWidget () |
void | disableResize () |
void | setInitialSize (const TQSize &s, bool noResize=false) |
void | incInitialSize (const TQSize &s, bool noResize=false) |
TQSize | configDialogSize (const TQString &groupName) const |
TQSize | configDialogSize (TDEConfig &config, const TQString &groupName) const |
void | saveDialogSize (const TQString &groupName, bool global=false) |
void | saveDialogSize (TDEConfig &config, const TQString &groupName, bool global=false) const |
void | setButtonOK (const KGuiItem &item=KStdGuiItem::ok()) |
void | setButtonOKText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED |
void | setButtonApply (const KGuiItem &item=KStdGuiItem::apply()) |
void | setButtonApplyText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED |
void | setButtonCancel (const KGuiItem &item=KStdGuiItem::cancel()) |
void | setButtonCancelText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED |
void | setButtonText (ButtonCode id, const TQString &text) |
void | setButtonTip (ButtonCode id, const TQString &text) |
void | setButtonWhatsThis (ButtonCode id, const TQString &text) |
void | setButtonGuiItem (ButtonCode id, const KGuiItem &item) |
void | setTreeListAutoResize (bool state) |
void | setShowIconsInTreeList (bool state) |
void | setRootIsDecorated (bool state) |
void | unfoldTreeList (bool persist=false) |
void | addWidgetBelowList (TQWidget *widget) |
void | addButtonBelowList (const TQString &text, TQObject *recv, const char *slot) |
void | addButtonBelowList (const KGuiItem &guiitem, TQObject *recv, const char *slot) |
void | setIconListAllVisible (bool state) |
void | showTile (bool state) |
void | getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const TDE_DEPRECATED |
TQRect | getContentsRect () const TDE_DEPRECATED |
TQSize | calculateSize (int w, int h) const |
TQString | helpLinkText () const |
TQPushButton * | actionButton (ButtonCode id) |
Public Member Functions inherited from KDialog | |
KDialog (TQWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0) | |
Static Public Member Functions | |
static void | setDefaultToolbar (const char *toolbarName) |
Static Public Member Functions inherited from KDialogBase | |
static bool | haveBackgroundTile () |
static const TQPixmap * | backgroundTile () |
static const TQPixmap * | getBackgroundTile () TDE_DEPRECATED |
static void | setBackgroundTile (const TQPixmap *pix) |
Static Public Member Functions inherited from KDialog | |
static int | marginHint () |
static int | spacingHint () |
static void | resizeLayout (TQWidget *widget, int margin, int spacing) |
static void | resizeLayout (TQLayoutItem *lay, int margin, int spacing) |
static void | centerOnScreen (TQWidget *widget, int screen=-1) |
static bool | avoidArea (TQWidget *widget, const TQRect &area, int screen=-1) |
Protected Slots | |
virtual void | slotOk () |
virtual void | slotApply () |
void | acceptOK (bool b) |
void | slotDefault () |
Protected Slots inherited from KDialogBase | |
virtual void | slotHelp () |
virtual void | slotDefault () |
virtual void | slotDetails () |
virtual void | slotUser3 () |
virtual void | slotUser2 () |
virtual void | slotUser1 () |
virtual void | slotOk () |
virtual void | slotApply () |
virtual void | slotTry () |
virtual void | slotYes () |
virtual void | slotNo () |
virtual void | slotCancel () |
virtual void | slotClose () |
virtual void | applyPressed () |
void | updateGeometry () |
void | slotDelayedDestruct () |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Protected Member Functions inherited from KDialogBase | |
virtual void | keyPressEvent (TQKeyEvent *e) |
virtual void | hideEvent (TQHideEvent *) |
virtual void | closeEvent (TQCloseEvent *e) |
Additional Inherited Members | |
Public Types inherited from KDialogBase | |
enum | ButtonCode { Help = 0x00000001 , Default = 0x00000002 , Ok = 0x00000004 , Apply = 0x00000008 , Try = 0x00000010 , Cancel = 0x00000020 , Close = 0x00000040 , User1 = 0x00000080 , User2 = 0x00000100 , User3 = 0x00000200 , No = 0x00000080 , Yes = 0x00000100 , Details = 0x00000400 , Filler = 0x40000000 , Stretch = 0x80000000 , NoDefault } |
enum | ActionButtonStyle { ActionStyle0 =0 , ActionStyle1 , ActionStyle2 , ActionStyle3 , ActionStyle4 , ActionStyleMAX } |
enum | DialogType { TreeList = KJanusWidget::TreeList , Tabbed = KJanusWidget::Tabbed , Plain = KJanusWidget::Plain , Swallow = KJanusWidget::Swallow , IconList = KJanusWidget::IconList } |
Public Slots inherited from KDialogBase | |
void | enableButton (ButtonCode id, bool state) |
void | enableButtonOK (bool state) |
void | enableButtonApply (bool state) |
void | enableButtonCancel (bool state) |
void | enableLinkedHelp (bool state) |
void | delayedDestruct () |
void | setHelpLinkText (const TQString &text) |
void | setHelp (const TQString &anchor, const TQString &appname=TQString::null) |
void | helpClickedSlot (const TQString &) |
void | setDetails (bool showDetails) |
void | setDetailsWidget (TQWidget *detailsWidget) |
void | updateBackground () |
void | cancel () |
Public Slots inherited from KDialog | |
virtual void | polish () |
virtual void | setCaption (const TQString &caption) |
virtual void | setPlainCaption (const TQString &caption) |
Detailed Description
A dialog used to customize or configure toolbars.
This dialog only works if your application uses the XML UI framework for creating menus and toolbars. It depends on the XML files to describe the toolbar layouts and it requires the actions to determine which buttons are active.
Typically, you would include the KStdAction::configureToolbars() standard action in your application. In your slot to this action, you would have something like so:
That code snippet also takes care of redrawing the menu and toolbars if you have made any changes.
If you are using TDEMainWindow's settings methods (either save/apply manually or autoSaveSettings), you should write something like:
Note that the procedure is a bit different for KParts applications. In this case, you need only pass along a pointer to your application's KXMLGUIFactory object. The editor will take care of finding all of the action collections and XML files. The editor aims to be semi-intelligent about where it assigns any modifications. In other words, it will not write out part specific changes to your shell's XML file.
An example would be:
- Version
- $Id$
Definition at line 109 of file kedittoolbar.h.
Constructor & Destructor Documentation
◆ KEditToolbar() [1/3]
KEditToolbar::KEditToolbar | ( | TDEActionCollection * | collection, |
const TQString & | xmlfile = TQString::null , |
||
bool | global = true , |
||
TQWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructor for apps that do not use components.
This is the only entry point to this class. You must pass along your collection of actions (some of which appear in your toolbars). The other two parameters are optional.
The second parameter, xmlfile(), is the name (absolute or relative) of your application's UI resource file. If it is left blank, then the resource file: share/apps/appname/appnameui.rc is used. This is the same resource file that is used by the default createGUI() function in TDEMainWindow so you're usually pretty safe in leaving it blank.
The third parameter, global(), controls whether or not the global resource file is used. If this is true
, then you may edit all of the actions in your toolbars – global ones and local one. If it is false
, then you may edit only your application's entries. The only time you should set this to false is if your application does not use the global resource file at all (very rare).
- Parameters
-
collection The collection of actions to work on. xmlfile The application's local resource file. global If true
, then the global resource file will also be parsed.parent The parent of the dialog. name An internal name.
Definition at line 377 of file kedittoolbar.cpp.
◆ KEditToolbar() [2/3]
KEditToolbar::KEditToolbar | ( | KXMLGUIFactory * | factory, |
TQWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructor for KParts based apps.
The main parameter, factory(), is a pointer to the XML GUI factory object for your application. It contains a list of all of the GUI clients (along with the action collections and xml files) and the toolbar editor uses that.
Use this like so:
- Parameters
-
factory Your application's factory object parent The usual parent for the dialog. name An internal name.
Some people seem tempted to use this also in non-KParts apps, using TDEMainWindow::guiFactory(). This works, but only if setting conserveMemory to false when calling TDEMainWindow::createGUI()! If not, use the other KEditToolbar constructor.
Definition at line 400 of file kedittoolbar.cpp.
◆ KEditToolbar() [3/3]
KEditToolbar::KEditToolbar | ( | const TQString & | defaultToolbar, |
KXMLGUIFactory * | factory, | ||
TQWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructor for KParts based apps, which has an extra argument specifying the toolbar to be shown.
- Parameters
-
defaultToolbar The toolbar with this name will appear for editing. factory Your application's factory object parent The usual parent for the dialog. name An internal name.
- Since
- 3.2
Definition at line 408 of file kedittoolbar.cpp.
◆ ~KEditToolbar()
KEditToolbar::~KEditToolbar | ( | ) |
destructor
Definition at line 433 of file kedittoolbar.cpp.
Member Function Documentation
◆ acceptOK
|
protectedslot |
should OK really save?
Definition at line 438 of file kedittoolbar.cpp.
◆ newToolbarConfig
|
signal |
Signal emitted when 'apply' or 'ok' is clicked or toolbars were resetted.
Connect to it, to plug action lists and to call applyMainWindowSettings (see sample code in this class's documentation)
◆ setDefaultToolbar()
|
static |
Sets the default toolbar, which will be auto-selected when the constructor without the defaultToolbar argument is used.
- Parameters
-
toolbarName the name of the toolbar
- Since
- 3.3
Definition at line 534 of file kedittoolbar.cpp.
◆ slotApply
|
protectedvirtualslot |
idem
Definition at line 527 of file kedittoolbar.cpp.
◆ slotDefault
|
protectedslot |
Set toolbars to default value.
Definition at line 444 of file kedittoolbar.cpp.
◆ slotOk
|
protectedvirtualslot |
Overridden in order to save any changes made to the toolbars.
Definition at line 509 of file kedittoolbar.cpp.
The documentation for this class was generated from the following files: