#include <WindowController.h>
Collaboration diagram for WindowController:
It can be used as a helper function to an application.
Definition at line 42 of file WindowController.h.
Public Member Functions | |
void | aboutToClose (CanvasWindow *window) |
Removes the window from the window list. | |
void | closeAllWindows () |
Closes all Windows. | |
void | createInspector () |
Creates the Inspector object and positions it on the desktop. | |
CanvasWindow * | currentCanvas () |
Returns a pointer to the current CanvasWindow. | |
Inspector * | getInspector () |
returns the Inspector. | |
void | hasBeenHidden (CanvasWindow *window) |
Responds to hide event from a document window. | |
void | newWindow (CanvasWindow *) |
Registers the new CanvasWindow and finishes its initialization. | |
bool | okToQuit () |
Queries application if it is Ok to quit. | |
void | quitOnLastWindowClose (bool yes=true) |
Sets the flag that determines if the applicaiton will be terminated when the last window is closed. | |
void | setCurrentCanvas (CanvasWindow *canvas) |
Sets the current canvas. | |
void | setFirstWindow () |
Sets up the first CanvasWindow object. | |
void | unHide (CanvasWindow *window) |
Reponds to document window being shown. | |
void | updateActions () |
Update the actions in all CanvasWindow objects. | |
WindowController () | |
Private Constructor. | |
~WindowController () | |
The destructor. | |
Static Public Member Functions | |
static WindowController * | instance () |
Returns the application instance. | |
static const std::string & | version () |
Returns the version number of HippoDraw. | |
Private Member Functions | |
const QRect & | getScreenRect () |
Returns a rectangle of the screen. | |
void | positionCanvas (CanvasWindow *window) |
Positions and sets the size of the window taking into account the size of the screen. | |
void | positionInspector () |
Positions the Inspector based on size of screen and width of Inspector. | |
void | resizeCanvas (CanvasWindow *window) |
Resizes the CanvasWindow so that it doesn't overlap with the Inspector window. | |
Private Attributes | |
CanvasWindow * | m_active_window |
The CanvasWindow object. | |
Inspector * | m_inspector |
The Inspector. | |
bool | m_quit |
A flag that when set true will terminate the application when the last canvas window closes. | |
std::list< CanvasWindow * > | m_window_list |
The list of CanvasWindow objects created by the application. | |
Static Private Attributes | |
static WindowController * | s_instance = 0 |
The instance of the application. | |
static std::string | s_version |
The version number of HippoDraw. |
|
Private Constructor.
Definition at line 50 of file WindowController.cxx. References s_instance. Referenced by instance(). |
|
The destructor.
Definition at line 58 of file WindowController.cxx. |
|
Removes the window from the window list.
Definition at line 108 of file WindowController.cxx. References CanvasWindow::inhibitClose(), m_inspector, m_quit, and m_window_list. |
|
Closes all Windows. Closes all Document windows as well as the Inspector window. Effectively this will terminate the application. Definition at line 179 of file WindowController.cxx. References m_inspector, and m_window_list. |
|
Creates the Inspector object and positions it on the desktop.
Definition at line 71 of file WindowController.cxx. References m_inspector, and positionInspector(). Referenced by setFirstWindow(). |
|
Returns a pointer to the current CanvasWindow.
Definition at line 266 of file WindowController.cxx. References m_active_window. Referenced by Inspector::cutNew(), Inspector::fillPlotterList(), and Inspector::summaryNew(). |
|
returns the Inspector.
Definition at line 271 of file WindowController.cxx. References m_inspector. |
|
Returns a rectangle of the screen.
Definition at line 194 of file WindowController.cxx. References QApplication::desktop(), QDesktopWidget::primaryScreen(), and QDesktopWidget::screenGeometry(). Referenced by positionCanvas(), positionInspector(), and resizeCanvas(). |
|
Responds to hide event from a document window. If all document windows are hidden, then hides the Inspector window as well. Otherwise, does nothing. Definition at line 130 of file WindowController.cxx. References m_inspector, and m_window_list. |
|
|
Registers the new CanvasWindow and finishes its initialization.
Definition at line 79 of file WindowController.cxx. References CanvasWindow::getCanvasView(), CanvasWindow::inhibitClose(), m_inspector, m_quit, m_window_list, positionCanvas(), resizeCanvas(), setCurrentCanvas(), CanvasView::setInspector(), and num_util::size(). Referenced by CanvasWindow::CanvasWindow(). |
|
Queries application if it is Ok to quit.
The application queries each document window for unsaved changes. If any window refuses to close, the application returns
Definition at line 152 of file WindowController.cxx. References CanvasWindow::allowClose(), m_quit, and m_window_list. |
|
Positions and sets the size of the window taking into account the size of the screen.
Definition at line 205 of file WindowController.cxx. References getScreenRect(), m_active_window, QRect::size(), num_util::size(), and QRect::topLeft(). Referenced by newWindow(). |
|
Positions the Inspector based on size of screen and width of Inspector.
Definition at line 250 of file WindowController.cxx. References getScreenRect(), m_inspector, QPoint::setX(), num_util::size(), QSize::width(), and QRect::width(). Referenced by createInspector(). |
|
Sets the flag that determines if the applicaiton will be terminated when the last window is closed.
Definition at line 103 of file WindowController.cxx. References m_quit. Referenced by setFirstWindow(). |
|
Resizes the CanvasWindow so that it doesn't overlap with the Inspector window.
Definition at line 223 of file WindowController.cxx. References getScreenRect(), QSize::height(), m_inspector, QSize::setHeight(), QSize::setWidth(), QRect::size(), num_util::size(), QSize::width(), and QPoint::x(). Referenced by newWindow(). |
|
Sets the current canvas. This method does not change the canvas' window active state which is control by the windowing system. The intent of this method is to allow CanvasWindow object to inform the application that it has become active. Definition at line 261 of file WindowController.cxx. References m_active_window. Referenced by newWindow(). |
|
Sets up the first CanvasWindow object.
Definition at line 278 of file WindowController.cxx. References createInspector(), quitOnLastWindowClose(), and CanvasWindow::setCaption(). |
|
Reponds to document window being shown. Shows the Inspector window if it had been hidden. Definition at line 147 of file WindowController.cxx. References m_inspector. |
|
Update the actions in all CanvasWindow objects. Update the enabled status of all actions, such as menu items and tool bar icons, of all windows. Sends CanvasWindow::updateActions to all windows. Definition at line 173 of file WindowController.cxx. References std::for_each(), m_window_list, std::mem_fun(), and CanvasWindow::updateActions(). |
|
Returns the version number of HippoDraw.
Definition at line 45 of file WindowController.cxx. References s_version. Referenced by CanvasView::helpAbout(). |
|
The CanvasWindow object.
Definition at line 54 of file WindowController.h. Referenced by currentCanvas(), positionCanvas(), and setCurrentCanvas(). |
|
The Inspector.
Definition at line 57 of file WindowController.h. Referenced by aboutToClose(), closeAllWindows(), createInspector(), getInspector(), hasBeenHidden(), newWindow(), positionInspector(), resizeCanvas(), and unHide(). |
|
A flag that when set
Definition at line 69 of file WindowController.h. Referenced by aboutToClose(), newWindow(), okToQuit(), and quitOnLastWindowClose(). |
|
The list of CanvasWindow objects created by the application.
Definition at line 51 of file WindowController.h. Referenced by aboutToClose(), closeAllWindows(), hasBeenHidden(), newWindow(), okToQuit(), and updateActions(). |
|
The instance of the application.
Definition at line 41 of file WindowController.cxx. Referenced by instance(), and WindowController(). |
|
The version number of HippoDraw.
Referenced by version(). |