![]() |
TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
|
MainWindow is the parent container for all the other widgets in TinkerCell The central widget in MainWindow is a tab widget. Each tab widget can hold a GraphicsView or a TextEditor. One of the main roles of MainWindow is to serve as a signal/slot hub for Tools. More...
#include <MainWindow.h>
Public Types | |
enum | TOOL_WINDOW_OPTION { DockWidget, TabWidget } |
this enum is used to determine how to place a widget when used in addToolWindow. DockWidget = tool window is placed into a dockable widget TabWidget = tool window is placed in an existing tool widget, if one exists More... | |
Public Member Functions | |
MainWindow (bool enableScene=true, bool enableText=true, bool views=true) | |
5-arg (optional) constructor allows disabling of text/graphics modes | |
virtual void | allowMultipleViewModes (bool) |
allow or disallow changing between different views | |
virtual | ~MainWindow () |
Destructor: delete all the graphics scenes. | |
QDockWidget * | addToolWindow (QWidget *tool, TOOL_WINDOW_OPTION option=DockWidget, Qt::DockWidgetArea initArea=Qt::RightDockWidgetArea, Qt::DockWidgetAreas allowedAreas=Qt::AllDockWidgetAreas, bool inMenu=true) |
Add a new docking window to the main window. The name and icon are obtained using the widget's windowTitle and windowIcon, so be sure to set those before calling this function. | |
void | addToViewMenu (QWidget *tool) |
place a show/hide action in the view menu for the given widget | |
void | setCursor (QCursor cursor) |
set the cursor for all windows | |
void | addTool (Tool *tool) |
add a new tool to the list of tools stored in the main window | |
void | initializeMenus (bool enableScene=true, bool enableText=true) |
Initialize the basic menu (save, open, close, exit, etc.). | |
void | setupNewThread (QSemaphore *, QLibrary *) |
This function is usually called from a new thread. This function allows all the plugins to add their functionalities to the C function pointer of the new thread. | |
void | loadDynamicLibrary (const QString &) |
Load a new plugin (dll) | |
QPair< QList< ItemHandle * > , QList< QGraphicsItem * > > | getItemsFromFile (const QString &filename, ItemHandle *root=0) |
get the items inside a file. Some tool must implement this function and connect to the getItemsFromFile signal. The Core library does not implement a read file function. | |
GraphicsScene * | currentScene () const |
gets the current scene that is active | |
TextEditor * | currentTextEditor () const |
gets the text editor that is active | |
NetworkWindow * | currentWindow () const |
gets the current window that is active (each window contains either a scene or editor) | |
NetworkHandle * | currentNetwork () const |
gets the current window that is active | |
QList< NetworkHandle * > | networks () const |
gets all the windows in the main window | |
QUndoStack * | historyStack () const |
the history stack of the current network. | |
QUndoView * | historyWidget () |
the history stack widget of the current window. | |
virtual Tool * | tool (const QString &) const |
get a tool | |
virtual QList< Tool * > | tools (const QString &category=QString()) const |
get all tools | |
Public Attributes | |
QList< QWidget * > | toolWindows |
the set of all windows inseted in the main window using addToolWindow | |
QMenu | contextItemsMenu |
the context menu that is shown during right-click event on selected graphical items. Plugins can add new actions to this menu. | |
QMenu | contextScreenMenu |
the context menu that is shown during right-click event on the scene. Plugins can add new actions to this menu. | |
QMenu | contextSelectionMenu |
the context menu that is shown during right-click event on a text editor with text selected. Plugins can add new actions to this menu. | |
QMenu | contextEditorMenu |
the context menu that is shown during right-click event on a text editor with no text selected. Plugins can add new actions to this menu. | |
QMenu * | fileMenu |
The file menu. Plugins can add new actions to this menu. | |
QMenu * | editMenu |
The edit menu. Plugins can add new actions to this menu. | |
QMenu * | viewMenu |
The view menu. New docking windows are automatically added here. | |
QMenu * | helpMenu |
The help menu. | |
QMenu * | settingsMenu |
the menu for settings such as default plugins, Tinkercell home directory, etc. | |
QMenu * | parsersMenu |
the menu for choosing one of the available parsers (will be 0 if there are no parsers) | |
QToolBar * | toolBarBasic |
The tool bar that contains new, open, close, etc. actions. | |
QToolBar * | toolBarEdits |
The tool bar that contains copy, paste, undo, etc. | |
QToolBar * | toolBarForTools |
One of the initial tool bars which designated for tools that do not want to create a new toolbar. | |
Static Public Attributes | |
static TOOL_WINDOW_OPTION | defaultToolWindowOption |
the default option to use for tools (optional) | |
static TOOL_WINDOW_OPTION | defaultHistoryWindowOption |
the default option to use for history window | |
static TOOL_WINDOW_OPTION | defaultConsoleWindowOption |
the default option to use for console window | |
Friends | |
class | NetworkWindow |
class | NetworkHandle |
class | GraphicsScene |
class | TextEditor |
class | GraphicsView |
class | DroppableTabWidget |
slots | |
void | setUserHome () |
asks user for a new directory to be used as the user home directory (must be writtable) | |
GraphicsScene * | newScene () |
create new scene | |
TextEditor * | newTextEditor () |
create new text editor | |
void | closeWindow () |
triggered when the close button is clicked. Closes the current window | |
void | saveWindow () |
triggered when the save button is clicked. Opens a file dialog and emits the save signal. The main window itself does not implement the save. | |
void | saveWindowAs () |
triggered when the save-as button is clicked. Opens a file dialog and emits the save signal. The main window itself does not implement the save. | |
void | open () |
triggered when the open button is clicked. Opens a file dialog. Note: the core library just emits a signal, and other tools are responsible for actually opening a file | |
void | open (const QString &) |
open a file. Note: the core library just emits a signal, and other tools are responsible for actually opening a file The main window does not implement an function for opening a new file | |
void | undo () |
calls current scene or text editor's undo | |
void | redo () |
calls current scene or text editor's redo | |
void | copy () |
calls current scene or text editor's copy | |
void | cut () |
calls current scene or text editor's cut | |
void | paste () |
calls current scene or text editor's paste | |
void | selectAll () |
calls current scene or text editor's selectAll | |
void | remove () |
calls current scene or text editor's find | |
void | print () |
triggered when the print button is clicked. Calls current scene's print | |
void | printToFile (const QString &filename=QString(), int w=0, int h=0) |
triggered when the print-to-file button is clicked. Calls current scene's print on a pdf file | |
void | sendEscapeSignal (const QWidget *w=0) |
sends a signal to all plugins telling them to exit their current processes. | |
void | addParser (TextParser *) |
add a new text parser to the list of available parsers. The current text parser can be obtained using TextParser::currentParser(); | |
void | gridOn () |
change grid mode for current scene to on (>0) | |
void | gridOff () |
change grid mode for current scene to off (=0) | |
void | setGridSize () |
set grid size for current scene | |
void | popOut () |
pop-out the current window | |
ConsoleWindow * | console () const |
get the console window | |
void | readSettings () |
read initial settings from settingsFileName | |
static MainWindow * | instance () |
gets the global main window | |
void | popOut (NetworkWindow *) |
pop-out the given window | |
void | popIn (NetworkWindow *) |
pop-in the given window | |
void | setCurrentWindow (NetworkWindow *) |
sets the active window | |
void | loadFiles (const QList< QFileInfo > &files) |
loads files (library files or Network files) | |
void | changeConsoleBgColor () |
change console background color | |
void | changeConsoleTextColor () |
change console text color | |
void | changeConsoleMsgColor () |
change console message text color | |
void | changeConsoleErrorMsgColor () |
change console error text color | |
virtual void | tabIndexChanged (int) |
tab changed | |
void | itemsRemovedSlot (GraphicsScene *scene, const QList< QGraphicsItem * > &item, const QList< ItemHandle * > &handles) |
signals whenever items are deleted | |
void | itemsInsertedSlot (GraphicsScene *scene, const QList< QGraphicsItem * > &item, const QList< ItemHandle * > &handles, GraphicsScene::InsertType) |
signals whenever items are added | |
void | setupFunctionPointersSlot (QSemaphore *, QLibrary *) |
send signal to other tools so that they can connect functions to signals | |
signals | |
class | GlobalSettings |
static QString | previousFileName |
stores the last opened directory | |
static QHash< void *, bool > | invalidPointers |
stores list of all pointers that have been deleted (to prevent double-deletions) | |
bool | allowViewModeToChange |
allowed views | |
QHash< QString, QLibrary * > | dynamicallyLoadedLibraries |
the loaded dynamic libraries indexed by file name | |
ConsoleWindow * | consoleWindow |
the general window for command, errors, and messages | |
DroppableTabWidget * | tabWidget |
the central multi-document interface widget | |
QList< NetworkHandle * > | allNetworks |
the list of all network windows | |
QToolBox * | toolsWidget |
the optional tool box that will only appear if one of the plug-ins uses the tab widget argument in the addToolWindow call | |
HistoryWindow | historyWindow |
history view, not the stack itself. The stack is stored within each NetworkHandle | |
NetworkWindow * | currentNetworkWindow |
keep pointer to last selected window. Used by windowChanged signal | |
QHash< QString, Tool * > | toolsHash |
all the tools (plug-ins) are stored here, indexed by their names | |
QHash< QString, Tool * > | toolsHashByCategory |
this is a multiple hash. All the tool are stored here indexed by their category names (if they have a category) | |
bool | isValidHandlePointer (void *p) |
checks if the given address belongs to a handle | |
void | toolAboutToBeLoaded (Tool *tool, bool *shouldLoad) |
a new tool is about to be added. This signal can be used to prevent the tool from being added | |
void | historyChanged (int i=0) |
one of more changed have occurred in the history window of the current scene | |
void | funtionPointersToMainThread (QSemaphore *, QLibrary *) |
used internally by MainWindow in order to move from a thread to the main thread | |
void | toolLoaded (Tool *tool) |
signals when a new tool (plugin) is loaded | |
void | setupFunctionPointers (QLibrary *) |
signals when a new FuntionToSignal is constructed | |
void | networkClosing (NetworkHandle *, bool *) |
signals when a network is going to close | |
void | networkClosed (NetworkHandle *) |
signals after a window is closed | |
void | prepareNetworkForSaving (NetworkHandle *, bool *) |
signals when a tool is about to save a network | |
void | networkSaved (NetworkHandle *) |
signals when a tool has saved the network in a file | |
void | saveNetwork (const QString &filename) |
signals when user selects a file to save the current network to | |
void | loadNetwork (const QString &filename, bool *alreadyLoaded=0) |
signals when user selects a file to open in the current network | |
void | getItemsFromFile (QList< ItemHandle * > &, QList< QGraphicsItem * > &, const QString &filename, ItemHandle *root) |
signal sent to a tool so that the tool can get the items inside a file | |
void | networkLoaded (NetworkHandle *) |
signals informs that the current network has just loaded a new Network | |
void | networkOpened (NetworkHandle *) |
signals whenever the new network is opened | |
void | windowChanged (NetworkWindow *, NetworkWindow *) |
signals whenever the current window changes | |
void | itemsSelected (GraphicsScene *scene, const QList< QGraphicsItem * > &items, QPointF point, Qt::KeyboardModifiers modifiers) |
signals whenever a new item is selected (item can be sub-item, not top-level) | |
void | mousePressed (GraphicsScene *scene, QPointF point, Qt::MouseButton, Qt::KeyboardModifiers modifiers) |
signals whenever an empty node of the screen is clicked | |
void | mouseReleased (GraphicsScene *scene, QPointF point, Qt::MouseButton, Qt::KeyboardModifiers modifiers) |
signals whenever an empty node of the screen is clicked | |
void | mouseDoubleClicked (GraphicsScene *scene, QPointF point, QGraphicsItem *, Qt::MouseButton, Qt::KeyboardModifiers modifiers) |
emits event when mouse is double clicked | |
void | mouseDragged (GraphicsScene *scene, QPointF from, QPointF to, Qt::MouseButton, Qt::KeyboardModifiers modifiers) |
signals whenever mouse is dragged from one point to another | |
void | itemsAboutToBeMoved (GraphicsScene *scene, QList< QGraphicsItem * > &item, QList< QPointF > &distance, QList< QUndoCommand * > &) |
signals whenever items are going to be moved (each item is the top-most item) | |
void | itemsMoved (GraphicsScene *scene, const QList< QGraphicsItem * > &item, const QList< QPointF > &distance) |
signals whenever items are being moved (each item is the top-most item) | |
void | itemsAboutToBeRemoved (GraphicsScene *scene, QList< QGraphicsItem * > &item, QList< ItemHandle * > &handles, QList< QUndoCommand * > &) |
signals just before items are deleted | |
void | itemsRemoved (GraphicsScene *scene, const QList< QGraphicsItem * > &item, const QList< ItemHandle * > &handles) |
signals whenever items are deleted | |
void | itemsAboutToBeInserted (GraphicsScene *scene, QList< QGraphicsItem * > &, QList< ItemHandle * > &, QList< QUndoCommand * > &, GraphicsScene::InsertType type=GraphicsScene::NEW) |
signals whenever items are going to be added | |
void | itemsInserted (GraphicsScene *scene, const QList< QGraphicsItem * > &item, const QList< ItemHandle * > &handles, GraphicsScene::InsertType type=GraphicsScene::NEW) |
signals whenever items are added | |
void | itemsInserted (NetworkHandle *win, const QList< ItemHandle * > &) |
A convenient signal that is emitted when items are inserted from a GraphicsScene or TextEditor. Warning: listening to the other itemsInserted signals may cause redundancy. | |
void | itemsRemoved (NetworkHandle *win, const QList< ItemHandle * > &) |
A convenient signal that is emitted when items are removed from a GraphicsScene or TextEditor. Warning: listening to the other itemsRemoved signals may cause redundancy. | |
void | copyItems (GraphicsScene *scene, QList< QGraphicsItem * > &, QList< ItemHandle * > &) |
signals just before items are copied | |
void | textChanged (TextEditor *, const QString &, const QString &, const QString &) |
some text inside this editor has been changed | |
void | lineChanged (TextEditor *, int, const QString &) |
the cursor has moved to a different line | |
void | parse (TextEditor *) |
request to parse the text in the current text editor | |
void | mouseMoved (GraphicsScene *scene, QGraphicsItem *item, QPointF point, Qt::MouseButton, Qt::KeyboardModifiers modifiers, QList< QGraphicsItem * > &) |
signals whenever mouse moves, and indicates whether it is on top of an item | |
void | mouseOnTopOf (GraphicsScene *scene, QGraphicsItem *item, QPointF point, Qt::KeyboardModifiers modifiers, QList< QGraphicsItem * > &) |
signals whenever mouse is on top of an item | |
void | sceneRightClick (GraphicsScene *scene, QGraphicsItem *item, QPointF point, Qt::KeyboardModifiers modifiers) |
signals whenever right click is made on an item or sceen | |
void | keyPressed (GraphicsScene *scene, QKeyEvent *) |
signals whenever a key is pressed | |
void | keyReleased (GraphicsScene *scene, QKeyEvent *) |
signals whenever a key is released | |
void | colorChanged (GraphicsScene *scene, const QList< QGraphicsItem * > &items) |
signals whenever color of items are changed | |
void | parentItemChanged (GraphicsScene *scene, const QList< QGraphicsItem * > &items, const QList< QGraphicsItem * > &parents) |
signals whenever item parents are changed | |
void | itemsRenamed (NetworkHandle *window, const QList< ItemHandle * > &items, const QList< QString > &oldnames, const QList< QString > &newnames) |
signals whenever an item is renamed | |
void | handlesChanged (NetworkHandle *scene, const QList< QGraphicsItem * > &items, const QList< ItemHandle * > &old) |
signals whenever the handles for graphics items have changed | |
void | parentHandleChanged (NetworkHandle *scene, const QList< ItemHandle * > &, const QList< ItemHandle * > &) |
signals whenever item parent handle is changed | |
void | handleFamilyChanged (NetworkHandle *network, const QList< ItemHandle * > &, const QList< ItemFamily * > &) |
signals whenever item handles' families are changed | |
void | dataChanged (const QList< ItemHandle * > &items) |
signals whenever some data is changed | |
void | escapeSignal (const QWidget *sender) |
signals whenever the current activities need to be stopped | |
void | filesLoaded (const QList< QFileInfo > &files) |
signals whenever file(s) are loaded. Each file can be a model or a plugin | |
void | itemsDropped (GraphicsScene *, const QString &, QPointF) |
signal is emitted when some object OTHER than files are dropped on the canvas | |
void | saveSettings () |
save initial settings to settingsFileName | |
void | loadDefaultPlugins () |
load default plugins | |
void | closeEvent (QCloseEvent *event) |
close window event -- asks whether to save file | |
virtual void | dropEvent (QDropEvent *) |
drag and drop | |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
drag and drop |
MainWindow is the parent container for all the other widgets in TinkerCell The central widget in MainWindow is a tab widget. Each tab widget can hold a GraphicsView or a TextEditor. One of the main roles of MainWindow is to serve as a signal/slot hub for Tools.
Definition at line 89 of file MainWindow.h.
this enum is used to determine how to place a widget when used in addToolWindow. DockWidget = tool window is placed into a dockable widget TabWidget = tool window is placed in an existing tool widget, if one exists
Definition at line 106 of file MainWindow.h.
Tinkercell::MainWindow::MainWindow | ( | bool | enableScene = true , |
bool | enableText = true , |
||
bool | views = true |
||
) |
5-arg (optional) constructor allows disabling of text/graphics modes
bool | enable text-based network construction (default = true) |
bool | enable graphics-based network construction (default = true) |
bool | allow tabbed and windowed view modes (default = true) |
virtual Tinkercell::MainWindow::~MainWindow | ( | ) | [virtual] |
Destructor: delete all the graphics scenes.
void Tinkercell::MainWindow::addParser | ( | TextParser * | ) | [slot] |
add a new text parser to the list of available parsers. The current text parser can be obtained using TextParser::currentParser();
void Tinkercell::MainWindow::addTool | ( | Tool * | tool | ) |
add a new tool to the list of tools stored in the main window
the | name of the new tool |
the | new tool |
QDockWidget* Tinkercell::MainWindow::addToolWindow | ( | QWidget * | tool, |
TOOL_WINDOW_OPTION | option = DockWidget , |
||
Qt::DockWidgetArea | initArea = Qt::RightDockWidgetArea , |
||
Qt::DockWidgetAreas | allowedAreas = Qt::AllDockWidgetAreas , |
||
bool | inMenu = true |
||
) |
Add a new docking window to the main window. The name and icon are obtained using the widget's windowTitle and windowIcon, so be sure to set those before calling this function.
Tool* | the new tool |
Qt::DockWidgetArea | the initial docking area |
Qt::DockWidgetAreas | the allowed docking areas |
bool | whether or not to place the docking window in the view menu |
bool | use a tab widget instead of a dock widget. The widget will not be dockable, but the entire tab widget will be dockable. |
void Tinkercell::MainWindow::addToViewMenu | ( | QWidget * | tool | ) |
place a show/hide action in the view menu for the given widget
QWidget* | the new widget |
virtual void Tinkercell::MainWindow::allowMultipleViewModes | ( | bool | ) | [virtual] |
allow or disallow changing between different views
bool |
void Tinkercell::MainWindow::changeConsoleBgColor | ( | ) | [protected, slot] |
change console background color
void Tinkercell::MainWindow::changeConsoleErrorMsgColor | ( | ) | [protected, slot] |
change console error text color
void Tinkercell::MainWindow::changeConsoleMsgColor | ( | ) | [protected, slot] |
change console message text color
void Tinkercell::MainWindow::changeConsoleTextColor | ( | ) | [protected, slot] |
change console text color
void Tinkercell::MainWindow::closeEvent | ( | QCloseEvent * | event | ) | [protected] |
close window event -- asks whether to save file
QCloseEvent | * event |
void Tinkercell::MainWindow::closeWindow | ( | ) | [slot] |
triggered when the close button is clicked. Closes the current window
void Tinkercell::MainWindow::colorChanged | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | items | ||
) | [signal] |
signals whenever color of items are changed
GraphicsScene | * scene where the event took place |
QList<QGraphicsItem*>& | items that changed color |
ConsoleWindow* Tinkercell::MainWindow::console | ( | ) | const [slot] |
get the console window
void Tinkercell::MainWindow::copy | ( | ) | [slot] |
calls current scene or text editor's copy
void Tinkercell::MainWindow::copyItems | ( | GraphicsScene * | scene, |
QList< QGraphicsItem * > & | , | ||
QList< ItemHandle * > & | |||
) | [signal] |
signals just before items are copied
GraphicsScene | * scene where the items are going to be copied |
QList<QGraphicsItem*>& | list of graphics items going to be copied |
QList<ItemHandle*>& | list of handles going to be copied (does NOT have to be the same number as items removed) |
NetworkHandle* Tinkercell::MainWindow::currentNetwork | ( | ) | const |
gets the current window that is active
GraphicsScene* Tinkercell::MainWindow::currentScene | ( | ) | const |
gets the current scene that is active
TextEditor* Tinkercell::MainWindow::currentTextEditor | ( | ) | const |
gets the text editor that is active
NetworkWindow* Tinkercell::MainWindow::currentWindow | ( | ) | const |
gets the current window that is active (each window contains either a scene or editor)
void Tinkercell::MainWindow::cut | ( | ) | [slot] |
calls current scene or text editor's cut
void Tinkercell::MainWindow::dataChanged | ( | const QList< ItemHandle * > & | items | ) | [signal] |
signals whenever some data is changed
QList<ItemHandle*>& | items handles |
virtual void Tinkercell::MainWindow::dragEnterEvent | ( | QDragEnterEvent * | event | ) | [protected, virtual] |
drag and drop
virtual void Tinkercell::MainWindow::dropEvent | ( | QDropEvent * | ) | [protected, virtual] |
drag and drop
void Tinkercell::MainWindow::escapeSignal | ( | const QWidget * | sender | ) | [signal] |
signals whenever the current activities need to be stopped
QWidget | * the widget that send the signal |
void Tinkercell::MainWindow::filesLoaded | ( | const QList< QFileInfo > & | files | ) | [signal] |
signals whenever file(s) are loaded. Each file can be a model or a plugin
QList<QFileInfo>& | the name(s) of the file(s) |
void Tinkercell::MainWindow::funtionPointersToMainThread | ( | QSemaphore * | , |
QLibrary * | |||
) | [signal] |
used internally by MainWindow in order to move from a thread to the main thread
QSemaphore* | Sempahore that lets the thread run once C API is initialized |
QLibrary | * the new FuntionToSignal instance |
void Tinkercell::MainWindow::getItemsFromFile | ( | QList< ItemHandle * > & | , |
QList< QGraphicsItem * > & | , | ||
const QString & | filename, | ||
ItemHandle * | root | ||
) | [signal] |
signal sent to a tool so that the tool can get the items inside a file
QList<ItemHandle*>& | list of items inside the file |
QList<QGraphicsItem*>& | list of graphics items in the file |
QString& | file that is selected by user |
ItemHandle | * optional root parent handle for all the loaded items |
QPair< QList<ItemHandle*>, QList<QGraphicsItem*> > Tinkercell::MainWindow::getItemsFromFile | ( | const QString & | filename, |
ItemHandle * | root = 0 |
||
) |
get the items inside a file. Some tool must implement this function and connect to the getItemsFromFile signal. The Core library does not implement a read file function.
QString& | file that is selected by user |
ItemHandle* | optional parent handle to all the items that will be loaded form file |
void Tinkercell::MainWindow::gridOff | ( | ) | [slot] |
change grid mode for current scene to off (=0)
void Tinkercell::MainWindow::gridOn | ( | ) | [slot] |
change grid mode for current scene to on (>0)
void Tinkercell::MainWindow::handleFamilyChanged | ( | NetworkHandle * | network, |
const QList< ItemHandle * > & | , | ||
const QList< ItemFamily * > & | |||
) | [signal] |
signals whenever item handles' families are changed
NetworkHandle* | network where the event took place |
QList<ItemHandle*>& | child items |
QList<ItemFamily*>& | old families |
void Tinkercell::MainWindow::handlesChanged | ( | NetworkHandle * | scene, |
const QList< QGraphicsItem * > & | items, | ||
const QList< ItemHandle * > & | old | ||
) | [signal] |
signals whenever the handles for graphics items have changed
GraphicsScene* | scene where the event took place |
QList<GraphicsItem*>& | items that are affected |
QList<ItemHandle*>& | old handle for each items |
void Tinkercell::MainWindow::historyChanged | ( | int | i = 0 | ) | [signal] |
one of more changed have occurred in the history window of the current scene
int | number of changes (negative = undos, positive = redos) |
QUndoStack* Tinkercell::MainWindow::historyStack | ( | ) | const |
the history stack of the current network.
QUndoView* Tinkercell::MainWindow::historyWidget | ( | ) |
the history stack widget of the current window.
void Tinkercell::MainWindow::initializeMenus | ( | bool | enableScene = true , |
bool | enableText = true |
||
) |
Initialize the basic menu (save, open, close, exit, etc.).
static MainWindow* Tinkercell::MainWindow::instance | ( | ) | [static, slot] |
gets the global main window
bool Tinkercell::MainWindow::isValidHandlePointer | ( | void * | p | ) |
checks if the given address belongs to a handle
void Tinkercell::MainWindow::itemsAboutToBeInserted | ( | GraphicsScene * | scene, |
QList< QGraphicsItem * > & | , | ||
QList< ItemHandle * > & | , | ||
QList< QUndoCommand * > & | , | ||
GraphicsScene::InsertType | type = GraphicsScene::NEW |
||
) | [signal] |
signals whenever items are going to be added
GraphicsScene* | scene where the items are added |
QList<QGraphicsItem*>& | list of new graphics items |
QList<ItemHandle*>& | list of new handles (does NOT have to be the same number as items) |
QList<QUndoCommand*>& | list of commands that will be executed right before items are inserted |
InsertType | (optional) indicated how the items were inserted, e.g. copy/pasted or loaded from a file |
void Tinkercell::MainWindow::itemsAboutToBeMoved | ( | GraphicsScene * | scene, |
QList< QGraphicsItem * > & | item, | ||
QList< QPointF > & | distance, | ||
QList< QUndoCommand * > & | |||
) | [signal] |
signals whenever items are going to be moved (each item is the top-most item)
GraphicsScene* | scene where the items were moved |
QList<QGraphicsItem*>& | list of pointers to all moving items |
QPointF | distance by which items moved |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
QList<QUndoCommand*>& | list of commands that will be executed right before items are inserted |
void Tinkercell::MainWindow::itemsAboutToBeRemoved | ( | GraphicsScene * | scene, |
QList< QGraphicsItem * > & | item, | ||
QList< ItemHandle * > & | handles, | ||
QList< QUndoCommand * > & | |||
) | [signal] |
signals just before items are deleted
GraphicsScene* | scene where the items are going to be removed |
QList<QGraphicsItem*>& | list of items going to be removed |
QList<ItemHandle*>& | list of handles going to be removed (does NOT have to be the same number as items removed) |
QList<QUndoCommand*>& | list of commands that will be executed right before items are inserted |
void Tinkercell::MainWindow::itemsDropped | ( | GraphicsScene * | , |
const QString & | , | ||
QPointF | |||
) | [signal] |
signal is emitted when some object OTHER than files are dropped on the canvas
GraphicsScene* | the scene where objects were dropped |
QString | the string describing the object that was dropped |
QPointF | the Scene position where it was dropped |
void Tinkercell::MainWindow::itemsInserted | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | item, | ||
const QList< ItemHandle * > & | handles, | ||
GraphicsScene::InsertType | type = GraphicsScene::NEW |
||
) | [signal] |
signals whenever items are added
GraphicsScene | * scene where the items were added |
QList<QGraphicsItem*>& | list of new items |
QList<ItemHandle*>& | list of new handles (does NOT have to be the same number as items) |
InsertType | (optional) indicated how the items were inserted, e.g. copy/pasted or loaded from a file |
void Tinkercell::MainWindow::itemsInserted | ( | NetworkHandle * | win, |
const QList< ItemHandle * > & | |||
) | [signal] |
A convenient signal that is emitted when items are inserted from a GraphicsScene or TextEditor. Warning: listening to the other itemsInserted signals may cause redundancy.
NetworkHandle* | where the editting happened |
QList<TextItem*> | new items |
void Tinkercell::MainWindow::itemsInsertedSlot | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | item, | ||
const QList< ItemHandle * > & | handles, | ||
GraphicsScene::InsertType | |||
) | [protected, slot] |
signals whenever items are added
GraphicsScene | * scene where the items were added |
QList<QGraphicsItem*>& | list of new items |
QList<ItemHandle*>& | list of new handles (does NOT have to be the same number as items) |
void Tinkercell::MainWindow::itemsMoved | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | item, | ||
const QList< QPointF > & | distance | ||
) | [signal] |
signals whenever items are being moved (each item is the top-most item)
GraphicsScene | * scene where the items were moved |
QList<QGraphicsItem*>& | list of pointes to all moving items |
QPointF | distance by which items moved |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
void Tinkercell::MainWindow::itemsRemoved | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | item, | ||
const QList< ItemHandle * > & | handles | ||
) | [signal] |
signals whenever items are deleted
GraphicsScene | * scene where the items were removed |
QList<QGraphicsItem*>& | list of items removed |
QList<ItemHandle*>& | list of handles removed (does NOT have to be the same number as items removed) |
void Tinkercell::MainWindow::itemsRemoved | ( | NetworkHandle * | win, |
const QList< ItemHandle * > & | |||
) | [signal] |
A convenient signal that is emitted when items are removed from a GraphicsScene or TextEditor. Warning: listening to the other itemsRemoved signals may cause redundancy.
NetworkHandle* | where the editting happened |
ItemHandle* | removed items |
void Tinkercell::MainWindow::itemsRemovedSlot | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | item, | ||
const QList< ItemHandle * > & | handles | ||
) | [protected, slot] |
signals whenever items are deleted
GraphicsScene | * scene where the items were removed |
QList<QGraphicsItem*>& | list of items removed |
QList<ItemHandle*>& | list of handles removed (does NOT have to be the same number as items removed) |
void Tinkercell::MainWindow::itemsRenamed | ( | NetworkHandle * | window, |
const QList< ItemHandle * > & | items, | ||
const QList< QString > & | oldnames, | ||
const QList< QString > & | newnames | ||
) | [signal] |
signals whenever an item is renamed
NetworkHandle | * window where the event took place |
QList<ItemHandle*>& | items |
QList<QString>& | old names |
QList<QString>& | new names |
void Tinkercell::MainWindow::itemsSelected | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | items, | ||
QPointF | point, | ||
Qt::KeyboardModifiers | modifiers | ||
) | [signal] |
signals whenever a new item is selected (item can be sub-item, not top-level)
GraphicsScene | * scene where items are selected |
QList<QGraphicsItem*>& | list of all selected item pointers |
QPointF | point where mouse is clicked |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
void Tinkercell::MainWindow::keyPressed | ( | GraphicsScene * | scene, |
QKeyEvent * | |||
) | [signal] |
signals whenever a key is pressed
GraphicsScene | * scene where the event took place |
QKeyEvent | * key that is pressed |
void Tinkercell::MainWindow::keyReleased | ( | GraphicsScene * | scene, |
QKeyEvent * | |||
) | [signal] |
signals whenever a key is released
GraphicsScene | * scene where the event took place |
QKeyEvent | * key that is released |
void Tinkercell::MainWindow::lineChanged | ( | TextEditor * | , |
int | , | ||
const QString & | |||
) | [signal] |
the cursor has moved to a different line
TextEditor* | editor |
int | index of the current line |
QString | current line text |
void Tinkercell::MainWindow::loadDefaultPlugins | ( | ) | [protected] |
load default plugins
void Tinkercell::MainWindow::loadDynamicLibrary | ( | const QString & | ) |
Load a new plugin (dll)
the | complete path of the dll file |
void Tinkercell::MainWindow::loadFiles | ( | const QList< QFileInfo > & | files | ) | [protected, slot] |
loads files (library files or Network files)
QList<QFileInfo>& | the name(s) of the file(s) |
void Tinkercell::MainWindow::loadNetwork | ( | const QString & | filename, |
bool * | alreadyLoaded = 0 |
||
) | [signal] |
signals when user selects a file to open in the current network
QString& | file that is selected by user |
bool* | file already loaded by another plugin |
void Tinkercell::MainWindow::mouseDoubleClicked | ( | GraphicsScene * | scene, |
QPointF | point, | ||
QGraphicsItem * | , | ||
Qt::MouseButton | , | ||
Qt::KeyboardModifiers | modifiers | ||
) | [signal] |
emits event when mouse is double clicked
GraphicsScene | * scene where the event took place |
point | where mouse is clicked |
modifier | keys being used when mouse clicked |
void Tinkercell::MainWindow::mouseDragged | ( | GraphicsScene * | scene, |
QPointF | from, | ||
QPointF | to, | ||
Qt::MouseButton | , | ||
Qt::KeyboardModifiers | modifiers | ||
) | [signal] |
signals whenever mouse is dragged from one point to another
GraphicsScene | * scene where the event took place |
QPointF | point where mouse is clicked first |
QPointF | point where mouse is released |
Qt::MouseButton | button being pressed |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
void Tinkercell::MainWindow::mouseMoved | ( | GraphicsScene * | scene, |
QGraphicsItem * | item, | ||
QPointF | point, | ||
Qt::MouseButton | , | ||
Qt::KeyboardModifiers | modifiers, | ||
QList< QGraphicsItem * > & | |||
) | [signal] |
signals whenever mouse moves, and indicates whether it is on top of an item
GraphicsScene | * scene where the event took place |
QGraphicsItem* | pointer to item that mouse is on top of |
QPointF | point where mouse is clicked |
Qt::MouseButton | button being pressed |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
QList<QGraphicsItem*>& | list of items that are being moved with the mouse |
void Tinkercell::MainWindow::mouseOnTopOf | ( | GraphicsScene * | scene, |
QGraphicsItem * | item, | ||
QPointF | point, | ||
Qt::KeyboardModifiers | modifiers, | ||
QList< QGraphicsItem * > & | |||
) | [signal] |
signals whenever mouse is on top of an item
GraphicsScene | * scene where the event took place |
QGraphicsItem* | pointer to item that mouse is on top of |
QPointF | point where mouse is clicked |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
QList<QGraphicsItem*>& | list of items that are being moved with the mouse |
void Tinkercell::MainWindow::mousePressed | ( | GraphicsScene * | scene, |
QPointF | point, | ||
Qt::MouseButton | , | ||
Qt::KeyboardModifiers | modifiers | ||
) | [signal] |
signals whenever an empty node of the screen is clicked
GraphicsScene | * scene where the event took place |
QPointF | point where mouse is clicked |
Qt::MouseButton | which button was pressed |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
void Tinkercell::MainWindow::mouseReleased | ( | GraphicsScene * | scene, |
QPointF | point, | ||
Qt::MouseButton | , | ||
Qt::KeyboardModifiers | modifiers | ||
) | [signal] |
signals whenever an empty node of the screen is clicked
GraphicsScene | * scene where the event took place |
QPointF | point where mouse is clicked |
Qt::MouseButton | which button was pressed |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
void Tinkercell::MainWindow::networkClosed | ( | NetworkHandle * | ) | [signal] |
void Tinkercell::MainWindow::networkClosing | ( | NetworkHandle * | , |
bool * | |||
) | [signal] |
signals when a network is going to close
NetworkHandle | * the network that is closing |
Boolean | setting to false will prevent this window from closing |
void Tinkercell::MainWindow::networkLoaded | ( | NetworkHandle * | ) | [signal] |
signals informs that the current network has just loaded a new Network
NetworkHandle | * the window where network was loaded (usually current scene) |
void Tinkercell::MainWindow::networkOpened | ( | NetworkHandle * | ) | [signal] |
signals whenever the new network is opened
NetworkHandle* | the current new window |
QList<NetworkHandle*> Tinkercell::MainWindow::networks | ( | ) | const |
gets all the windows in the main window
void Tinkercell::MainWindow::networkSaved | ( | NetworkHandle * | ) | [signal] |
signals when a tool has saved the network in a file
NetworkHandle | * the window where network was loaded (usually current scene) |
GraphicsScene* Tinkercell::MainWindow::newScene | ( | ) | [slot] |
create new scene
TextEditor* Tinkercell::MainWindow::newTextEditor | ( | ) | [slot] |
create new text editor
void Tinkercell::MainWindow::open | ( | ) | [slot] |
triggered when the open button is clicked. Opens a file dialog. Note: the core library just emits a signal, and other tools are responsible for actually opening a file
void Tinkercell::MainWindow::open | ( | const QString & | ) | [slot] |
open a file. Note: the core library just emits a signal, and other tools are responsible for actually opening a file The main window does not implement an function for opening a new file
void Tinkercell::MainWindow::parentHandleChanged | ( | NetworkHandle * | scene, |
const QList< ItemHandle * > & | , | ||
const QList< ItemHandle * > & | |||
) | [signal] |
signals whenever item parent handle is changed
NetworkHandle | * window where the event took place |
QList<ItemHandle*>& | child items |
QList<ItemHandle*>& | old parents |
void Tinkercell::MainWindow::parentItemChanged | ( | GraphicsScene * | scene, |
const QList< QGraphicsItem * > & | items, | ||
const QList< QGraphicsItem * > & | parents | ||
) | [signal] |
signals whenever item parents are changed
GraphicsScene | * scene where the event took place |
QList<QGraphicsItem*>& | items |
QList<QGraphicsItem*>& | new parents |
void Tinkercell::MainWindow::parse | ( | TextEditor * | ) | [signal] |
request to parse the text in the current text editor
TextEditor* | editor |
void Tinkercell::MainWindow::paste | ( | ) | [slot] |
calls current scene or text editor's paste
void Tinkercell::MainWindow::popIn | ( | NetworkWindow * | ) | [protected, slot] |
pop-in the given window
void Tinkercell::MainWindow::popOut | ( | ) | [slot] |
pop-out the current window
void Tinkercell::MainWindow::popOut | ( | NetworkWindow * | ) | [protected, slot] |
pop-out the given window
void Tinkercell::MainWindow::prepareNetworkForSaving | ( | NetworkHandle * | , |
bool * | |||
) | [signal] |
signals when a tool is about to save a network
NetworkHandle | * the window where Network was loaded (usually current scene) |
void Tinkercell::MainWindow::print | ( | ) | [slot] |
triggered when the print button is clicked. Calls current scene's print
void Tinkercell::MainWindow::printToFile | ( | const QString & | filename = QString() , |
int | w = 0 , |
||
int | h = 0 |
||
) | [slot] |
triggered when the print-to-file button is clicked. Calls current scene's print on a pdf file
void Tinkercell::MainWindow::readSettings | ( | ) | [slot] |
read initial settings from settingsFileName
void Tinkercell::MainWindow::redo | ( | ) | [slot] |
calls current scene or text editor's redo
void Tinkercell::MainWindow::remove | ( | ) | [slot] |
calls current scene or text editor's find
void Tinkercell::MainWindow::saveNetwork | ( | const QString & | filename | ) | [signal] |
signals when user selects a file to save the current network to
QString& | file that is selected by user |
void Tinkercell::MainWindow::saveSettings | ( | ) | [protected] |
save initial settings to settingsFileName
void Tinkercell::MainWindow::saveWindow | ( | ) | [slot] |
triggered when the save button is clicked. Opens a file dialog and emits the save signal. The main window itself does not implement the save.
void Tinkercell::MainWindow::saveWindowAs | ( | ) | [slot] |
triggered when the save-as button is clicked. Opens a file dialog and emits the save signal. The main window itself does not implement the save.
void Tinkercell::MainWindow::sceneRightClick | ( | GraphicsScene * | scene, |
QGraphicsItem * | item, | ||
QPointF | point, | ||
Qt::KeyboardModifiers | modifiers | ||
) | [signal] |
signals whenever right click is made on an item or sceen
GraphicsScene | * scene where the event took place |
QGraphicsItem* | pointer to item that mouse is clicked on |
QPointF | point where mouse is clicked |
Qt::KeyboardModifiers | modifier keys being used when mouse clicked |
void Tinkercell::MainWindow::selectAll | ( | ) | [slot] |
calls current scene or text editor's selectAll
void Tinkercell::MainWindow::sendEscapeSignal | ( | const QWidget * | w = 0 | ) | [slot] |
sends a signal to all plugins telling them to exit their current processes.
void Tinkercell::MainWindow::setCurrentWindow | ( | NetworkWindow * | ) | [protected, slot] |
sets the active window
void Tinkercell::MainWindow::setCursor | ( | QCursor | cursor | ) |
set the cursor for all windows
QCursor | cursor |
void Tinkercell::MainWindow::setGridSize | ( | ) | [slot] |
set grid size for current scene
void Tinkercell::MainWindow::setupFunctionPointers | ( | QLibrary * | ) | [signal] |
signals when a new FuntionToSignal is constructed
QLibrary | * the new FuntionToSignal instance |
void Tinkercell::MainWindow::setupFunctionPointersSlot | ( | QSemaphore * | , |
QLibrary * | |||
) | [protected, slot] |
send signal to other tools so that they can connect functions to signals
QSemaphore* | semaphore |
QLibrary | * the dynamic library instance |
void Tinkercell::MainWindow::setupNewThread | ( | QSemaphore * | , |
QLibrary * | |||
) |
This function is usually called from a new thread. This function allows all the plugins to add their functionalities to the C function pointer of the new thread.
QSemaphore* | used to wait for all the plugins to initialize the thread |
QLibrary* | the library to load |
void Tinkercell::MainWindow::setUserHome | ( | ) | [slot] |
asks user for a new directory to be used as the user home directory (must be writtable)
virtual void Tinkercell::MainWindow::tabIndexChanged | ( | int | ) | [protected, virtual, slot] |
tab changed
void Tinkercell::MainWindow::textChanged | ( | TextEditor * | , |
const QString & | , | ||
const QString & | , | ||
const QString & | |||
) | [signal] |
some text inside this editor has been changed
TextEditor* | editor |
QString | old text (usually a line) |
QString | new text (usually a line) |
virtual Tool* Tinkercell::MainWindow::tool | ( | const QString & | ) | const [virtual] |
get a tool
QString | name of the tool |
void Tinkercell::MainWindow::toolAboutToBeLoaded | ( | Tool * | tool, |
bool * | shouldLoad | ||
) | [signal] |
a new tool is about to be added. This signal can be used to prevent the tool from being added
Tool | the tool itself |
bool& | set this bool to false to prevent the tool from loading |
void Tinkercell::MainWindow::toolLoaded | ( | Tool * | tool | ) | [signal] |
signals when a new tool (plugin) is loaded
Tool* | the new tool |
virtual QList<Tool*> Tinkercell::MainWindow::tools | ( | const QString & | category = QString() | ) | const [virtual] |
get all tools
QString | (optional) return only tools in this category, e.g. "plot" |
void Tinkercell::MainWindow::undo | ( | ) | [slot] |
calls current scene or text editor's undo
void Tinkercell::MainWindow::windowChanged | ( | NetworkWindow * | , |
NetworkWindow * | |||
) | [signal] |
signals whenever the current window changes
NetworkWindow* | the previous windpw |
NetworkWindow* | the current new window |
friend class DroppableTabWidget [friend] |
Definition at line 100 of file MainWindow.h.
friend class GlobalSettings [friend] |
Definition at line 853 of file MainWindow.h.
friend class GraphicsScene [friend] |
Definition at line 97 of file MainWindow.h.
friend class GraphicsView [friend] |
Definition at line 99 of file MainWindow.h.
friend class NetworkHandle [friend] |
Definition at line 96 of file MainWindow.h.
friend class NetworkWindow [friend] |
Definition at line 95 of file MainWindow.h.
friend class TextEditor [friend] |
Definition at line 98 of file MainWindow.h.
QList<NetworkHandle*> Tinkercell::MainWindow::allNetworks [protected] |
the list of all network windows
Definition at line 815 of file MainWindow.h.
bool Tinkercell::MainWindow::allowViewModeToChange [protected] |
allowed views
Definition at line 796 of file MainWindow.h.
ConsoleWindow* Tinkercell::MainWindow::consoleWindow [protected] |
the general window for command, errors, and messages
Definition at line 800 of file MainWindow.h.
the context menu that is shown during right-click event on a text editor with no text selected. Plugins can add new actions to this menu.
Definition at line 263 of file MainWindow.h.
the context menu that is shown during right-click event on selected graphical items. Plugins can add new actions to this menu.
Definition at line 248 of file MainWindow.h.
the context menu that is shown during right-click event on the scene. Plugins can add new actions to this menu.
Definition at line 253 of file MainWindow.h.
the context menu that is shown during right-click event on a text editor with text selected. Plugins can add new actions to this menu.
Definition at line 258 of file MainWindow.h.
keep pointer to last selected window. Used by windowChanged signal
Definition at line 821 of file MainWindow.h.
the default option to use for console window
Definition at line 115 of file MainWindow.h.
the default option to use for history window
Definition at line 112 of file MainWindow.h.
the default option to use for tools (optional)
Definition at line 109 of file MainWindow.h.
QHash<QString,QLibrary*> Tinkercell::MainWindow::dynamicallyLoadedLibraries [protected] |
the loaded dynamic libraries indexed by file name
Definition at line 798 of file MainWindow.h.
The edit menu. Plugins can add new actions to this menu.
Definition at line 271 of file MainWindow.h.
The file menu. Plugins can add new actions to this menu.
Definition at line 267 of file MainWindow.h.
The help menu.
Definition at line 279 of file MainWindow.h.
HistoryWindow Tinkercell::MainWindow::historyWindow [protected] |
history view, not the stack itself. The stack is stored within each NetworkHandle
Definition at line 819 of file MainWindow.h.
QHash<void*,bool> Tinkercell::MainWindow::invalidPointers [static] |
stores list of all pointers that have been deleted (to prevent double-deletions)
Definition at line 848 of file MainWindow.h.
the menu for choosing one of the available parsers (will be 0 if there are no parsers)
Definition at line 287 of file MainWindow.h.
QString Tinkercell::MainWindow::previousFileName [static] |
stores the last opened directory
Definition at line 845 of file MainWindow.h.
the menu for settings such as default plugins, Tinkercell home directory, etc.
Definition at line 283 of file MainWindow.h.
DroppableTabWidget* Tinkercell::MainWindow::tabWidget [protected] |
the central multi-document interface widget
Definition at line 813 of file MainWindow.h.
QToolBar* Tinkercell::MainWindow::toolBarBasic |
The tool bar that contains new, open, close, etc. actions.
Definition at line 291 of file MainWindow.h.
QToolBar* Tinkercell::MainWindow::toolBarEdits |
The tool bar that contains copy, paste, undo, etc.
Definition at line 295 of file MainWindow.h.
QToolBar* Tinkercell::MainWindow::toolBarForTools |
One of the initial tool bars which designated for tools that do not want to create a new toolbar.
Definition at line 300 of file MainWindow.h.
QHash<QString,Tool*> Tinkercell::MainWindow::toolsHash [protected] |
all the tools (plug-ins) are stored here, indexed by their names
Definition at line 823 of file MainWindow.h.
QHash<QString,Tool*> Tinkercell::MainWindow::toolsHashByCategory [protected] |
this is a multiple hash. All the tool are stored here indexed by their category names (if they have a category)
Definition at line 825 of file MainWindow.h.
QToolBox* Tinkercell::MainWindow::toolsWidget [protected] |
the optional tool box that will only appear if one of the plug-ins uses the tab widget argument in the addToolWindow call
Definition at line 817 of file MainWindow.h.
QList<QWidget*> Tinkercell::MainWindow::toolWindows |
the set of all windows inseted in the main window using addToolWindow
Definition at line 243 of file MainWindow.h.
The view menu. New docking windows are automatically added here.
Definition at line 275 of file MainWindow.h.