Wt::Ext::Panel Class Reference
[Ext widgets]

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

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


Member Function Documentation

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.

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

ToolBar* Wt::Ext::Panel::topToolBar (  )  const [inline]

Return the top tool bar.

See also:
setTopToolBar(ToolBar *), bottomToolBar()

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.

See also:
bottomToolBar(), setTopToolBar(ToolBar *)

ToolBar* Wt::Ext::Panel::bottomToolBar (  )  const [inline]

Return the top tool bar.

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

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.

See also:
removeFooterButton(Button *), Dialog::addButton(Button *)

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.

See also:
addFooterButton(Button *), Dialog::removeButton(Button *)

const std::vector<Button *>& Wt::Ext::Panel::footerButtons (  )  const [inline]

Retrn the list of footer buttons.

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

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)

const WString& Wt::Ext::Panel::title (  )  const [inline]

Get the title.

See also:
setTitle(const WString&)

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

bool Wt::Ext::Panel::titleBar (  )  const [inline]

Get the title bar.

See also:
setTitleBar(bool)

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)

bool Wt::Ext::Panel::animate (  )  const [inline]

Return if using animations for expand/collapse.

See also:
setAnimate(bool)

void Wt::Ext::Panel::setAutoScrollBars ( bool  on  ) 

Option to show scroll bars when needed.

By default, scrollbars are disabled.

bool Wt::Ext::Panel::autoScrollBars (  )  const [inline]

Return if showing scroll bars when needed.

See also:
setAutoScrollBars(bool)

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

bool Wt::Ext::Panel::border (  )  const [inline]

Get the border setting.

See also:
setBorder(bool)

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::collapse (  ) 

Collapse the panel.

See also:
setCollapsible(bool on)

void Wt::Ext::Panel::expand (  ) 

Expand the panel.

See also:
setCollapsible(bool on)

bool Wt::Ext::Panel::isCollapsed (  )  const [inline]

Return if the panel is collapsed.

See also:
setCollapsed(bool)

collapsed() and expanded() signals

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)

bool Wt::Ext::Panel::isCollapsible (  )  const [inline]

Return if the user may collapse/expand the panel.

See also:
setCollapsible()

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.

bool Wt::Ext::Panel::isResizable (  )  const [inline]

Return if the user may resize the panel.

See also:
setResizable()

JSignal& Wt::Ext::Panel::collapsed (  )  [inline]

Signal emitted when the panel is collapsed.

See also:
setCollapsible()

JSignal& Wt::Ext::Panel::expanded (  )  [inline]

Signal emitted when the panel is expanded.

See also:
setCollapsible()

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::MessageBox, Wt::Ext::TableView, and Wt::Ext::TabWidget.


Generated on Thu May 20 18:14:52 2010 for Wt by doxygen 1.5.6