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> 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 );
bool okToQuit()
Queries application if it is OK to quit.
void moveInspector(CanvasWindow *window)
Move the Inspector next to the edge of the Window.
void setFirstWindow()
Sets up the first CanvasWindow object.
A singleton class for keeping track the window components of HippoDraw.
hippodraw::WindowController class interface
bool m_quit
A flag that when set true will terminate the application when the last canvas window closes...
hippodraw::CanvasView class interface
This class implements additional FigureEditor functionality particular to QtView objects.
arg(long a, int fieldWidth=0, int base=10) const
Inspector * getInspector()
returns the Inspector.
hippodraw::Inspector class interface.
static std::string s_version
The version number of HippoDraw.
remove(uint index, uint len)
bool allowClose()
If document has changed and not saved, opens a dialog box for user to choose to save, discard or cancel.
void newWindow(CanvasWindow *)
Registers the new CanvasWindow and finishes its initialization.
void createInspector()
Creates the Inspector object and positions it on the desktop.
void updateActions()
Update the actions in all CanvasWindow objects.
const QRect & getScreenRect()
Returns a rectangle of the screen.
void aboutToClose(CanvasWindow *window)
Removes the window from the window list.
CanvasWindow * m_active_window
The CanvasWindow object.
Inspector * m_inspector
The Inspector.
void quitOnLastWindowClose(bool yes=true)
Sets the flag that determines if the application will be terminated when the last window is closed...
static const std::string & version()
Returns the version number of HippoDraw.
static WindowController * instance()
Returns the application instance.
void autosaveSettings()
Automatically save dock windows and recently opened files.
~WindowController()
The destructor.
void positionInspector()
Positions the Inspector as far right as possible based on size of screen and width of Inspector...
void hasBeenHidden()
Responds to hide event from a document window.
WindowController()
Private Constructor.
void setCaption()
Sets the Windows title.
findRev(QChar c, int index=-1, bool cs=TRUE) const
CanvasWindow * currentCanvas()
Returns a pointer to the current CanvasWindow.
void resizeCanvas(CanvasWindow *window)
Resizes the CanvasWindow so that it doesn't overlap with the Inspector window.
void setCurrentCanvas(CanvasWindow *canvas)
Sets the current canvas.
intp size(numeric::array arr)
CanvasView * getCanvasView()
Returns the CanvasView object.
void setInspector(Inspector *inspector)
Sets the Inspector object.
void openAssistant()
Opens the QAssistant object.
void unHide(CanvasWindow *window)
Responds to document window being shown.
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
void inhibitClose(bool yes=true)
If yes is true, sets a flag so that this object will not accept close events.
void closeAllWindows(bool alsoDelete)
Closes all Windows.
A derived class of InspectorBase class which is generated by the Qt designer.
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.
std::list< CanvasWindow * > m_window_list
The list of CanvasWindow objects created by the application.
QAssistantClient * m_assistant
The QtAssistant client.
hippodraw::CanvasWindow class interface.
static WindowController * s_instance
The instance of the application.