Wt
3.2.2
|
A container with a title and standard GUI elements. More...
#include <Wt/Ext/Panel>
Public Member Functions | |
Panel (WContainerWidget *parent=0) | |
Create a new panel. | |
~Panel () | |
Destruct a panel. | |
void | setTopToolBar (ToolBar *toolBar) |
Set a tool bar at the top of the panel. | |
ToolBar * | topToolBar () const |
Return the top tool bar. | |
void | setBottomToolBar (ToolBar *bottomBar) |
Set a tool bar at the bottom of the panel. | |
ToolBar * | bottomToolBar () const |
Return the top tool bar. | |
void | addFooterButton (Button *button) |
Add a button to the footer of the panel. | |
void | removeFooterButton (Button *button) |
Remove a button from the footer of the panel. | |
const std::vector< Button * > & | footerButtons () const |
Retrn the list of footer buttons. | |
void | setTitle (const WString &title) |
Set a title. | |
const WString & | title () const |
Get the title. | |
void | setTitleBar (bool enable) |
Show or hide a title bar for the panel. | |
bool | titleBar () const |
Get the title bar. | |
void | setAnimate (bool on) |
Set to use animations for the expand/collapse operation. | |
bool | animate () const |
Return if using animations for expand/collapse. | |
void | setAutoScrollBars (bool on) |
Option to show scroll bars when needed. | |
bool | autoScrollBars () const |
Return if showing scroll bars when needed. | |
void | setBorder (bool show) |
Change the border around the panel. | |
bool | border () const |
Get the border setting. | |
void | setCollapsed (bool on) |
Set the panel expanded or callapsed. | |
void | collapse () |
Collapse the panel. | |
void | expand () |
Expand the panel. | |
bool | isCollapsed () const |
Return if the panel is collapsed. | |
void | setCollapsible (bool on) |
Allow the user to collapse/expand the panel. | |
bool | isCollapsible () const |
Return if the user may collapse/expand the panel. | |
void | setResizable (bool on) |
Allow the user to resize the panel. | |
bool | isResizable () const |
Return if the user may resize the panel. | |
JSignal & | collapsed () |
Signal emitted when the panel is collapsed. | |
JSignal & | expanded () |
Signal emitted when the panel is expanded. | |
virtual void | refresh () |
Refresh the widget. |
A container with a title and standard GUI elements.
Like a Container, from which Panel derives, a panel organizes its contents using layout managers.
The panel provides standard user-interface elements, such as a title bar, top and bottom tool/menu bars, and footer buttons, and a panel may be configured to be resizable and collapsible.
Typically, panels will be added directly into a layout, and are components to organize your user interface. You may also add a panel to a plain container widget, but then you should set a size for the panel (using WWidget::resize()), in pixels.
When a panel is added to WApplication::root(), as single widget, it acts like a plain Container, and thus none of the panel specific features (tool bars, buttons, etc...) are available. If you want to have a top-level Panel, you need thus to do something like this:
// create the root container Wt::Ext::Container *rootContainer = new Wt::Ext::Container(app->root()); // create the root panel and fit it inside the container Wt::Ext::Panel *rootPanel = new Wt::Ext::Panel(); rootContainer->setLayout(new Wt::WFitLayout()); rootContainer->layout()->addWidget(rootPanel);
Wt::Ext::Panel::Panel | ( | WContainerWidget * | parent = 0 | ) |
Create a new panel.
When a parent is specified, or the panel is after construction added to a WContainerWidget, the panel should be given an explicit size in pixels, using WWidget::resize().
void Wt::Ext::Panel::addFooterButton | ( | Button * | button | ) |
Add a button to the footer of the panel.
The button is displayed below the contents, but above a bottom tool bar if it is set.
bool Wt::Ext::Panel::animate | ( | ) | const |
Return if using animations for expand/collapse.
bool Wt::Ext::Panel::autoScrollBars | ( | ) | const |
Return if showing scroll bars when needed.
bool Wt::Ext::Panel::border | ( | ) | const |
Get the border setting.
ToolBar* Wt::Ext::Panel::bottomToolBar | ( | ) | const |
Return the top tool bar.
void Wt::Ext::Panel::collapse | ( | ) |
Collapse the panel.
JSignal& Wt::Ext::Panel::collapsed | ( | ) |
Signal emitted when the panel is collapsed.
void Wt::Ext::Panel::expand | ( | ) |
Expand the panel.
JSignal& Wt::Ext::Panel::expanded | ( | ) |
Signal emitted when the panel is expanded.
const std::vector<Button *>& Wt::Ext::Panel::footerButtons | ( | ) | const |
Retrn the list of footer buttons.
bool Wt::Ext::Panel::isCollapsed | ( | ) | const |
Return if the panel is collapsed.
bool Wt::Ext::Panel::isCollapsible | ( | ) | const |
Return if the user may collapse/expand the panel.
bool Wt::Ext::Panel::isResizable | ( | ) | const |
Return if the user may resize the panel.
void Wt::Ext::Panel::refresh | ( | ) | [virtual] |
Refresh the widget.
The refresh method is invoked when the locale is changed using WApplication::setLocale() or when the user hit the refresh button.
The widget must actualize its contents in response.
Reimplemented from Wt::WWebWidget.
Reimplemented in Wt::Ext::TableView, Wt::Ext::MessageBox, and Wt::Ext::TabWidget.
void Wt::Ext::Panel::removeFooterButton | ( | Button * | button | ) |
Remove a button from the footer of the panel.
Transfers ownership back, and so you must delete the button if you wish to destroy it.
void Wt::Ext::Panel::setAnimate | ( | bool | on | ) |
Set to use animations for the expand/collapse operation.
By default, the expand/collapse operation of a panel is not animated. This setting is ignored if the panel is not collapsible.
void Wt::Ext::Panel::setAutoScrollBars | ( | bool | on | ) |
Option to show scroll bars when needed.
By default, scrollbars are disabled.
void Wt::Ext::Panel::setBorder | ( | bool | show | ) |
Change the border around the panel.
By default, a panel has a small border around it. Set show false to disable the border.
void Wt::Ext::Panel::setBottomToolBar | ( | ToolBar * | bottomBar | ) |
Set a tool bar at the bottom of the panel.
Note: you can only set a tool bar before the panel is rendered.
void Wt::Ext::Panel::setCollapsed | ( | bool | on | ) |
Set the panel expanded or callapsed.
When on is true, the panel is collapsed, minimizing screen real estate.
Initially, a panel is expanded.
void Wt::Ext::Panel::setCollapsible | ( | bool | on | ) |
Allow the user to collapse/expand the panel.
When on is true, a button is added to the title bar, which may be used to collapse/expand the panel.
By default, a panel is not collapsible.
void Wt::Ext::Panel::setResizable | ( | bool | on | ) |
Allow the user to resize the panel.
If true, then, depending on the layout the panel is in, a resize handle will be displayed at one of the panel borders.
By default, a panel may not be resized by the user.
void Wt::Ext::Panel::setTitle | ( | const WString & | title | ) |
Set a title.
The panel title is set in the title bar. This method also makes the title bar visible by calling setTitleBar(true).
When the panel is added to a TabWidget, the title serves as the tab label.
void Wt::Ext::Panel::setTitleBar | ( | bool | enable | ) |
Show or hide a title bar for the panel.
The title bar appears at the top of the panel, above the contents and the top tool bar (if there is one). By default, the title bar is not shown unless a title is set.
void Wt::Ext::Panel::setTopToolBar | ( | ToolBar * | toolBar | ) |
Set a tool bar at the top of the panel.
Note: you can only set a tool bar before the panel is rendered.
const WString& Wt::Ext::Panel::title | ( | ) | const |
Get the title.
bool Wt::Ext::Panel::titleBar | ( | ) | const |
Get the title bar.
ToolBar* Wt::Ext::Panel::topToolBar | ( | ) | const |
Return the top tool bar.