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

The main part of the gui that manages all dialogs and menus. More...

#include <MainGUI.h>

Public Slots

void addDockWidget (void *window, int p=0, int a=0, bool possibleCentralWidget=false)
 Makes a widget dockable in the main window. More...
 
void removeDockWidget (void *window, int p=0)
 Removes a widget from the dockables. More...
 
void genericAction (bool checked=false)
 Called when a menu item is selected. More...
 
void aboutQt () const
 Shows the standard qt about dialog. More...
 

Public Member Functions

 MainGUI (lib_manager::LibManager *theManager)
 The constructor initializes the library manager. More...
 
virtual ~MainGUI ()
 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)
 Adds a menu/menu item with its corresponding action. More...
 
virtual void setMenuActionSelected (const std::string &path, bool checked)
 Set the selection state of an menu action. More...
 
virtual void setBackgroundImage (const std::string &path="")
 Sets an image as a central widget in the main window. More...
 
MyQMainWindowmainWindow_p (void)
 Returns a pointer to the main window. More...
 
void show (void)
 Shows the main window with a predefined geometry. More...
 
void dock (bool checked)
 Docks/undocks all widgets in the main window. More...
 
bool getDocking () const
 Returns if docking mode is currently enabled. More...
 
void setWindowTitle (const std::string &title)
 
int getLibVersion () const
 Returns the current version of the library. More...
 
const std::string getLibName () const
 Returns the name of the library. More...
 
 CREATE_MODULE_INFO ()
 
- Public Member Functions inherited from mars::main_gui::GuiInterface
 GuiInterface (lib_manager::LibManager *theManager)
 The constructor initializes the library manager. More...
 
virtual ~GuiInterface ()
 A destructor. 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...
 
- Public Member Functions inherited from lib_manager::LibInterface
 LibInterface (LibManager *theManager)
 
virtual ~LibInterface (void)
 
ModuleInfo getModuleInfo () const
 
virtual void newLibLoaded (const std::string &libName)
 
virtual void createModuleInfo (void)
 

Private Attributes

MyQMainWindowmainWindow
 Holds the main window instance. More...
 
MyQMdiAreamdiArea
 Holds the mdi area instance. More...
 
QMenuBar * menuBar
 Holds the menu bar instance. More...
 
QMenu * helpMenu
 Holds the pointer to the helpMenu. More...
 
QAction * actionAboutQt
 Holds the pointer to the aboutQt action. More...
 
bool allow_toolbar
 Indicates if a toolbar is to be shown or not. More...
 
std::vector< menuStructv_qmenu
 
std::vector< genericMenugenericMenus
 

Additional Inherited Members

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

Detailed Description

The main part of the gui that manages all dialogs and menus.

See also
GuiInterface

Definition at line 69 of file MainGUI.h.

Constructor & Destructor Documentation

◆ MainGUI()

mars::main_gui::MainGUI::MainGUI ( lib_manager::LibManager theManager)

The constructor initializes the library manager.

Definition at line 44 of file MainGUI.cpp.

◆ ~MainGUI()

mars::main_gui::MainGUI::~MainGUI ( void  )
virtual

A destructor.

Definition at line 68 of file MainGUI.cpp.

Member Function Documentation

◆ aboutQt

void mars::main_gui::MainGUI::aboutQt ( ) const
slot

Shows the standard qt about dialog.

Definition at line 311 of file MainGUI.cpp.

◆ addDockWidget

void mars::main_gui::MainGUI::addDockWidget ( void *  window,
int  p = 0,
int  a = 0,
bool  possibleCentralWidget = false 
)
slot

Makes a widget dockable in the main window.

See also
GuiInterface::addDockWidget(void*, int, int)

Definition at line 289 of file MainGUI.cpp.

◆ addGenericMenuAction()

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

Adds a menu/menu item with its corresponding action.

See also
GuiInterface::addGenericMenuAction(string, int, MenuInterface*, int, string, bool, int)

Implements mars::main_gui::GuiInterface.

Definition at line 108 of file MainGUI.cpp.

