Privacy
An open-source, flexible 3D physical simulation framework
mars::main_gui::GuiInterface Class Referenceabstract

The abstract GuiInterface class provides the menu and docking functionality of the GUI. More...

#include <GuiInterface.h>

Public Member Functions

 GuiInterface (lib_manager::LibManager *theManager)
 The constructor initializes the library manager. More...
 
virtual ~GuiInterface ()
 A destructor. More...
 
virtual void addGenericMenuAction (const std::string &path, int action, MenuInterface *menu, int qtKey=0, const std::string &icon="", bool toolbar=0, int checkable=0)=0
 Adds a menu/menu item with its corresponding action. More...
 
virtual void setMenuActionSelected (const std::string &path, bool checked)=0
 Set the selection state of an menu action. More...
 
virtual void addDockWidget (void *window, int priority=0, int area=0, bool possibleCentralWidget=false)=0
 Makes a widget dockable in the main window. More...
 
virtual void removeDockWidget (void *window, int priority=0)=0
 Removes a widget from the dockables. More...
 
virtual void dock (bool dockView)=0
 Docks/undocks all widgets in the main window. More...
 
virtual bool getDocking () const =0
 Returns if docking mode is currently enabled. More...
 
virtual void setBackgroundImage (const std::string &path="")=0
 Sets an image as a central widget in the main window. More...
 
virtual void show (void)=0
 Shows the main window with a predefined geometry. More...
 
virtual void setWindowTitle (const std::string &title)=0
 
- Public Member Functions inherited from lib_manager::LibInterface
 LibInterface (LibManager *theManager)
 
virtual ~LibInterface (void)
 
virtual int getLibVersion () const =0
 
virtual const std::string getLibName () const =0
 
ModuleInfo getModuleInfo () const
 
virtual void newLibLoaded (const std::string &libName)
 
virtual void createModuleInfo (void)
 

Additional Inherited Members

- Protected Attributes inherited from lib_manager::LibInterface
LibManagerlibManager
 
ModuleInfo moduleInfo
 

Detailed Description

The abstract GuiInterface class provides the menu and docking functionality of the GUI.

Inherits from LibInterface.

Definition at line 46 of file GuiInterface.h.

Constructor & Destructor Documentation

◆ GuiInterface()

mars::main_gui::GuiInterface::GuiInterface ( lib_manager::LibManager theManager)
inline

The constructor initializes the library manager.

Definition at line 51 of file GuiInterface.h.

◆ ~GuiInterface()

virtual mars::main_gui::GuiInterface::~GuiInterface ( )
inlinevirtual

A destructor.

Definition at line 55 of file GuiInterface.h.

Member Function Documentation

◆ addDockWidget()

virtual void mars::main_gui::GuiInterface::addDockWidget ( void *  window,
int  priority = 0,
int  area = 0,
bool  possibleCentralWidget = false 
)
pure virtual

Makes a widget dockable in the main window.

Parameters
windowA pointer to the widget being docked.
priority0 indicates that the widget is closable, 1 - not.
areaAn indicator to the initial docking area of the widget. Default area is Qt::LeftDockWidgetArea.

◆ addGenericMenuAction()

virtual void mars::main_gui::GuiInterface::addGenericMenuAction ( const std::string &  path,
int  action,
MenuInterface menu,
int  qtKey = 0,
const std::string &  icon = "",
bool  toolbar = 0,
int  checkable = 0 
)
pure virtual

Adds a menu/menu item with its corresponding action.

Parameters
pathThe menu path of the item being added. Should begin with "../". If a parent item does not exist, it is created.
actionAn unique for the class action used to recognize the selected menu item.
menuThe inheriting class, which implements the menuAction function.
qKeyA key or key sequence that selects this menu entry.
iconA path to an icon file for the menu item.
toolbarA boolean value indicating if the item is also shown in the toolbar of the main window.
checkableA boolean value indicating if the menu item is checkable or not.
this->addGenericMenuAction("../File/New", ACTION_FILE_NEW,
(main_gui::MenuInterface*)this, QKeySequence("CTRL+N"),
"images/empty_file.jpg", 1, 0);
This example produces a menu item File->New with Ctrl+N shortcut to it, with an icon, shown in the toolbar, not checkable.

Implemented in mars::main_gui::MainGUI.

◆ dock()

virtual void mars::main_gui::GuiInterface::dock ( bool  dockView)
pure virtual

Docks/undocks all widgets in the main window.

Implemented in mars::main_gui::MainGUI.

◆ getDocking()

virtual bool mars::main_gui::GuiInterface::getDocking ( ) const
pure virtual

Returns if docking mode is currently enabled.

Implemented in mars::main_gui::MainGUI.

◆ removeDockWidget()

virtual void mars::main_gui::GuiInterface::removeDockWidget ( void *  window,
int  priority = 0 
)
pure virtual

Removes a widget from the dockables.

Parameters
windowThe widget being removed.
priorityIf 0, the widget is closed; otherwise it is hidden.

◆ setBackgroundImage()

virtual void mars::main_gui::GuiInterface::setBackgroundImage ( const std::string &  path = "")
pure virtual

Sets an image as a central widget in the main window.

Implemented in mars::main_gui::MainGUI.

◆ setMenuActionSelected()

virtual void mars::main_gui::GuiInterface::setMenuActionSelected ( const std::string &  path,
bool  checked 
)
pure virtual

Set the selection state of an menu action.

Implemented in mars::main_gui::MainGUI.

◆ setWindowTitle()

virtual void mars::main_gui::GuiInterface::setWindowTitle ( const std::string &  title)
pure virtual

Implemented in mars::main_gui::MainGUI.

◆ show()

virtual void mars::main_gui::GuiInterface::show ( void  )
pure virtual

Shows the main window with a predefined geometry.

Implemented in mars::main_gui::MainGUI.


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