OpenStructure
|
#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) |
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.
PanelManager | ( | QWidget * | widget | ) |
|
inline |
Definition at line 52 of file panel_manager.hh.
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.
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)
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 |
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.
class_name | class name of class which should be added to WidgetRegistry. |
limit | amount of parallel instances allowed (-1 if infinite) |
|
virtual |
Add a widget to the widget pool.
Same as AddWidgetToPool(const QString& class_name, int limit)
name | Name which is displayed in the gui. |
widget | Widget 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.
|
slot |
QMenu* GetMenu | ( | ) |
Get Menu The GetMenu method returns a QMenu reference, which contains various actions. The action states will be updated automatically.
|
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.
|
slot |
void ReplaceWidget | ( | Widget * | w1, |
QString & | class_name | ||
) |
Same as PanelManager::ReplaceWidget(Widget* w1, Widget* w2)
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. |
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.
w1 | The widget which will be replaced |
w2 | The new Widget which should replace the old one. |
|
virtual |
Implements Widget.
|
virtual |
Implements Widget.
void StartDrag | ( | ) |
|
slot |
Toggle the visibility of all Panels.
|
slot |
Toggle the visibility of the given Panel.
pos | Panel which should be toggled |
|
slot |
Toggle between the ViewMode 's of the Given Panel.
pos | Panel which ViewMode should be toggled |