◆ CREATE_MODULE_INFO()

mars::main_gui::MainGUI::CREATE_MODULE_INFO ( )

◆ dock()

void mars::main_gui::MainGUI::dock ( bool  checked)
virtual

Docks/undocks all widgets in the main window.

Implements mars::main_gui::GuiInterface.

Definition at line 277 of file MainGUI.cpp.

◆ genericAction

void mars::main_gui::MainGUI::genericAction ( bool  checked = false)
slot

Called when a menu item is selected.

Calls the corresponding MenuInterface instance with the selected action.

Parameters
checkedIndicates if the menu item is checked or not.

Definition at line 95 of file MainGUI.cpp.

◆ getDocking()

bool mars::main_gui::MainGUI::getDocking ( ) const
inlinevirtual

Returns if docking mode is currently enabled.

Implements mars::main_gui::GuiInterface.

Definition at line 115 of file MainGUI.h.

◆ getLibName()

const std::string mars::main_gui::MainGUI::getLibName ( ) const
virtual

Returns the name of the library.

See also
LibInterface::getLibName(void)

Implements lib_manager::LibInterface.

Definition at line 307 of file MainGUI.cpp.

◆ getLibVersion()

int mars::main_gui::MainGUI::getLibVersion ( ) const
virtual

Returns the current version of the library.

See also
LibInterface::getLibVersion(void)

Implements lib_manager::LibInterface.

Definition at line 303 of file MainGUI.cpp.

◆ mainWindow_p()

MyQMainWindow * mars::main_gui::MainGUI::mainWindow_p ( void  )

Returns a pointer to the main window.

Definition at line 285 of file MainGUI.cpp.

◆ removeDockWidget

void mars::main_gui::MainGUI::removeDockWidget ( void *  window,
int  p = 0 
)
slot

Removes a widget from the dockables.

See also
GuiInterface::removeDockWidget(void*, int)

Definition at line 297 of file MainGUI.cpp.

◆ setBackgroundImage()

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

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

Implements mars::main_gui::GuiInterface.

Definition at line 80 of file MainGUI.cpp.

◆ setMenuActionSelected()

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

Set the selection state of an menu action.

Implements mars::main_gui::GuiInterface.

Definition at line 315 of file MainGUI.cpp.

◆ setWindowTitle()

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

Implements mars::main_gui::GuiInterface.

Definition at line 76 of file MainGUI.cpp.

◆ show()

void mars::main_gui::MainGUI::show ( void  )
virtual

Shows the main window with a predefined geometry.

Implements mars::main_gui::GuiInterface.

Definition at line 72 of file MainGUI.cpp.

Member Data Documentation

◆ actionAboutQt

QAction* mars::main_gui::MainGUI::actionAboutQt
private

Holds the pointer to the aboutQt action.

Definition at line 187 of file MainGUI.h.

◆ allow_toolbar

bool mars::main_gui::MainGUI::allow_toolbar
private

Indicates if a toolbar is to be shown or not.

Definition at line 192 of file MainGUI.h.

◆ genericMenus

std::vector<genericMenu> mars::main_gui::MainGUI::genericMenus
private

Definition at line 200 of file MainGUI.h.

◆ helpMenu

QMenu* mars::main_gui::MainGUI::helpMenu
private

Holds the pointer to the helpMenu.

Definition at line 182 of file MainGUI.h.

◆ mainWindow

MyQMainWindow* mars::main_gui::MainGUI::mainWindow
private

Holds the main window instance.

Definition at line 167 of file MainGUI.h.

◆ mdiArea

MyQMdiArea* mars::main_gui::MainGUI::mdiArea
private

Holds the mdi area instance.

Definition at line 172 of file MainGUI.h.

◆ menuBar

QMenuBar* mars::main_gui::MainGUI::menuBar
private

Holds the menu bar instance.

Definition at line 177 of file MainGUI.h.

◆ v_qmenu

std::vector<menuStruct> mars::main_gui::MainGUI::v_qmenu
private

Definition at line 199 of file MainGUI.h.


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