A tabbed dialog is one in which several "tab pages" are available. By clicking on a tab page's tab or by pressing the indicated Alt+\fIletter\fR key combination, the user can select which tab page they want to use.
TQTabDialog provides a tab bar consisting of single row of tabs at the top; each tab has an associated widget which is that tab's tab page. In addition, TQTabDialog provides an OK button and the following optional buttons: Apply, Cancel, Defaults and Help.
Create a TQWidget for each of the pages in the tab dialog, insert children into it, set up geometry management for it, and use addTab() (or insertTab()) to set up a tab and keyboard accelerator for it.
If you don't call addTab() the page you have created will not be visible. Don't confuse the object name you supply to the TQWidget constructor and the tab label you supply to addTab(); addTab() takes user-visible name that appears on the widget's tab and may identify an accelerator, whereas the widget name is used primarily for debugging.
Almost all applications have to connect the applyButtonPressed() signal to something. applyButtonPressed() is emitted when either OK or Apply is clicked, and your slot must copy the dialog's state into the application.
.PP
There are also several other signals which may be useful:
.TP
cancelButtonPressed() is emitted when the user clicks Cancel.
.TP
defaultButtonPressed() is emitted when the user clicks Defaults; the slot it is connected to should reset the state of the dialog to the application defaults.
.TP
helpButtonPressed() is emitted when the user clicks Help.
.TP
aboutToShow() is emitted at the start of show(); if there is any chance that the state of the application may change between the creation of the tab dialog and the time show() is called, you must connect this signal to a slot that resets the state of the dialog.
.TP
currentChanged() is emitted when the user selects a page.
.PP
Each tab is either enabled or disabled at any given time (see setTabEnabled()). If a tab is enabled the tab text is drawn in black and the user can select that tab. If it is disabled the tab is drawn in a different way and the user cannot select that tab. Note that even if a tab is disabled, the page can still be visible; for example, if all of the tabs happen to be disabled.
.PP
You can change a tab's label and iconset using changeTab(). A tab page can be removed with removePage() and shown with showPage(). The current page is given by currentPage().
TQTabDialog does not support tabs on the sides or bottom, nor can you set or retrieve the visible page. If you need more functionality than TQTabDialog provides, consider creating a TQDialog and using a TQTabBar with TQTabWidgets.
Constructs a TQTabDialog with only an OK button. The \fIparent\fR, \fIname\fR, \fImodal\fR and widget flag, \fIf\fR, arguments are passed on to the TQDialog constructor.
This signal is emitted by show() when it is time to set the state of the dialog's contents. The dialog should reflect the current state of the application when it appears; if there is any possibility that the state of the application may change between the time you call TQTabDialog::TQTabDialog() and TQTabDialog::show(), you should set the dialog's state in a slot and connect this signal to it.
The new page is \fIchild\fR; the tab's label is \fIlabel\fR. Note the difference between the widget name (which you supply to widget constructors and to setTabEnabled(), for example) and the tab label. The name is internal to the program and invariant, whereas the label is shown on-screen and may vary according to language and other factors.
.PP
If the tab's \fIlabel\fR contains an ampersand, the letter following the ampersand is used as an accelerator for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes an accelerator which will move the focus to this tab.
.PP
If you call addTab() after show() the screen will flicker and the user may be confused.
This is a lower-level method for adding tabs, similar to the other addTab() method. It is useful if you are using setTabBar() to set a TQTabBar subclass with an overridden TQTabBar::paint() function for a subclass of TQTab.
The \fIchild\fR is the widget to be placed on the new tab page. The \fItab\fR is the tab to display on the tab page -- normally this shows a label or an icon that identifies the tab page.
Returns a pointer to the page currently being displayed by the tab dialog. The tab dialog does its best to make sure that this value is never 0 (but if you try hard enough, it can be).
The new page is \fIchild\fR; the tab's label is \fIlabel\fR. Note the difference between the widget name (which you supply to widget constructors and to setTabEnabled(), for example) and the tab label. The name is internal to the program and invariant, whereas the label is shown on-screen and may vary according to language and other factors.
.PP
If the tab's \fIlabel\fR contains an ampersand, the letter following the ampersand is used as an accelerator for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes an accelerator which will move the focus to this tab.
.PP
If \fIindex\fR is not specified, the tab is simply added. Otherwise it is inserted at the specified position.
.PP
If you call insertTab() after show(), the screen will flicker and the user may be confused.
This is a lower-level method for inserting tabs, similar to the other insertTab() method. It is useful if you are using setTabBar() to set a TQTabBar subclass with an overridden TQTabBar::paint() function for a subclass of TQTab.
The \fIchild\fR is the widget to be placed on the new tab page. The \fItab\fR is the tab to display on the tab page -- normally this shows a label or an icon that identifies the tab page. The \fIindex\fR is the position where this tab page should be inserted.
Adds a Cancel button to the dialog. The button's text is set to \fItext\fR.
.PP
The cancel button should always return the application to the state it was in before the tab view popped up, or if the user has clicked Apply, back to the state immediately after the last Apply.
.PP
When Cancel is clicked, the cancelButtonPressed() signal is emitted. The dialog is closed at the same time.
.PP
If \fItext\fR is a null string, no button is shown.
.PP
See also setApplyButton(), setDefaultButton(), and cancelButtonPressed().
If the widget is visible, the display is updated with the new font immediately. There may be some geometry changes, depending on the size of the old and new fonts.
Adds an OK button to the dialog and sets the button's text to \fItext\fR.
.PP
When the OK button is clicked, the applyButtonPressed() signal is emitted, and the current settings in the dialog box should be applied to the application. The dialog then closes.
.PP
If \fItext\fR is a null string, no button is shown.
.PP
See also setCancelButton(), setDefaultButton(), and applyButtonPressed().
Replaces the TQTabBar heading the dialog by the given tab bar, \fItb\fR. Note that this must be called \fIbefore\fR any tabs have been added, or the behavior is undefined.
Note that even a disabled tab and tab page may be visible. If the page is already visible TQTabWidget will not hide it; if all the pages are disabled TQTabWidget will show one of them.
Note that even a disabled tab/page may be visible. If the page is already visible TQTabDialog will not hide it; if all the pages are disabled TQTabDialog will show one of them.