--- a/src/hbcore/gui/hbtoolbarextension.cpp Wed Aug 18 10:05:37 2010 +0300
+++ b/src/hbcore/gui/hbtoolbarextension.cpp Thu Sep 02 20:44:51 2010 +0300
@@ -43,32 +43,32 @@
#include <QGraphicsGridLayout>
#include <QEventLoop>
#include <QGraphicsLinearLayout>
-
+
/*!
@stable
@hbcore
\class HbToolBarExtension
\brief The HbToolBarExtension class provides a popup extension to a toolbar.
-
+
You can use a toolbar extension to extend the main toolbar
(HbToolBar class) in a view with additional actions that are placed
in a subsidiary toolbar. Alternatively, a toolbar extension can
contain a widget, such as a list or grid. This is useful, for
example, for providing navigation between views when there are more
views than can fit as actions on the toolbar itself.
-
+
A toolbar can contain more than one toolbar extension. A toolbar
extension opens when the user triggers the toolbar action that is
associated with the extension, usually by tapping it. The user
dismisses the toolbar extension by selecting an option (which runs a
command) or by tapping outside the extension.
-
+
The following image shows a toolbar that has two extensions: the
leftmost one contains a list widget and the rightmost one contains
three standard actions.
-
+
\image html toolbarextension.png A toolbar that has two extensions
-
+
Use addAction() to create an action and add it to the toolbar
extension. There are several overloads of this function, which allow
you to specify both a text and image or just a text and also to
@@ -78,73 +78,73 @@
QGraphicsWidget) to add existing actions to the toolbar
extension. Use clearActions() to clear all of the actions and
removeAction() to remove individual actions.
-
+
The order of the actions within the toolbar extension controls the
order of the buttons that the user sees. addAction() and
addActions() append the actions to the end of the toolbar and
insertAction() and insertActions() enable you to specify the
required position.
-
+
You can use the HbDialog API to fill the toolbar extension popup
with widgets (such as a list, grid or line edit). If you do this,
any actions that you add to the toolbar extension will not be
visible.
-
+
\section _usecases_hbtoolbarextension Using the HbToolBarExtension class
-
+
\subsection _uc_001_hbtoolbarextension Creating a toolbar extension containing actions
The following example demonstrates how to add a toolbar extension button to the toolbar
and how to add actions to the toolbar extension.
\snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,27}
-
+
\subsection _uc_002_hbtoolbarextension Creating a toolbar extension containing a widget
-
+
The following example demonstrates creating a toolbar extension containing a single-selection
list widget.
-
+
\code
// Create the toolbar.
HbToolBar *toolBar = new HbToolBar();
-
+
// Add the action that will open the toolbar extension.
HbAction *radioAction = toolBar->addAction("Channel");
-
+
// Create the toolbar extension.
HbToolBarExtension *radioExtension = new HbToolBarExtension();
-
+
// Set the heading.
HbLabel* heading = new HbLabel(QString("Channel"));
radioExtension->setHeadingWidget(heading);
-
+
// Create a list widget.
HbListWidget *list = new HbListWidget();
list->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
-
+
// Make the list single selection.
list->setSelectionMode(HbAbstractItemView::SingleSelection);
-
+
// Add list items.
list->addItem("574.7");
list->addItem("976.5");
list->addItem("108.67");
-
+
// Add the list widget to the toolbar extension object.
radioExtension->setContentWidget(list);
-
+
// Add the toolbar extension to the toolbar action that will open it.
radioAction->setToolBarExtension(radioExtension);
\endcode
*/
-
+
/*!
\fn int HbToolBarExtension::type() const
*/
-
+
/*
\primitives
\primitive{background} HbFrameItem representing the extension background.
*/
-
+
HbToolBarExtensionPrivate::HbToolBarExtensionPrivate() :
HbDialogPrivate(),
mToolButtons(),
@@ -412,8 +412,8 @@
HbToolBarExtension::~HbToolBarExtension()
{
}
-
-
+
+
/*!
Creates a new action with the given \a text and adds the action
to the end of the toolbar extension, provided space is
@@ -421,7 +421,7 @@
screen size and orientation. When there is no free space, this
function does nothing. There is currently no notification when there
is no free space.
-
+
\overload
\return The new action.
*/
@@ -431,8 +431,8 @@
addAction(action);
return action;
}
-
-
+
+
/*!
Creates a new action with the given \a icon and \a text and adds
the action to the end of the toolbar extension, provided space is
@@ -440,7 +440,7 @@
screen size and orientation. When there is no free space, this
function does nothing. There is currently no notification when there
is no free space.
-
+
\overload
\return The new action.
*/
@@ -451,19 +451,19 @@
addAction(action);
return action;
}
-
-
+
+
/*!
Creates a new action with the given \a text, adds the action to
the end of the toolbar extension (provided space is available), and
connects the action's \link HbAction::triggered()
triggered()\endlink signal to a receiver object's slot.
-
+
The space available in a toolbar extension depends on the screen
size and orientation. When there is no free space, this function
does not add the action to the toolbar extension. There is currently
no notification when there is no free space.
-
+
\overload
\param text The text for the new action.
\param receiver The object that is to receive the new action's signal.
@@ -479,18 +479,18 @@
addAction(action);
return action;
}
-
+
/*!
Creates a new action with the given \a icon and \a text, adds the
action to the end of the toolbar extension (provided space is
available), and connects the action's \link HbAction::triggered()
triggered()\endlink signal to a receiver object's slot.
-
+
The space available in a toolbar extension depends on the screen
size and orientation. When there is no free space, this function
does not add the action to the toolbar extension. There is currently
no notification when there is no free space.
-
+
\overload
\param icon The image for the new action.
\param text The text for the new action.
@@ -508,7 +508,7 @@
addAction(action);
return action;
}
-
+
/*!
Returns the action associated with this toolbar extension. This
is the action in the toolbar to which this toolbar extension belongs
@@ -529,7 +529,7 @@
}
/*!
-
+
*/
bool HbToolBarExtension::event( QEvent *event )
{
@@ -551,7 +551,7 @@
}
/*!
-
+
*/
void HbToolBarExtension::polish( HbStyleParameters ¶ms )
{