Wt  3.3.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions
Wt::Ext::Panel Class Reference

A container with a title and standard GUI elements. More...

#include <Wt/Ext/Panel>

Inheritance diagram for Wt::Ext::Panel:
Inheritance graph
[legend]

List of all members.

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.
ToolBartopToolBar () const
 Return the top tool bar.
void setBottomToolBar (ToolBar *bottomBar)
 Set a tool bar at the bottom of the panel.
ToolBarbottomToolBar () 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 WStringtitle () 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.
JSignalcollapsed ()
 Signal emitted when the panel is collapsed.
JSignalexpanded ()
 Signal emitted when the panel is expanded.
virtual void refresh ()
 Refresh the widget.

Detailed Description

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);

Constructor & Destructor Documentation

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().


Member Function Documentation

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.

See also:
removeFooterButton(Button *), Dialog::addButton(Button *)
bool Wt::Ext::Panel::animate ( ) const

Return if using animations for expand/collapse.

See also:
setAnimate(bool)

Return if showing scroll bars when needed.

See also:
setAutoScrollBars(bool)
bool Wt::Ext::Panel::border ( ) const

Get the border setting.

See also:
setBorder(bool)

Return the top tool bar.

See also:
setBottomToolBar(ToolBar *), topToolBar()

Collapse the panel.

See also:
setCollapsible(bool on)

Signal emitted when the panel is collapsed.

See also:
setCollapsible()

Expand the panel.

See also:
setCollapsible(bool on)

Signal emitted when the panel is expanded.

See also:
setCollapsible()
const std::vector<Button *>& Wt::Ext::Panel::footerButtons ( ) const

Retrn the list of footer buttons.

See also:
addFooterButton(Button *), removeFooterButton(Button *)

Return if the panel is collapsed.

See also:
setCollapsed(bool)
collapsed() and expanded() signals

Return if the user may collapse/expand the panel.

See also:
setCollapsible()

Return if the user may resize the panel.

See also:
setResizable()
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.

Note:
This does *not* rerender the widget! Calling refresh() usually does not have any effect (unless you've reimplemented refresh() to attach to it an effect).

Reimplemented from Wt::WWebWidget.

Reimplemented in Wt::Ext::TableView, Wt::Ext::MessageBox, and Wt::Ext::TabWidget.

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.

See also:
addFooterButton(Button *), Dialog::removeButton(Button *)
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.

See also:
animate(), setCollapsible(bool)

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.

See also:
border()

Set a tool bar at the bottom of the panel.

Note: you can only set a tool bar before the panel is rendered.

See also:
bottomToolBar(), setTopToolBar(ToolBar *)
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.

See also:
setCollapsible(bool on)
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.

See also:
isCollapsed(), isCollapsible(), setCollapsed(bool)
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.

See also:
title(), setTitleBar(bool)
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.

See also:
setTitle(const WString&)

Set a tool bar at the top of the panel.

Note: you can only set a tool bar before the panel is rendered.

See also:
topToolBar(), setBottomToolBar(ToolBar *)
const WString& Wt::Ext::Panel::title ( ) const

Get the title.

See also:
setTitle(const WString&)
bool Wt::Ext::Panel::titleBar ( ) const

Get the title bar.

See also:
setTitleBar(bool)

Return the top tool bar.

See also:
setTopToolBar(ToolBar *), bottomToolBar()
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1