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

PanelManager ( QWidget *  widget  ) 
~PanelManager (  )  [inline]

Definition at line 52 of file panel_manager.hh.


Member Function Documentation

void AddWidget ( PanelPosition  pos,
Widget widget,
bool  is_hidden = false 
)

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 
)

Display a Widget in a PanelBar Same as PanelManager::AddWidget(PanelPosition pos, Widget* widget, bool is_hidden).

Parameters:
pos Indicates which PanelBar is affected
class_name the class_name of the widget you would like to add.
is_hidden marks if the class should be displayed in the gui. Default the widget will be shown.
virtual void AddWidgetToPool ( const QString &  name,
Widget widget 
) [virtual]

Add a widget to the widget pool.

Same as AddWidgetToPool(const QString& class_name, int limit)

Parameters:
name Name which is displayed in the gui.
widget Widget which will be added to the WidgetPool of this class and the WidgetRegistry.
virtual void AddWidgetToPool ( const QString &  class_name,
int  limit = -1 
) [virtual]

Add a widget to the widget pool.

The widget must already be in the WidgetRegistry. If you are not sure if the Widget is in the WidgetRegistry, use the PanelManager::AddWidgetToPool(const QString& name, Widget* widget) Method instead.

Parameters:
class_name class name of class which should be added to WidgetRegistry.
limit amount of parallel instances allowed (-1 if infinite)
void EndDrag (  ) 

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.
QMenu* GetMenu (  ) 

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
void MoveNextTo ( Widget target,
Widget widget 
) [slot]

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
void MoveWidget ( Widget widget,
PanelPosition  pos,
int  index 
) [slot]

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 
)

Same as PanelManager::ReplaceWidget(Widget* w1, Widget* w2)

Parameters:
w1 The widget which will be replaced
class_name The class_name which from which a instance will be created and then replaces the old one.
void ReplaceWidget ( Widget w1,
Widget w2 
)

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]

Implements Widget.

virtual bool Save ( const QString &  prefix  )  [virtual]

Implements Widget.

void StartDrag (  ) 

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.

void ToggleHide ( PanelPosition  pos  )  [slot]

Toggle the visibility of the given Panel.

Parameters:
pos Panel which should be toggled
void ToggleHide (  )  [slot]

Toggle the visibility of all Panels.

void ToggleViewMode ( PanelPosition  pos  )  [slot]

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:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 20 Jun 2016 for OpenStructure by  doxygen 1.6.1