OpenStructure
Public Slots | Public Member Functions
PanelBar Class Reference

#include <panel_bar.hh>

Inherits Widget.

Inherited by BottomBar, and SideBar.

Public Slots

void InsertWidget (Widget *widget, int index, bool is_hidden=false)
 
void ToggleViewMode ()
 
void ToggleHide ()
 
void RemoveWidget (Widget *widget)
 

Public Member Functions

 PanelBar (QWidget *parent)
 
virtual ~PanelBar ()
 
virtual bool Save (const QString &prefix)
 
virtual bool Restore (const QString &prefix)
 
virtual void AddWidget (Widget *widget, bool hidden)
 
void AddViewMode (PanelWidgetContainer *pwc)
 
QMenu * GetViewModeMenu ()
 
int GetIndex (Widget *widget)
 
void DragEnter ()
 
void EndDrag ()
 
QAction * GetShowAction ()
 
- 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

Panel Bar which may contain other Widgets A PanelBar might have different ViewModes which are PanelWidgetContainer classes. Per default a PanelWidgetContainer has no ViewMode therefore first of all a view mode must be added. Otherwise nothing will be displayed. The ViewMode is responsible for how the widget is displayed. This class keeps only track about the order of the added widgets and the ViewModes.

Definition at line 53 of file panel_bar.hh.

Constructor & Destructor Documentation

◆ PanelBar()

PanelBar ( QWidget *  parent)

◆ ~PanelBar()

virtual ~PanelBar ( )
virtual

Member Function Documentation

◆ AddViewMode()

void AddViewMode ( PanelWidgetContainer pwc)

◆ AddWidget()

virtual void AddWidget ( Widget widget,
bool  hidden 
)
virtual

Add a widget to this widget Puts a widget at the end of the current PanelWidgetContainer.

Parameters
widgetWhich should be added
hiddenif this is true widget will not be shown

◆ DragEnter()

void DragEnter ( )

Begin with dragging widgets This method is called by the PanelManager class. Read more about this method at PanelManager::StartDrag() .

◆ EndDrag()

void EndDrag ( )

Stop dragging widgets This method is called by the PanelManager class. Read more about this method at PanelManager::EndDrag() .

◆ GetIndex()

int GetIndex ( Widget widget)

Get the index of a given widget The index of a widget is the position number. This method can be used to get the position of a widget within the PanelBar.

Parameters
widgetget index of this widget
Returns
index of the given widget -1 if Widget is not found.

◆ GetShowAction()

QAction* GetShowAction ( )

Get action which changes the visibility of this widget The returned action can be used for example in a MenuBar to allow hiding / showing this class.

Returns
QAction that can change the visibility of this widget

◆ GetViewModeMenu()

QMenu* GetViewModeMenu ( )

Get QMenu with view modes The returned menu can be used for exmaple in the menubar to allow the user choose the view mode.

Returns
QMenu with all added view modes as actions.

◆ InsertWidget

void InsertWidget ( Widget widget,
int  index,
bool  is_hidden = false 
)
slot

This slot adds a given widget at the given position The Widget will be added at the given index. If the widget is already in this panel, it will be moved to the given index.

Parameters
widgetWhich should be inserted
indexthe position where the widget will be inserted
is_hiddenmarks if the widget will be inserted hidden or visible. true = widget is visible.

◆ RemoveWidget

void RemoveWidget ( Widget widget)
slot

Remove a Widget The widget will be removed if it is in this PanelBar.

Parameters
widgetwhich should be removed

◆ Restore()

virtual bool Restore ( const QString &  prefix)
virtual

Implements Widget.

◆ Save()

virtual bool Save ( const QString &  prefix)
virtual

Implements Widget.

◆ ToggleHide

void ToggleHide ( )
slot

Toggle the visibility of all Panels.

◆ ToggleViewMode

void ToggleViewMode ( )
slot

Change to the next view mode This method changes the view mode to the next view mode. If the view mode reaches the end of the list, the first one will be displayed.


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