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