OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Public Member Functions
PanelManager Class Reference

#include <panel_manager.hh>

Inherits 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 ()
 
- Public Member Functions inherited from Widget
 Widget (QWidget *widget, QWidget *parent=NULL)
 
void SetDestroyOnClose (bool flag)
 
bool DestroyOnClose () const
 
virtual ActionList GetActions ()
 
QWidget * GetInternalWidget ()
 
void SetInternalWidget (QWidget *widget)
 
const QString & GetUniqueID () const
 
void SetUniqueID (const QString &id)
 

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
posIndicates which PanelBar is affected
widgetthe 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_hiddenmarks 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
posIndicates which PanelBar is affected
class_namethe class_name of the widget you would like to add.
is_hiddenmarks if the class should be displayed in the gui. Default the widget will be shown.
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_nameclass name of class which should be added to WidgetRegistry.
limitamount of parallel instances allowed (-1 if infinite)
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
nameName which is displayed in the gui.
widgetWidget which will be added to the WidgetPool of this class and the WidgetRegistry.
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
targetTarget Widget the other widget will be next this widget
widgetThis 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
widgetwhich should be removed
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
w1The widget which will be replaced
w2The new Widget which should replace the old one.
void ReplaceWidget ( Widget w1,
QString &  class_name 
)

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

Parameters
w1The widget which will be replaced
class_nameThe class_name which from which a instance will be created and then replaces 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 ( )
slot

Toggle the visibility of all Panels.

void ToggleHide ( PanelPosition  pos)
slot

Toggle the visibility of the given Panel.

Parameters
posPanel which should be toggled
void ToggleViewMode ( PanelPosition  pos)
slot

Toggle between the ViewMode 's of the Given Panel.

Parameters
posPanel which ViewMode should be toggled

The documentation for this class was generated from the following file: