14 #include "msdevstudio/MSconfig.h"
19 #ifdef HAVE_CONFIG_H // for VERSION
29 #include <qapplication.h>
30 #if QT_VERSION < 0x040000
32 #include <QtGui/QDesktopWidget>
35 #if QT_VERSION < 0x040000
36 #include <qassistantclient.h>
38 #include <QtAssistant/QAssistantClient>
50 using namespace hippodraw;
61 : m_active_window ( 0 ),
98 else if ( size == 1 ) {
121 QPoint w_pos = window -> pos ();
123 int pos = w_pos.
x() + static_cast <
int > ( 1.05 * w_size.
width () );
167 bool allhidden =
true;
168 #ifdef ITERATOR_MEMBER_DEFECT
171 list < CanvasWindow * > :: iterator first =
m_window_list.begin ();
174 allhidden = w->isMinimized ();
175 if ( allhidden ==
false )
break;
177 if ( allhidden ==
true ) {
189 #ifdef ITERATOR_MEMBER_DEFECT
192 list < CanvasWindow * > :: iterator first =
m_window_list.begin ();
218 #ifdef ITERATOR_MEMBER_DEFECT
221 list < CanvasWindow * > :: iterator first =
m_window_list.begin ();
224 window -> setAllowClose (
true );
225 window->close ( alsoDelete );
231 #if QT_VERSION < 0x040000
256 p.
setY ( p.
y() + 23 );
276 if ( w_size.
width() > insp_pos.
x () ) {
277 double x = insp_pos.
x ();
278 double w = w_size.
width ();
279 double scale = 0.90 * ( x / w );
281 cv -> scaleBy ( scale );
283 QSize size = window -> sizeHint ();
284 int width = static_cast <
int > ( 0.95 * insp_pos.
x () );
286 window -> resize ( size );
345 LPCTSTR module =
"qthippo.dll";
346 HMODULE handle = GetModuleHandle ( module );
348 TCHAR path[MAX_PATH];
349 DWORD count = GetModuleFileName ( handle, path, size );
353 exe_path.
remove ( module );
354 unsigned int len = exe_path.
length();
366 QString docs_path = exe_path +
"/doc";
372 #if QT_VERSION < 0x030200
382 QString page (
"%1/assist_root.html" );
383 page = page.
arg ( docs_path );
void hasBeenHidden()
Responds to hide event from a document window.
Inspector * m_inspector
The Inspector.
void updateActions()
Update the actions in all CanvasWindow objects.
void quitOnLastWindowClose(bool yes=true)
Sets the flag that determines if the application will be terminated when the last window is closed...
QAssistantClient * m_assistant
The QtAssistant client.
void updateActions()
Update Action objects.
void positionCanvas(CanvasWindow *window)
Positions and sets the size of the window taking into account the size of the screen.
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
void moveInspector(CanvasWindow *window)
Move the Inspector next to the edge of the Window.
arg(long a, int fieldWidth=0, int base=10) const
std::list< CanvasWindow * > m_window_list
The list of CanvasWindow objects created by the application.
void unHide(CanvasWindow *window)
Responds to document window being shown.
bool m_quit
A flag that when set true will terminate the application when the last canvas window closes...
bool allowClose()
If document has changed and not saved, opens a dialog box for user to choose to save, discard or cancel.
hippodraw::CanvasWindow class interface.
Inspector * getInspector()
returns the Inspector.
void setCaption()
Sets the Windows title.
remove(uint index, uint len)
A derived class of InspectorBase class which is generated by the Qt designer.
void newWindow(CanvasWindow *)
Registers the new CanvasWindow and finishes its initialization.
CanvasView * getCanvasView()
Returns the CanvasView object.
A singleton class for keeping track the window components of HippoDraw.
void autosaveSettings()
Automatically save dock windows and recently opened files.
void setCurrentCanvas(CanvasWindow *canvas)
Sets the current canvas.
This class implements additional FigureEditor functionality particular to QtView objects.
CanvasWindow * m_active_window
The CanvasWindow object.
const QRect & getScreenRect()
Returns a rectangle of the screen.
hippodraw::WindowController class interface
void closeAllWindows(bool alsoDelete)
Closes all Windows.
hippodraw::CanvasView class interface
WindowController()
Private Constructor.
static WindowController * s_instance
The instance of the application.
void openAssistant()
Opens the QAssistant object.
static std::string s_version
The version number of HippoDraw.
intp size(numeric::array arr)
static WindowController * instance()
Returns the application instance.
hippodraw::Inspector class interface.
findRev(QChar c, int index=-1, bool cs=TRUE) const
CanvasWindow * currentCanvas()
Returns a pointer to the current CanvasWindow.
void aboutToClose(CanvasWindow *window)
Removes the window from the window list.
void inhibitClose(bool yes=true)
If yes is true, sets a flag so that this object will not accept close events.
void setFirstWindow()
Sets up the first CanvasWindow object.
void createInspector()
Creates the Inspector object and positions it on the desktop.
bool okToQuit()
Queries application if it is OK to quit.
~WindowController()
The destructor.
static const std::string & version()
Returns the version number of HippoDraw.
void resizeCanvas(CanvasWindow *window)
Resizes the CanvasWindow so that it doesn't overlap with the Inspector window.
void setInspector(Inspector *inspector)
Sets the Inspector object.
void positionInspector()
Positions the Inspector as far right as possible based on size of screen and width of Inspector...