PanelManager Class Reference
Class which organizes all widgets which are in the side panels This class handles all side bar widgets. It can be used to display, hide or move a widget to a PaneBar. There are three Bars (left, bottom, right) which are organized by this class. Whenever a widget is being removed or added it checks first if the widget type is known and if there are available instances.
More...
#include <panel_manager.hh>
Inherits ost::gui::Widget.
Public Slots |
QMenu * | GetAvailableWidgetsMenu () |
void | ToggleViewMode (PanelPosition pos) |
void | MoveWidget (Widget *widget, PanelPosition pos, int index) |
void | MoveNextTo (Widget *target, Widget *widget) |
void | RemoveWidget (Widget *widget) |
void | ToggleHide () |
void | ToggleHide (PanelPosition pos) |
Public Member Functions |
| PanelManager (QWidget *widget) |
| ~PanelManager () |
virtual bool | Save (const QString &prefix) |
virtual bool | Restore (const QString &prefix) |
virtual void | AddWidgetToPool (const QString &class_name, int limit=-1) |
virtual void | AddWidgetToPool (const QString &name, Widget *widget) |
void | AddWidget (PanelPosition pos, Widget *widget, bool is_hidden=false) |
void | AddWidgetByName (PanelPosition pos, const QString &class_name, bool is_hidden=false) |
void | ReplaceWidget (Widget *w1, Widget *w2) |
void | ReplaceWidget (Widget *w1, QString &class_name) |
QMenu * | GetMenu () |
QList< QString > | GetAvailableWidgets () |
void | StartDrag () |
void | EndDrag () |
Detailed Description
Class which organizes all widgets which are in the side panels This class handles all side bar widgets. It can be used to display, hide or move a widget to a PaneBar. There are three Bars (left, bottom, right) which are organized by this class. Whenever a widget is being removed or added it checks first if the widget type is known and if there are available instances.
Definition at line 48 of file panel_manager.hh.
Constructor & Destructor Documentation
Member Function Documentation
Display a Widget in a PanelBar With Method you can add a widget to the given PanelBar. The widget which finally will be added to the gui will be created from the WidgetRegistry. If the WidgetPool does not know the class name of the given widget or if there are no instances left, nothing will happen.
- Parameters:
-
| pos | Indicates which PanelBar is affected |
| widget | the widget will not directly added to the PanelBar. The class_name will be used to identify the widget in the WidgetRegistry which will return a fresh instance of this class. |
| is_hidden | marks if the class should be displayed in the gui. Default the widget will be shown. |
void AddWidgetByName |
( |
PanelPosition |
pos, |
|
|
const QString & |
class_name, |
|
|
bool |
is_hidden = false | |
|
) |
| | |
virtual void AddWidgetToPool |
( |
const QString & |
name, |
|
|
Widget * |
widget | |
|
) |
| | [virtual] |
virtual void AddWidgetToPool |
( |
const QString & |
class_name, |
|
|
int |
limit = -1 | |
|
) |
| | [virtual] |
End with dragging widgets This method should be called always when a drag event is over. Normally StartDrag() is called before calling this method.
QList<QString> GetAvailableWidgets |
( |
|
) |
|
Get a List with available Widgets Get all the Widgets which have available resources in the WidgetPool.
- Returns:
- QList With all available Widgets
QMenu* GetAvailableWidgetsMenu |
( |
|
) |
[slot] |
get a QMenu with available Widget Same as GetMenu()
- Returns:
- Returns a QMenu with all available Widgets as QActions.
Get Menu The GetMenu method returns a QMenu reference, which contains various actions. The action states will be updated automatically.
- Returns:
- Reference to a QMenu which can be used for example in a QMenuBar
Move a Widget next to the given Widget The widget will be displayed next to the target Widget. The PanelWidgetContainer decides what means "next".
- Parameters:
-
| target | Target Widget the other widget will be next this widget |
| widget | This widget will be displayed next the Target Widget |
Move a Widget to the given Position The widget is being moved to the given position. If the widget is not in the WidgetPool or if there are no instances left nothing happens. The widget will always be visible at the new position.
void RemoveWidget |
( |
Widget * |
widget |
) |
[slot] |
Remove a Widget out of a PanelBar The widget will be removed if it is in a PanelBar.
- Parameters:
-
| widget | which should be removed |
void ReplaceWidget |
( |
Widget * |
w1, |
|
|
QString & |
class_name | |
|
) |
| | |
Replace a Widget with another Widget With this Method you can replace a Widget which is in a PanelBar with another Widget. If the Widget is not found in any of the PanelBar or there is no instance left in the pool of the second Widget nothing happens.
- Parameters:
-
| w1 | The widget which will be replaced |
| w2 | The new Widget which should replace the old one. |
virtual bool Restore |
( |
const QString & |
prefix |
) |
[virtual] |
virtual bool Save |
( |
const QString & |
prefix |
) |
[virtual] |
Begin with dragging widgets This method should be called, when someone tries to drop a widget on a PanelBar. It makes all PanelBar visible (even they are empty). Beware, you must call EndDrag() after drag event is over! Otherwise, the gui might not look like you expect.
Toggle the visibility of the given Panel.
- Parameters:
-
| pos | Panel which should be toggled |
void ToggleHide |
( |
|
) |
[slot] |
Toggle the visibility of all Panels.
Toggle between the ViewMode 's of the Given Panel.
- Parameters:
-
| pos | Panel which ViewMode should be toggled |
The documentation for this class was generated from the following file: