#include <modularWidget.h>
Inheritance diagram for VIEW::ModularWidget:
Registering | |
virtual void | initializeWidget (MainControl &main_control) |
Initialize the widget. | |
virtual void | finalizeWidget (MainControl &main_control) |
Remove the widget custom items, e.g all menu entries. | |
virtual bool | canHandle (const String &) const |
Test if this ModularWidget can handle a given file format. | |
virtual bool | openFile (const String &) |
Tell this ModularWidget to open a given file. | |
void | registerWidget (ModularWidget *mwidget) throw (Exception::NullPointer) |
Register the widget mwidget to the MainControl. | |
Public Member Functions | |
void | setWorkingDirFromFilename_ (String filename) throw () |
virtual void | showHelp (const String &url) |
Constructors | |
ModularWidget (const char *name="<ModularWidget>") throw () | |
Default Constructor. | |
ModularWidget (const ModularWidget &widget) throw () | |
Copy constructor. | |
Destructors | |
virtual | ~ModularWidget () throw () |
Destructor. | |
virtual void | destroy () throw () |
Explicit destructor. | |
virtual void | clear () throw () |
Explicit default initialization. | |
Management of menu and toolbar entries | |
virtual void | checkMenu (MainControl &main_control) throw () |
Menu checking method. | |
QAction * | insertMenuEntry (Position parent_id, const String &name, const QObject *receiver=0, const char *slot=0, QKeySequence accel=QKeySequence()) throw () |
void | setMenuHint (const String &hint) |
Set the hint for the last added menu entry. | |
void | setMenuHelp (const String &url) |
Set the help URL for the last added menu entry. | |
virtual void | registerForHelpSystem (const QObject *object, const String &url) |
Register an QObject for the help system. | |
virtual void | addToolBarEntries (QToolBar *main_tb) |
Add the widgets actions to the (main) toolbar. | |
void | setIcon (const String &filename, bool add_to_main_toolbar=true) |
Set the icon for the last added QAction. | |
Preferences handling | |
virtual void | initializePreferencesTab (Preferences &preferences) throw () |
Initialize a preferences tab for the widget (if needed). | |
virtual void | finalizePreferencesTab (Preferences &preferences) throw () |
Remove the preferences tab. | |
virtual void | applyPreferences () throw () |
Apply the preferences of the specific tab. | |
virtual void | fetchPreferences (INIFile &inifile) throw () |
Fetch the widgets preferences from the INIFile. | |
virtual void | writePreferences (INIFile &inifile) throw () |
Writes the widgets preferences to the INIFile. | |
Preferences handling | |
bool | lockComposites () throw () |
Try to get an exclusive lock on the Composites, so that they can not be altered by any other ModularWidget. | |
bool | unlockComposites () throw () |
Unlock the Composites. | |
Convenience methods | |
MainControl * | getMainControl () const throw () |
Return the MainControl of this ModularWidget Implemented for convenience. | |
virtual void | setStatusbarText (String text, bool important=false) throw () |
Set the text of the statusbar of the main application. | |
String | getWorkingDir () throw () |
Implemented for convenience. | |
void | setWorkingDir (const String &dir) throw () |
Implemented for convenience. | |
FragmentDB & | getFragmentDB () const throw () |
Return the FragmentDB. | |
Debugging and Diagnostics | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. | |
Protected Attributes | |
QAction * | window_menu_entry_ |
bool | show_window_enty_ |
bool | default_visible_ |
QAction * | last_action_ |
QList< QAction * > | main_toolbar_actions_ |
The VIEW framework provides a simple mechanism for Rapid Application Prototyping based on modular widgets. Using these modular widgets and the MainControl class (or more precisely, classes derived from MainControl) applications can be developed in a plug&play style. Inserting an instance of one of these widgets automatically creates the required menus and menu entries in the menubar of the main window, sets up the required connections, and registers the class instance for usage from the embedded Python interpreter (if desired).
When implementing classes derived from ModularWidget and access to the class from Python is desired, please remember to include the BALL_EMBEDDABLE macro in the public section of your class declaration. Also make sure that the QT class you derive from (e.g. QWidget) is the first base class and ModularWidget second.
Remember: A ModularWidget is not notified by the Messages it sends itself!
|
Default Constructor. Set the name of this ModularWidget to name.
|
|
Copy constructor.
|
|
Destructor. If the ModularWidget was registered, it will call MainControl::removeModularWidget. |
|
Add the widgets actions to the (main) toolbar. This method is needed to enable ordering the entries. It is called in Mainframe. Reimplemented in VIEW::EditableScene, and VIEW::Scene. |
|
Apply the preferences of the specific tab. In this method the widget can extract any changed values from its preferences tab (if required). This method is called automatically by the applyPreferencesTab from the MainControl object if the apply button in the Preferences dialog is pressed.
Reimplemented in VIEW::DisplayProperties, VIEW::Server, VIEW::EditableScene, VIEW::PyWidget, and VIEW::Scene. |
|
Test if this ModularWidget can handle a given file format.
Reimplemented in VIEW::MolecularFileDialog, VIEW::DatasetControl, VIEW::PyWidget, and VIEW::TestFramework. |
|
Menu checking method. This method is called MainControl::checkMenus before a popup menu is shown. It should be used to update the state of menu entries (e.g. disable or enable entries).
Reimplemented in VIEW::DisplayProperties, VIEW::DownloadPDBFile, VIEW::LabelDialog, VIEW::MolecularFileDialog, VIEW::PubChemDialog, VIEW::DatasetControl, VIEW::DockingController, VIEW::EditableScene, VIEW::FileObserver, VIEW::GeometricControl, VIEW::MolecularStructure, VIEW::PyWidget, VIEW::Scene, and VIEW::TestFramework. |
|
Explicit default initialization. Currently does nothing. Reimplemented from VIEW::ConnectionObject. Reimplemented in VIEW::Server, VIEW::GeometricControl, VIEW::PyWidget, and VIEW::Scene. |
|
Explicit destructor. Calls clear
Reimplemented from VIEW::ConnectionObject. |
|
Internal state dump. Dump the current internal state of this mainControl to the output ostream s with dumping depth depth. Calls ConnectionObject::dump.
Reimplemented from Embeddable. Reimplemented in VIEW::Server, VIEW::PyWidget, and VIEW::Scene. |
|
Fetch the widgets preferences from the INIFile. This method is called automatically by MainControl::show() at the start of the application.
Reimplemented in VIEW::DownloadPDBFile, VIEW::LabelDialog, VIEW::DockingController, VIEW::DockWidget, VIEW::MolecularControl, VIEW::MolecularStructure, VIEW::PyWidget, and VIEW::Scene. |
|
Remove the preferences tab. This method can remove a preferences widget (if created in initializePreferencesTab) from the Preferences dialog of the MainControl. This method is called automatically by MainControl::aboutToExit() at the end of the application.
Reimplemented in VIEW::DisplayProperties, VIEW::Server, VIEW::EditableScene, VIEW::PyWidget, and VIEW::Scene. |
|
Remove the widget custom items, e.g all menu entries. This method should reverse all actions performed in initializeWidget (remove menu entries and connections of this ModularWidget). Call this method also in derived classes finalizeWidget to remove the menu entries. This method will be called by MainControl::aboutToExit().
Reimplemented in VIEW::Server, VIEW::EditFunctions, VIEW::LogView, and VIEW::PyWidget. |
|
Return the FragmentDB. Note: The ModularWidget must be registered to a MainControl. Implemented for convenience. |
|
Return the MainControl of this ModularWidget Implemented for convenience.
|
|
Initialize a preferences tab for the widget (if needed). This method can be used to create preferences widgets that can be inserted into the Preferences dialog with the method insertTab. This method is called automatically by MainControl::show at the start of the application.
Reimplemented in VIEW::DisplayProperties, VIEW::Server, VIEW::EditableScene, VIEW::PyWidget, and VIEW::Scene. |
|
Initialize the widget. This method is called automatically immediately before the main application is started. It should add the widget's menu entries and connections (if required). This method will be called by MainControl::show.
Reimplemented in VIEW::DisplayProperties, VIEW::LabelDialog, VIEW::MolecularFileDialog, VIEW::OpenBruker1DFile, VIEW::OpenBruker2DFile, VIEW::PubChemDialog, VIEW::Server, VIEW::DatasetControl, VIEW::DockingController, VIEW::DockWidget, VIEW::EditableScene, VIEW::EditFunctions, VIEW::FileObserver, VIEW::GenericControl, VIEW::GeometricControl, VIEW::HelpViewer, VIEW::LogView, VIEW::MolecularControl, VIEW::MolecularStructure, VIEW::PyWidget, VIEW::Scene, and VIEW::TestFramework. |
|
Try to get an exclusive lock on the Composites, so that they can not be altered by any other ModularWidget.
|
|
Tell this ModularWidget to open a given file.
Reimplemented in VIEW::MolecularFileDialog, VIEW::DatasetControl, VIEW::PyWidget, and VIEW::TestFramework. |
|
Register an QObject for the help system.
Reimplemented in VIEW::DockWidget, and VIEW::HelpViewer. |
|
Register the widget mwidget to the MainControl. ModularWidget objects must always be created with MainControl as parent and must have this method in their constructors. This method connects them to the MainControl object.
|
|
Set the icon for the last added QAction. The file is searched in BALL/data/graphics. |
|
Set the help URL for the last added menu entry.
|
|
Set the hint for the last added menu entry.
|
|
Set the text of the statusbar of the main application. Note: The ModularWidget must be registered to a MainControl. Implemented for convenience. |
|
Writes the widgets preferences to the INIFile. This method is called automatically by MainControl::aboutToExit at the end of the application.
Reimplemented in VIEW::DownloadPDBFile, VIEW::LabelDialog, VIEW::DockingController, VIEW::DockWidget, VIEW::MolecularControl, VIEW::MolecularStructure, VIEW::PyWidget, and VIEW::Scene. |