<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_28fb57ed95c79fe5ed14c4f71fb4c2a2.html">qt</a> </div> </div> <div class="contents"> <h1>CanvasWindow.cxx</h1><a href="CanvasWindow_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00014"></a>00014 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span> <a name="l00015"></a>00015 <span class="preprocessor"></span><span class="comment">// for have root and cfitsio</span> <a name="l00016"></a>00016 <span class="preprocessor">#include "config.h"</span> <a name="l00017"></a>00017 <span class="preprocessor">#endif</span> <a name="l00018"></a>00018 <span class="preprocessor"></span> <a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="CanvasWindow_8h.html" title="hippodraw::CanvasWindow class interface.">CanvasWindow.h</a>"</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="CanvasView_8h.html" title="hippodraw::CanvasView class interface">CanvasView.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="Inspector_8h.html" title="hippodraw::Inspector class interface.">Inspector.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="QtFileDialog_8h.html" title="hippodraw::QtFileDialog class interface">QtFileDialog.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="PlotTable_8h.html" title="hippodraw::PlotTable class interface">PlotTable.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="PlotTableEvent_8h.html" title="PlotTableEvent class interface.">PlotTableEvent.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="PlotterEvent_8h.html" title="hippodraw::PlotterEvent class interface">PlotterEvent.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="QtGroupView_8h.html" title="hippodraw::QtGroupView class interface">QtGroupView.h</a>"</span> <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="SaveAsImageEvent_8h.html" title="SaveAsImageEvent class interface.">SaveAsImageEvent.h</a>"</span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="WindowController_8h.html" title="hippodraw::WindowController class interface">WindowController.h</a>"</span> <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="NTupleController_8h.html" title="hippodraw::NTupleController class interface">datasrcs/NTupleController.h</a>"</span> <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="DataSourceController_8h.html" title="DataSourceController class interface.">datasrcs/DataSourceController.h</a>"</span> <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="PlotterBase_8h.html" title="hippodraw::PlotterBase class interface.">plotters/PlotterBase.h</a>"</span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="QtXMLController_8h.html">qtxml/QtXMLController.h</a>"</span> <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="preprocessor">#include <qapplication.h></span> <a name="l00037"></a>00037 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#include <qaction.h></span> <a name="l00039"></a>00039 <span class="preprocessor">#else</span> <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="comment">//Added by the Qt porting tool:</span> <a name="l00041"></a>00041 <span class="preprocessor">#include <QtGui/QCloseEvent></span> <a name="l00042"></a>00042 <span class="preprocessor">#include <QtCore/QCustomEvent></span> <a name="l00043"></a>00043 <span class="preprocessor">#include <QtGui/QHideEvent></span> <a name="l00044"></a>00044 <span class="preprocessor">#include <QtGui/QResizeEvent></span> <a name="l00045"></a>00045 <span class="preprocessor">#include <QtGui/QShowEvent></span> <a name="l00046"></a>00046 <span class="preprocessor">#include <q3action.h></span> <a name="l00047"></a>00047 <span class="preprocessor">#endif</span> <a name="l00048"></a>00048 <span class="preprocessor"></span> <a name="l00049"></a>00049 <span class="preprocessor">#include <qmessagebox.h></span> <a name="l00050"></a>00050 <span class="preprocessor">#include <qfontdialog.h></span> <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="preprocessor">#include <algorithm></span> <a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="preprocessor">#include <cassert></span> <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keyword">using</span> std::exception; <a name="l00057"></a>00057 <span class="keyword">using</span> std::list; <a name="l00058"></a>00058 <span class="keyword">using</span> std::string; <a name="l00059"></a>00059 <span class="keyword">using</span> std::vector; <a name="l00060"></a>00060 <a name="l00061"></a>00061 <span class="keyword">using namespace </span>hippodraw; <a name="l00062"></a>00062 <a name="l00063"></a>00063 <a class="code" href="classhippodraw_1_1PlotTable.html" title="A derived class of PlotTableBase class which is generated by the Qt designer.">PlotTable</a> * CanvasWindow::s_plot_table = 0; <a name="l00064"></a>00064 <a name="l00070"></a>00070 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00071"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad2b3a4554c9bd6ed889489421ffe5977">00071</a> <span class="preprocessor"></span>CanvasWindow::CanvasWindow ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qwidget.html">QWidget</a> * parent, <a name="l00072"></a>00072 <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <a name="l00073"></a>00073 Qt::WFlags fl ) <a name="l00074"></a>00074 : <a class="code" href="classCanvasWindowBase.html" title="The base class for the CanvasWindow class.">CanvasWindowBase</a> ( parent, name, fl ), <a name="l00075"></a>00075 #else <a name="l00076"></a>00076 <a class="code" href="classhippodraw_1_1CanvasWindow.html" title="A concrete window class that contains the canvas and responds to menu item and tool...">CanvasWindow</a>::<a class="code" href="classhippodraw_1_1CanvasWindow.html" title="A concrete window class that contains the canvas and responds to menu item and tool...">CanvasWindow</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qwidget.html">QWidget</a> * parent ) <a name="l00077"></a>00077 : <a class="code" href="classCanvasWindowBase.html" title="The base class for the CanvasWindow class.">CanvasWindowBase</a> ( parent ), <a name="l00078"></a>00078 #endif <a name="l00079"></a>00079 m_file_dialog ( 0 ), <a name="l00080"></a>00080 m_prefix ( <span class="stringliteral">"HippoDraw - Canvas "</span> ), <a name="l00081"></a>00081 m_filename ( <span class="stringliteral">"UNTITLED"</span> ), <a name="l00082"></a>00082 m_changed (<span class="stringliteral">" - Not Saved "</span> ), <a name="l00083"></a>00083 m_hasChanged ( false ), <a name="l00084"></a>00084 m_inhibit_close ( false ), <a name="l00085"></a>00085 m_allow_close ( false ), <a name="l00086"></a>00086 m_filenameExists ( false ) <a name="l00087"></a>00087 { <a name="l00088"></a>00088 <a name="l00089"></a>00089 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00090"></a>00090 <span class="preprocessor"></span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvas.html">QCanvas</a> * canvas = <span class="keyword">new</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvas.html">QCanvas</a> (); <a name="l00091"></a>00091 <span class="preprocessor">#else</span> <a name="l00092"></a>00092 <span class="preprocessor"></span> Q3Canvas * canvas = <span class="keyword">new</span> Q3Canvas (); <a name="l00093"></a>00093 <span class="preprocessor">#endif</span> <a name="l00094"></a>00094 <span class="preprocessor"></span> <a name="l00095"></a>00095 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a760bb1af5579dee755788006e13333c0" title="The controller object capable of serializing the canvas contents as XML and serializing...">m_xml_controller</a> = <a class="code" href="classhippodraw_1_1QtXMLController.html#a05ff87abb61f8c8cce20116d6a9bc5df" title="Returns the pointer to the singleton instance.">QtXMLController::instance</a> (); <a name="l00096"></a>00096 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1CanvasView.html" title="This class implements additional FigureEditor functionality particular to QtView...">CanvasView</a> ( canvas, <span class="keyword">this</span> ); <a name="l00097"></a>00097 <a name="l00098"></a>00098 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmainwindow.html#setCentralWidget">setCentralWidget</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> ); <a name="l00099"></a>00099 <a name="l00100"></a>00100 resize ( sizeHint () ) ; <a name="l00101"></a>00101 <a name="l00102"></a>00102 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">setCaption</a> (); <a name="l00103"></a>00103 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1QtFileDialog.html" title="A class to handle various file types.">QtFileDialog</a> (); <a name="l00104"></a>00104 <a name="l00105"></a>00105 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> initFitterSettings ( <a class="code" href="classCanvasWindowBase.html#ae80b7433fb9608900ceeb85bea5693b9">m_set_fitter</a> ); <span class="comment">// adds the actions.</span> <a name="l00106"></a>00106 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> initRecentFiles ( <a class="code" href="classCanvasWindowBase.html#a78c5a3015db0e584064b73e8cb29de50">m_recent_files</a> ); <span class="comment">// add the actions.</span> <a name="l00107"></a>00107 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> initDockWindows ( <span class="keyword">this</span> ); <span class="comment">// set the dock windows.</span> <a name="l00108"></a>00108 <a name="l00109"></a>00109 <a name="l00110"></a>00110 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">#else</span> <a name="l00112"></a>00112 <span class="preprocessor"></span> <span class="comment">// fix bug in uic3, it didn't add these menu items.</span> <a name="l00113"></a>00113 QMenu * fitter_menu = <a class="code" href="classCanvasWindowBase.html#af0e7305834ef6008f9f7297f1ea67fab">PopupMenu</a> -> addMenu ( <span class="stringliteral">"Fitter"</span> ); <a name="l00114"></a>00114 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlist.html">QList < QAction * ></a> actions = <a class="code" href="classCanvasWindowBase.html#ae80b7433fb9608900ceeb85bea5693b9">m_set_fitter</a> -> actions (); <a name="l00115"></a>00115 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlist.html">QList < QAction * >::iterator</a> first = actions.begin(); <a name="l00116"></a>00116 <span class="keywordflow">while</span> ( first != actions.end() ) { <a name="l00117"></a>00117 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html">QAction</a> * action = *first++; <a name="l00118"></a>00118 fitter_menu -> addAction ( action ); <a name="l00119"></a>00119 } <a name="l00120"></a>00120 <span class="preprocessor">#endif</span> <a name="l00121"></a>00121 <span class="preprocessor"></span> <a name="l00122"></a>00122 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00123"></a>00123 controller-><a class="code" href="classhippodraw_1_1WindowController.html#ac3b10550aadda3b0bbe746fb593c68cf" title="Registers the new CanvasWindow and finishes its initialization.">newWindow</a> ( <span class="keyword">this</span> ); <a name="l00124"></a>00124 } <a name="l00125"></a>00125 <a name="l00126"></a>00126 <a name="l00129"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a6ed26fb7eb1bfad25f728a03970b3a56">00129</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad2b3a4554c9bd6ed889489421ffe5977" title="constructor.">CanvasWindow::CanvasWindow</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html" title="A concrete window class that contains the canvas and responds to menu item and tool...">CanvasWindow</a> & ) <a name="l00130"></a>00130 : <a class="code" href="classCanvasWindowBase.html" title="The base class for the CanvasWindow class.">CanvasWindowBase</a> ( ) <span class="comment">// to keep a waring away</span> <a name="l00131"></a>00131 { <a name="l00132"></a>00132 assert ( <span class="keyword">false</span> ); <a name="l00133"></a>00133 } <a name="l00134"></a>00134 <a name="l00135"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1b92760b444079dfe3222b11956d1ab">00135</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1b92760b444079dfe3222b11956d1ab">CanvasWindow::~CanvasWindow</a>() <a name="l00136"></a>00136 { <a name="l00137"></a>00137 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00138"></a>00138 <span class="preprocessor"></span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvas.html">QCanvas</a> * canvas = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasview.html#canvas">canvas</a>(); <a name="l00139"></a>00139 <span class="preprocessor">#else</span> <a name="l00140"></a>00140 <span class="preprocessor"></span> Q3Canvas * canvas = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasview.html#canvas">canvas</a>(); <a name="l00141"></a>00141 <span class="preprocessor">#endif</span> <a name="l00142"></a>00142 <span class="preprocessor"></span> <a name="l00143"></a>00143 <span class="keyword">delete</span> canvas; <a name="l00144"></a>00144 } <a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="keywordtype">void</span> <a name="l00147"></a>00147 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a72300b94eb5cdeb58d0091ef6733e975" title="Resets the font size to be no larger than 10.">CanvasWindow::</a> <a name="l00148"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a72300b94eb5cdeb58d0091ef6733e975">00148</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a72300b94eb5cdeb58d0091ef6733e975" title="Resets the font size to be no larger than 10.">resetFontSize</a> () <a name="l00149"></a>00149 { <a name="l00150"></a>00150 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfont.html">QFont</a> font = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qapplication.html#font">QApplication::font</a> (); <a name="l00151"></a>00151 <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a137f48a49d12a7dae8ba7c86db2a0c01">size</a> = font.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfont.html#pointSize">pointSize</a> (); <a name="l00152"></a>00152 <span class="keywordflow">if</span> ( size > 10 ) { <a name="l00153"></a>00153 font.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfont.html#setPointSize">setPointSize</a> ( 10 ); <a name="l00154"></a>00154 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qapplication.html#setFont">QApplication::setFont</a> ( font, <span class="keyword">true</span> ); <a name="l00155"></a>00155 } <a name="l00156"></a>00156 } <a name="l00157"></a>00157 <a name="l00158"></a>00158 <span class="keywordtype">void</span> <a name="l00159"></a>00159 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1c31050f5264cf0ce4a76f2e7ac2f94" title="Responds to QCustomEvents.">CanvasWindow::</a> <a name="l00160"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1c31050f5264cf0ce4a76f2e7ac2f94">00160</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1c31050f5264cf0ce4a76f2e7ac2f94" title="Responds to QCustomEvents.">customEvent</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcustomevent.html">QCustomEvent</a> * event ) <a name="l00161"></a>00161 { <a name="l00162"></a>00162 <a class="code" href="classhippodraw_1_1SaveAsImageEvent.html" title="A derived class of QCustomEvent to handle saving a PlotterBase object as image file...">SaveAsImageEvent</a> * image_event <a name="l00163"></a>00163 = dynamic_cast < <a class="code" href="classhippodraw_1_1SaveAsImageEvent.html" title="A derived class of QCustomEvent to handle saving a PlotterBase object as image file...">SaveAsImageEvent</a> * > ( event ); <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="keywordflow">if</span> ( image_event != 0 ) { <a name="l00166"></a>00166 <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter = image_event -> plotter (); <a name="l00167"></a>00167 <span class="keyword">const</span> <span class="keywordtype">string</span> & filename = image_event -> filename (); <a name="l00168"></a>00168 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c9a87b6935486a4bc630b54e31426e6" title="Saves the plotter as image file.">savePlotAsImage</a> ( plotter, filename ); <a name="l00169"></a>00169 <span class="keywordflow">return</span>; <a name="l00170"></a>00170 } <a name="l00171"></a>00171 <a name="l00172"></a>00172 <a class="code" href="classhippodraw_1_1PlotterEvent.html" title="A derived class of QCustomEvent to handle updates from PlotterBase.">PlotterEvent</a> * pe = dynamic_cast < <a class="code" href="classhippodraw_1_1PlotterEvent.html" title="A derived class of QCustomEvent to handle updates from PlotterBase.">PlotterEvent</a> * > ( event ); <a name="l00173"></a>00173 <span class="keywordflow">if</span> ( pe != 0 ) { <a name="l00174"></a>00174 <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter = pe -> plotter (); <a name="l00175"></a>00175 <span class="keywordflow">if</span> ( plotter == 0 ) { <a name="l00176"></a>00176 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5709b5e85a645f261c83696681346f95" title="Sets the changed flag.">setChanged</a> ( <span class="keyword">true</span> ); <a name="l00177"></a>00177 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">setCaption</a> (); <a name="l00178"></a>00178 } <a name="l00179"></a>00179 <span class="keywordflow">else</span> { <a name="l00180"></a>00180 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1b11968e6201c459776c3fb5e024297" title="Adds a new plot to the canvas and selects it.">addDisplay</a> ( plotter ); <a name="l00181"></a>00181 } <a name="l00182"></a>00182 } <a name="l00183"></a>00183 <a name="l00184"></a>00184 <a class="code" href="classhippodraw_1_1PlotTableEvent.html" title="A derived class of QCustomEvent PlotTable events.">PlotTableEvent</a> * ptevent = dynamic_cast < <a class="code" href="classhippodraw_1_1PlotTableEvent.html" title="A derived class of QCustomEvent PlotTable events.">PlotTableEvent</a> * > ( event ); <a name="l00185"></a>00185 <span class="keywordflow">if</span> ( ptevent != 0 ) { <a name="l00186"></a>00186 <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a> = ptevent -> <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a>(); <a name="l00187"></a>00187 <a name="l00188"></a>00188 <span class="keywordflow">if</span> ( type == <a class="code" href="classhippodraw_1_1PlotTableEvent.html#a1d1cfd8ffb84e947f82999c682b666a7aad81934e8f3b9399beea932f0b0e57d8">PlotTableEvent::Copy</a> ) { <a name="l00189"></a>00189 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> addFromPasteboard (); <a name="l00190"></a>00190 <span class="keywordflow">return</span>; <a name="l00191"></a>00191 } <a name="l00192"></a>00192 <a name="l00193"></a>00193 <span class="keywordflow">if</span> ( type == <a class="code" href="classhippodraw_1_1PlotTableEvent.html#a1d1cfd8ffb84e947f82999c682b666a7ab0d2fc8a61cc30fce240ad6df88447d4">PlotTableEvent::Close</a> ) { <a name="l00194"></a>00194 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5c859b6c290bc4c4fc555b123686fe7e" title="The CanvasView object that is being browsed.">m_browsed_canvas</a> != 0 ) { <a name="l00195"></a>00195 <span class="keyword">delete</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5c859b6c290bc4c4fc555b123686fe7e" title="The CanvasView object that is being browsed.">m_browsed_canvas</a>; <a name="l00196"></a>00196 } <a name="l00197"></a>00197 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> -> setBrowserMode ( <span class="keyword">false</span> ); <a name="l00198"></a>00198 <span class="keywordflow">return</span>; <a name="l00199"></a>00199 } <a name="l00200"></a>00200 } <a name="l00201"></a>00201 } <a name="l00202"></a>00202 <a name="l00203"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a2d164635411bb3a1a6af09fb53b5aa41">00203</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2d164635411bb3a1a6af09fb53b5aa41" title="Informs the application object if this window has become the active one.">CanvasWindow::windowActivationChange</a> ( <span class="keywordtype">bool</span> oldActive ) <a name="l00204"></a>00204 { <a name="l00205"></a>00205 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2d164635411bb3a1a6af09fb53b5aa41" title="Informs the application object if this window has become the active one.">QWidget::windowActivationChange</a> ( oldActive ); <a name="l00206"></a>00206 <a name="l00207"></a>00207 <span class="keywordflow">if</span> ( isActiveWindow () == <span class="keyword">true</span> ) { <a name="l00208"></a>00208 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * wc = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00209"></a>00209 <span class="keywordflow">if</span> ( wc -> currentCanvas ( ) != <span class="keyword">this</span> ) { <a name="l00210"></a>00210 wc -> setCurrentCanvas ( <span class="keyword">this</span> ); <a name="l00211"></a>00211 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a> (); <a name="l00212"></a>00212 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00213"></a>00213 } <a name="l00214"></a>00214 } <a name="l00215"></a>00215 } <a name="l00216"></a>00216 <a name="l00217"></a>00217 <span class="keywordtype">void</span> <a name="l00218"></a>00218 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a59b003a493c59e4ef9332b2bb46d7dd4" title="Sets the window to allowed to be closed by user without prompting.">CanvasWindow::</a> <a name="l00219"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a59b003a493c59e4ef9332b2bb46d7dd4">00219</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a59b003a493c59e4ef9332b2bb46d7dd4" title="Sets the window to allowed to be closed by user without prompting.">setAllowClose</a> ( <span class="keywordtype">bool</span> yes ) <a name="l00220"></a>00220 { <a name="l00221"></a>00221 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac9ca595086b37fa32c98a9fe464032cf" title="A flag set to true to allow the window to close without prompting the user.">m_allow_close</a> = yes; <a name="l00222"></a>00222 } <a name="l00223"></a>00223 <a name="l00227"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a988ab27c7f44f16c32fee2e089725263">00227</a> <span class="keywordtype">bool</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a988ab27c7f44f16c32fee2e089725263" title="If document has changed and not saved, opens a dialog box for user to choose to save...">CanvasWindow::allowClose</a> ( ) <a name="l00228"></a>00228 { <a name="l00229"></a>00229 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac9ca595086b37fa32c98a9fe464032cf" title="A flag set to true to allow the window to close without prompting the user.">m_allow_close</a> || <a name="l00230"></a>00230 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a27067b0a0ede892c817d459d0630ed63" title="The current changed status.">m_hasChanged</a> == <span class="keyword">false</span> ) <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00231"></a>00231 <a name="l00232"></a>00232 <span class="keywordtype">bool</span> _allowClose = <span class="keyword">true</span>; <a name="l00233"></a>00233 <span class="keyword">const</span> <span class="keywordtype">string</span> & app_name = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> applicationName (); <a name="l00234"></a>00234 <a name="l00235"></a>00235 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message ( <span class="stringliteral">"The document,\n"</span> ); <a name="l00236"></a>00236 message += <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a>.c_str(); <a name="l00237"></a>00237 message += <span class="stringliteral">"\ncontains unsaved changes.\n\n"</span> <a name="l00238"></a>00238 <span class="stringliteral">"Do you want to save the document before closing it?"</span>; <a name="l00239"></a>00239 <a name="l00240"></a>00240 <span class="keywordtype">int</span> retval <a name="l00241"></a>00241 = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#information">QMessageBox::information</a> ( <span class="keyword">this</span>, <a name="l00242"></a>00242 app_name.c_str(), <a name="l00243"></a>00243 message, <a name="l00244"></a>00244 <span class="stringliteral">"&Save"</span>, <span class="stringliteral">"&Discard"</span>, <span class="stringliteral">"Cancel"</span>); <a name="l00245"></a>00245 <a name="l00246"></a>00246 <span class="keywordflow">switch</span> (retval) <a name="l00247"></a>00247 { <a name="l00248"></a>00248 <span class="keywordflow">case</span> 0: <span class="comment">// save</span> <a name="l00249"></a>00249 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a4fe143fdf8fc530110f11226baa31b33" title="Saves the document.">fileSave</a> (); <a name="l00250"></a>00250 _allowClose = <span class="keyword">true</span>; <a name="l00251"></a>00251 <span class="keywordflow">break</span>; <a name="l00252"></a>00252 <a name="l00253"></a>00253 <span class="keywordflow">case</span> 1: <a name="l00254"></a>00254 _allowClose = <span class="keyword">true</span>; <a name="l00255"></a>00255 <span class="keywordflow">break</span>; <a name="l00256"></a>00256 <a name="l00257"></a>00257 <span class="keywordflow">case</span> 2: <a name="l00258"></a>00258 _allowClose = <span class="keyword">false</span>; <a name="l00259"></a>00259 <span class="keywordflow">break</span>; <a name="l00260"></a>00260 <a name="l00261"></a>00261 <span class="keywordflow">default</span>: <a name="l00262"></a>00262 _allowClose = <span class="keyword">false</span>; <a name="l00263"></a>00263 <span class="keywordflow">break</span>; <a name="l00264"></a>00264 } <a name="l00265"></a>00265 <a name="l00266"></a>00266 <span class="keywordflow">return</span> _allowClose; <a name="l00267"></a>00267 } <a name="l00268"></a>00268 <a name="l00269"></a>00269 <span class="keywordtype">bool</span> <a name="l00270"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ab8746848efdc9d217736e99ce5ea7f2d">00270</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ab8746848efdc9d217736e99ce5ea7f2d" title="Closes the window.">CanvasWindow::closeNoPrompt</a> ( ) <a name="l00271"></a>00271 { <a name="l00272"></a>00272 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac9ca595086b37fa32c98a9fe464032cf" title="A flag set to true to allow the window to close without prompting the user.">m_allow_close</a> = <span class="keyword">true</span>; <a name="l00273"></a>00273 <a name="l00274"></a>00274 <span class="keywordflow">return</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qwidget.html#close">QWidget::close</a> ( <span class="keyword">true</span> ); <a name="l00275"></a>00275 } <a name="l00276"></a>00276 <a name="l00277"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aa5274b1d2675c2d6e4883b8b77747e42">00277</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa5274b1d2675c2d6e4883b8b77747e42" title="Informs the application object that is window is about to close.">CanvasWindow::closeEvent</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcloseevent.html">QCloseEvent</a> * e ) <a name="l00278"></a>00278 { <a name="l00279"></a>00279 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac9ca595086b37fa32c98a9fe464032cf" title="A flag set to true to allow the window to close without prompting the user.">m_allow_close</a> ) { <a name="l00280"></a>00280 e -> accept (); <a name="l00281"></a>00281 <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a>() -> aboutToClose ( <span class="keyword">this</span> ); <a name="l00282"></a>00282 <span class="keywordflow">return</span>; <a name="l00283"></a>00283 } <a name="l00284"></a>00284 <a name="l00285"></a>00285 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a988ab27c7f44f16c32fee2e089725263" title="If document has changed and not saved, opens a dialog box for user to choose to save...">allowClose</a> () == <span class="keyword">false</span> ) { <a name="l00286"></a>00286 e-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcloseevent.html#ignore">ignore</a> (); <a name="l00287"></a>00287 <span class="keywordflow">return</span>; <a name="l00288"></a>00288 } <a name="l00289"></a>00289 <a name="l00290"></a>00290 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a33cb9fd1879b21bc5fb187f92a287bee" title="A flag set to true if the CanvasWindow should not accept a close event.">m_inhibit_close</a> == <span class="keyword">true</span> ) { <a name="l00291"></a>00291 <span class="keyword">const</span> <span class="keywordtype">string</span> & app_name = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> applicationName (); <a name="l00292"></a>00292 <a name="l00293"></a>00293 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message ( <span class="stringliteral">"Closing the only document window will also\n"</span> <a name="l00294"></a>00294 <span class="stringliteral">"terminate the application.\n\n"</span> <a name="l00295"></a>00295 <span class="stringliteral">"Do you want to quit?"</span> ); <a name="l00296"></a>00296 <span class="keywordtype">int</span> retval = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#information">QMessageBox::information</a> ( <span class="keyword">this</span>, <a name="l00297"></a>00297 app_name.c_str(), <a name="l00298"></a>00298 message, <a name="l00299"></a>00299 QMessageBox::Yes, <a name="l00300"></a>00300 QMessageBox::No | <a name="l00301"></a>00301 QMessageBox::Default | <a name="l00302"></a>00302 QMessageBox::Escape, <a name="l00303"></a>00303 Qt::NoButton ); <a name="l00304"></a>00304 <a name="l00305"></a>00305 <span class="keywordflow">switch</span> (retval) <a name="l00306"></a>00306 { <a name="l00307"></a>00307 <span class="keywordflow">case</span> QMessageBox::Yes: <span class="comment">// save</span> <a name="l00308"></a>00308 <span class="keywordflow">break</span>; <a name="l00309"></a>00309 <a name="l00310"></a>00310 <span class="keywordflow">case</span> QMessageBox::No: <a name="l00311"></a>00311 e-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcloseevent.html#ignore">ignore</a>(); <a name="l00312"></a>00312 <span class="keywordflow">return</span>; <a name="l00313"></a>00313 <span class="keywordflow">break</span>; <a name="l00314"></a>00314 <a name="l00315"></a>00315 <span class="keywordflow">default</span>: <a name="l00316"></a>00316 e-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcloseevent.html#ignore">ignore</a>(); <a name="l00317"></a>00317 <span class="keywordflow">return</span>; <a name="l00318"></a>00318 <span class="keywordflow">break</span>; <a name="l00319"></a>00319 } <a name="l00320"></a>00320 } <a name="l00321"></a>00321 <a name="l00322"></a>00322 e-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcloseevent.html#accept">accept</a> (); <a name="l00323"></a>00323 <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a>() -> aboutToClose ( <span class="keyword">this</span> ); <a name="l00324"></a>00324 } <a name="l00325"></a>00325 <a name="l00326"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#abd965db0922191382371ce646635ec2d">00326</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#abd965db0922191382371ce646635ec2d" title="Informs the application object that the window has been hidden.">CanvasWindow::hideEvent</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qhideevent.html">QHideEvent</a> * ) <a name="l00327"></a>00327 { <a name="l00328"></a>00328 <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> () -> hasBeenHidden (); <a name="l00329"></a>00329 } <a name="l00330"></a>00330 <a name="l00331"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a70004318ce836a02a17eaa0fb66adc08">00331</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a70004318ce836a02a17eaa0fb66adc08" title="Informs the application object that the window has been shown.">CanvasWindow::showEvent</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qshowevent.html">QShowEvent</a> * ) <a name="l00332"></a>00332 { <a name="l00333"></a>00333 <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> () -> unHide ( <span class="keyword">this</span> ); <a name="l00334"></a>00334 } <a name="l00335"></a>00335 <a name="l00336"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a8cfa9ec11b29c2707ce15caff6592566">00336</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8cfa9ec11b29c2707ce15caff6592566" title="If yes is true, sets a flag so that this object will not accept close events.">CanvasWindow::inhibitClose</a> ( <span class="keywordtype">bool</span> flag ) <a name="l00337"></a>00337 { <a name="l00338"></a>00338 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a33cb9fd1879b21bc5fb187f92a287bee" title="A flag set to true if the CanvasWindow should not accept a close event.">m_inhibit_close</a> = flag; <a name="l00339"></a>00339 } <a name="l00340"></a>00340 <a name="l00341"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a5709b5e85a645f261c83696681346f95">00341</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5709b5e85a645f261c83696681346f95" title="Sets the changed flag.">CanvasWindow::setChanged</a> ( <span class="keywordtype">bool</span> flag ) <a name="l00342"></a>00342 { <a name="l00343"></a>00343 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00344"></a>00344 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a> (); <a name="l00345"></a>00345 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a27067b0a0ede892c817d459d0630ed63" title="The current changed status.">m_hasChanged</a> == flag ) <span class="keywordflow">return</span>; <a name="l00346"></a>00346 <a name="l00347"></a>00347 <span class="keywordflow">if</span> ( flag == <span class="keyword">true</span> ) { <a name="l00348"></a>00348 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3c5bf73c275c140d8facd93d5f8a5cf5" title="The changed status part of the window title.">m_changed</a> = <span class="stringliteral">" not saved"</span>; <a name="l00349"></a>00349 } <a name="l00350"></a>00350 <span class="keywordflow">else</span> { <a name="l00351"></a>00351 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3c5bf73c275c140d8facd93d5f8a5cf5" title="The changed status part of the window title.">m_changed</a> = <span class="stringliteral">" saved"</span>; <a name="l00352"></a>00352 } <a name="l00353"></a>00353 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a27067b0a0ede892c817d459d0630ed63" title="The current changed status.">m_hasChanged</a> = flag; <a name="l00354"></a>00354 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">setCaption</a> (); <a name="l00355"></a>00355 } <a name="l00356"></a>00356 <a name="l00357"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52">00357</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">CanvasWindow::updateActions</a> () <a name="l00358"></a>00358 { <a name="l00359"></a>00359 <a class="code" href="classhippodraw_1_1XmlController.html" title="A base class that is the interface between GUI and the XML serialization and deserialization...">XmlController</a> * controller = <a class="code" href="classhippodraw_1_1QtXMLController.html#a05ff87abb61f8c8cce20116d6a9bc5df" title="Returns the pointer to the singleton instance.">QtXMLController::instance</a> (); <a name="l00360"></a>00360 <span class="keywordtype">bool</span> no = controller -> isPasteboardEmpty (); <a name="l00361"></a>00361 <a class="code" href="classCanvasWindowBase.html#ad20041dbdcf5695e23e46ee2181a919a">m_editPasteAction</a> -> setEnabled ( ! no ); <a name="l00362"></a>00362 <a name="l00363"></a>00363 <span class="keyword">const</span> std::vector < const ViewBase * > & <a class="code" href="classhippodraw_1_1CanvasWindow.html#a80b660656e50e69002a74ab71395fbe3" title="Returns the list of ViewBase objects on the canvas.">views</a> <a name="l00364"></a>00364 = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a0d9525304a1a45e3a6d735c3df09a362" title="Returns temporary list of selected QtView objects on the canvas.">selectedViews</a> (); <a name="l00365"></a>00365 <span class="keywordtype">bool</span> yes = ! views.empty (); <a name="l00366"></a>00366 <a name="l00367"></a>00367 <a class="code" href="classCanvasWindowBase.html#ab88d8c439c34bfd7d3325416359d8c11">m_fileSaveSelected</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( yes ); <a name="l00368"></a>00368 <a class="code" href="classCanvasWindowBase.html#aba1681ae60c06e41df84f4cc38c72a53">m_editCutAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( yes ); <a name="l00369"></a>00369 <a class="code" href="classCanvasWindowBase.html#ad3e5264d63faf132d813829398caf5b9">m_editCopyAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( yes ); <a name="l00370"></a>00370 <a class="code" href="classCanvasWindowBase.html#a9dbefdfa13e9ec658e79d32df1831afd">m_editDeleteAction</a> -> setEnabled ( yes ); <a name="l00371"></a>00371 <a class="code" href="classCanvasWindowBase.html#a6905505c77eda3aad0b8784890fb0ebc">m_editUndoAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( yes ); <a name="l00372"></a>00372 <a class="code" href="classCanvasWindowBase.html#a686112ea09e047c261aec72f817c9536">m_viewLockAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( yes ); <a name="l00373"></a>00373 <a class="code" href="classCanvasWindowBase.html#af90cdbb2619e0d8426345f2e8789b666">m_viewUnlockAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( yes ); <a name="l00374"></a>00374 <a class="code" href="classCanvasWindowBase.html#abda657509be186d890aeb48705b04ec7">m_group</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a>(yes); <a name="l00375"></a>00375 <a name="l00376"></a>00376 <span class="comment">/* Default for ungroup is false. */</span> <a name="l00377"></a>00377 <a class="code" href="classCanvasWindowBase.html#ab7ad38131c0ee9355b826d6d78127891">m_ungroup</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a>(<span class="keyword">false</span>); <a name="l00378"></a>00378 <span class="keywordflow">if</span> ( yes == <span class="keyword">false</span> ) <span class="keywordflow">return</span>; <a name="l00379"></a>00379 <a name="l00380"></a>00380 <span class="comment">/* By default, group is enabled, ungroup is disabled. Disable group if only one view </span> <a name="l00381"></a>00381 <span class="comment"> is selected. Enable group if the only one view is a group view. */</span> <a name="l00382"></a>00382 <span class="keywordflow">if</span> (views.size() == 1) { <a name="l00383"></a>00383 <a class="code" href="classCanvasWindowBase.html#abda657509be186d890aeb48705b04ec7">m_group</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a>(<span class="keyword">false</span>); <a name="l00384"></a>00384 <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1QtGroupView.html" title="The class of derived from GroupViewBase, QtViewImp and QCanvasRectangle for drawing...">QtGroupView</a> * gv = dynamic_cast <<span class="keyword">const</span> <a class="code" href="classhippodraw_1_1QtGroupView.html" title="The class of derived from GroupViewBase, QtViewImp and QCanvasRectangle for drawing...">QtGroupView</a> *> (*views.begin()); <a name="l00385"></a>00385 <span class="keywordflow">if</span> (gv) { <a name="l00386"></a>00386 <a class="code" href="classCanvasWindowBase.html#ab7ad38131c0ee9355b826d6d78127891">m_ungroup</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a>(<span class="keyword">true</span>); <a name="l00387"></a>00387 } <a name="l00388"></a>00388 } <a name="l00389"></a>00389 <a name="l00390"></a>00390 <a name="l00391"></a>00391 <span class="keywordtype">bool</span> one_locked = <span class="keyword">false</span>; <a name="l00392"></a>00392 <span class="keywordtype">bool</span> one_unlocked = <span class="keyword">false</span>; <a name="l00393"></a>00393 std::vector < const ViewBase * >:: const_iterator first = views.begin (); <a name="l00394"></a>00394 <span class="keywordflow">while</span> ( first != views.end () ) { <a name="l00395"></a>00395 <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * view = dynamic_cast < <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * > ( *first++ ); <a name="l00396"></a>00396 <span class="comment">/* Disable group if any of the selected view is a groupview. */</span> <a name="l00397"></a>00397 <span class="keywordflow">if</span> (!view) { <a name="l00398"></a>00398 <a class="code" href="classCanvasWindowBase.html#abda657509be186d890aeb48705b04ec7">m_group</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a>(<span class="keyword">false</span>); <a name="l00399"></a>00399 <span class="keywordflow">return</span>; <a name="l00400"></a>00400 } <a name="l00401"></a>00401 <a name="l00402"></a>00402 <span class="keywordtype">bool</span> locked = view->isActive (); <a name="l00403"></a>00403 one_locked |= locked; <a name="l00404"></a>00404 one_unlocked |= ! locked; <a name="l00405"></a>00405 } <a name="l00406"></a>00406 <a class="code" href="classCanvasWindowBase.html#a686112ea09e047c261aec72f817c9536">m_viewLockAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( one_unlocked ); <a name="l00407"></a>00407 <a class="code" href="classCanvasWindowBase.html#af90cdbb2619e0d8426345f2e8789b666">m_viewUnlockAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#setEnabled">setEnabled</a> ( one_locked ); <a name="l00408"></a>00408 } <a name="l00409"></a>00409 <a name="l00413"></a>00413 <span class="keywordtype">void</span> <a name="l00414"></a>00414 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa5222bc3cc67885db4458cfce2fce8ad" title="Prints the canvas to a Postscript file.">CanvasWindow::</a> <a name="l00415"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aa5222bc3cc67885db4458cfce2fce8ad">00415</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa5222bc3cc67885db4458cfce2fce8ad" title="Prints the canvas to a Postscript file.">filePrint</a>() <a name="l00416"></a>00416 { <a name="l00417"></a>00417 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a388f572c62279f839ee138a9afbdeeb5" title="Prints the canvas.">print</a> (); <a name="l00418"></a>00418 } <a name="l00419"></a>00419 <a name="l00420"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#abbad708c2972e36a2555264f4acf44bb">00420</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#abbad708c2972e36a2555264f4acf44bb">CanvasWindow::editCopy</a> () <a name="l00421"></a>00421 { <a name="l00422"></a>00422 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a5c9a5d88fc004bca9b01f0d058a0f07e" title="Copies selected items to pasteboard.">copySelectedToPasteboard</a> (); <a name="l00423"></a>00423 <a name="l00424"></a>00424 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00425"></a>00425 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l00426"></a>00426 } <a name="l00427"></a>00427 <a name="l00428"></a>00428 <span class="keywordtype">void</span> <a name="l00429"></a>00429 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac64d882a08675511d23f8d85cbb5094f" title="Responds to &quot;Clear&quot; menu item.">CanvasWindow::</a> <a name="l00430"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ac64d882a08675511d23f8d85cbb5094f">00430</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac64d882a08675511d23f8d85cbb5094f" title="Responds to &quot;Clear&quot; menu item.">editClear</a> () <a name="l00431"></a>00431 { <a name="l00432"></a>00432 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message ( <span class="stringliteral">"The clear operation can not be undone.\n\n"</span> ); <a name="l00433"></a>00433 message.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#append">append</a> ( <span class="stringliteral">"Are you sure you want to remove all canvas items?"</span> ); <a name="l00434"></a>00434 <span class="keywordtype">int</span> retval <a name="l00435"></a>00435 = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#warning">QMessageBox::warning</a> ( <span class="keyword">this</span>, <a name="l00436"></a>00436 <span class="stringliteral">"Warning"</span>, <a name="l00437"></a>00437 message, <a name="l00438"></a>00438 QMessageBox::Yes, <a name="l00439"></a>00439 QMessageBox::No ); <a name="l00440"></a>00440 <span class="keywordflow">if</span> ( retval != QMessageBox::Yes ) <span class="keywordflow">return</span>; <a name="l00441"></a>00441 <a name="l00442"></a>00442 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac8bb3912a3ce86b15842e79d0b421204" title="Removes all items from the canvas.">clear</a> (); <a name="l00443"></a>00443 <a name="l00444"></a>00444 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00445"></a>00445 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l00446"></a>00446 } <a name="l00447"></a>00447 <a name="l00448"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad94962044f38c5986bcae2aa25da4388">00448</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad94962044f38c5986bcae2aa25da4388" title="Removes selected items from canvas and add them to the pasteboard.">CanvasWindow::editCut</a> () <a name="l00449"></a>00449 { <a name="l00450"></a>00450 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a4775f8cf1e153dbf2f7d8d4250cd04c2" title="Removes the selected items from canvas and copies them to the pasteboard.">deleteSelected</a> ( <span class="keyword">true</span> ); <span class="comment">// copy to pasteboard and delete</span> <a name="l00451"></a>00451 <a name="l00452"></a>00452 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00453"></a>00453 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l00454"></a>00454 } <a name="l00455"></a>00455 <a name="l00456"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ab2c5259a3cc9163d033b4d312b31e529">00456</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ab2c5259a3cc9163d033b4d312b31e529" title="Removes selected items from canvas without copying them to the pasteboard.">CanvasWindow::editDelete</a> () <a name="l00457"></a>00457 { <a name="l00458"></a>00458 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a4775f8cf1e153dbf2f7d8d4250cd04c2" title="Removes the selected items from canvas and copies them to the pasteboard.">deleteSelected</a> ( <span class="keyword">false</span> ); <span class="comment">// just delete</span> <a name="l00459"></a>00459 <a name="l00460"></a>00460 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00461"></a>00461 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l00462"></a>00462 } <a name="l00463"></a>00463 <a name="l00464"></a>00464 <span class="keywordtype">void</span> <a name="l00465"></a>00465 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3ad623c6ff54470625df16b7e8172b04" title="Re tiles the entire document.">CanvasWindow::</a> <a name="l00466"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a3ad623c6ff54470625df16b7e8172b04">00466</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3ad623c6ff54470625df16b7e8172b04" title="Re tiles the entire document.">editReTile</a> () <a name="l00467"></a>00467 { <a name="l00468"></a>00468 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a873629c2de55e6b2f0a7d4000c10eee1" title="Re-tiles the canvas.">reTile</a> (); <a name="l00469"></a>00469 } <a name="l00470"></a>00470 <a name="l00471"></a>00471 <span class="keywordtype">void</span> <a name="l00472"></a>00472 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a0069c1a0b4883e5f887091584490035b" title="Re tiles only the current page.">CanvasWindow::</a> <a name="l00473"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a0069c1a0b4883e5f887091584490035b">00473</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a0069c1a0b4883e5f887091584490035b" title="Re tiles only the current page.">editReTilePage</a> () <a name="l00474"></a>00474 { <a name="l00475"></a>00475 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#aa59ddbd588794d404365e9da24c133c1" title="Re-tiles the current page.">reTilePage</a> (); <a name="l00476"></a>00476 } <a name="l00477"></a>00477 <a name="l00478"></a>00478 <span class="keywordtype">void</span> <a name="l00479"></a>00479 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a0161ad9d3879436e850b2e9460e83cca" title="Responds to the undo action.">CanvasWindow::</a> <a name="l00480"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a0161ad9d3879436e850b2e9460e83cca">00480</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a0161ad9d3879436e850b2e9460e83cca" title="Responds to the undo action.">editUndo</a> () <a name="l00481"></a>00481 { <a name="l00482"></a>00482 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a9ab4a6353d463efed4c54e163e02de5b" title="Restores the selected views from the selection copy.">restoreFromSelectCopy</a> (); <a name="l00483"></a>00483 <a name="l00484"></a>00484 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a397546715bfc5aedd1d16dd202a19d4c" title="Notifies observers of a change in CanvasView.">notifyObservers</a>(); <a name="l00485"></a>00485 } <a name="l00486"></a>00486 <a name="l00487"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aaac5dd78be25d2a5b93e725bc52529e7">00487</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaac5dd78be25d2a5b93e725bc52529e7">CanvasWindow::editPaste</a> () <a name="l00488"></a>00488 { <a name="l00489"></a>00489 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#ad4e2a4c1573b094399d6b3b0d26ac2b2" title="Copies from the pasteboard.">copyFromPasteboard</a> (); <a name="l00490"></a>00490 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00491"></a>00491 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l00492"></a>00492 } <a name="l00493"></a>00493 <a name="l00494"></a>00494 <span class="keywordtype">void</span> <a name="l00495"></a>00495 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaac324875255d57d1ac66248309af6ac" title="Sets all QCanvasItem objects to selected.">CanvasWindow::</a> <a name="l00496"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aaac324875255d57d1ac66248309af6ac">00496</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaac324875255d57d1ac66248309af6ac" title="Sets all QCanvasItem objects to selected.">editSelectAll</a> () <a name="l00497"></a>00497 { <a name="l00498"></a>00498 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#aa24ac7bcb3bd0764774a88d2492218e2" title="Sets selection flag on all QCanvasItem objects.">setAllSelected</a> ( <span class="keyword">true</span> ); <a name="l00499"></a>00499 <a name="l00500"></a>00500 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00501"></a>00501 controller -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l00502"></a>00502 } <a name="l00503"></a>00503 <a name="l00504"></a>00504 <span class="keywordtype">void</span> <a name="l00505"></a>00505 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9e68e2c6ddbcb4d5f7bcf37a5175d715" title="Creates a new document CanvasWindow.">CanvasWindow::</a> <a name="l00506"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a9e68e2c6ddbcb4d5f7bcf37a5175d715">00506</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9e68e2c6ddbcb4d5f7bcf37a5175d715" title="Creates a new document CanvasWindow.">fileNew</a> () <a name="l00507"></a>00507 { <a name="l00508"></a>00508 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00509"></a>00509 <a name="l00510"></a>00510 <span class="comment">// Will fix the size and position of the new Canvas</span> <a name="l00511"></a>00511 controller-><a class="code" href="classhippodraw_1_1WindowController.html#a4245b54076200ff4045a5e846b063e00" title="Creates the Inspector object and positions it on the desktop.">createInspector</a>(); <a name="l00512"></a>00512 <a name="l00513"></a>00513 <a class="code" href="classhippodraw_1_1CanvasWindow.html" title="A concrete window class that contains the canvas and responds to menu item and tool...">CanvasWindow</a> * window = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad2b3a4554c9bd6ed889489421ffe5977" title="constructor.">CanvasWindow</a> (); <a name="l00514"></a>00514 <span class="comment">//controller->newWindow ( window );</span> <a name="l00515"></a>00515 window-><a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">setCaption</a> (); <a name="l00516"></a>00516 window->show (); <a name="l00517"></a>00517 } <a name="l00518"></a>00518 <a name="l00519"></a>00519 <span class="keywordtype">void</span> <a name="l00520"></a>00520 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a4af337ca861560c5fed27dcb6077f1f4" title="Browse a document file, without opening a window for it.">CanvasWindow::</a> <a name="l00521"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a4af337ca861560c5fed27dcb6077f1f4">00521</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a4af337ca861560c5fed27dcb6077f1f4" title="Browse a document file, without opening a window for it.">fileBrowse</a> () <a name="l00522"></a>00522 { <a name="l00523"></a>00523 <span class="keyword">const</span> <span class="keywordtype">string</span> & filter = <a class="code" href="classhippodraw_1_1QtFileDialog.html#a8c8c4bb320512d57f01e6f48f5b89423" title="Creates the open file filter.">QtFileDialog::createBrowseFilter</a> (); <a name="l00524"></a>00524 <a name="l00525"></a>00525 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> filename <a name="l00526"></a>00526 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00527"></a>00527 <span class="preprocessor"></span> = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileName">QFileDialog::getOpenFileName</a> ( QString::null, <span class="comment">// starting dir</span> <a name="l00528"></a>00528 #<span class="keywordflow">else</span> <a name="l00529"></a>00529 = Q3FileDialog::getOpenFileName ( QString::null, <span class="comment">// starting dir</span> <a name="l00530"></a>00530 #endif <a name="l00531"></a>00531 filter.c_str(), <a name="l00532"></a>00532 <span class="keyword">this</span>, <a name="l00533"></a>00533 <span class="stringliteral">"Browse"</span>, <span class="comment">// name</span> <a name="l00534"></a>00534 <span class="stringliteral">"Choose document file to browse"</span> ); <span class="comment">// caption</span> <a name="l00535"></a>00535 <span class="keywordflow">if</span> ( filename != QString::null ) { <a name="l00536"></a>00536 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> s = filename.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#stripWhiteSpace">stripWhiteSpace</a> (); <a name="l00537"></a>00537 <span class="keyword">const</span> <span class="keywordtype">string</span> fn = s.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#latin1">latin1</a>(); <a name="l00538"></a>00538 <a name="l00539"></a>00539 string::size_type pos = fn.find_last_of ( <span class="charliteral">'.'</span> ); <a name="l00540"></a>00540 <span class="keyword">const</span> <span class="keywordtype">string</span> suffix = fn.substr ( pos ); <a name="l00541"></a>00541 <a name="l00542"></a>00542 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a759e51a8e06c1f0133544f2a04907a23" title="Returns true if suffix is one corresponding to document file.">QtFileDialog::isDocSuffix</a> ( suffix ) ) { <a name="l00543"></a>00543 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00544"></a>00544 <span class="preprocessor"></span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvas.html">QCanvas</a> * canvas = <span class="keyword">new</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvas.html">QCanvas</a> (); <a name="l00545"></a>00545 <span class="preprocessor">#else</span> <a name="l00546"></a>00546 <span class="preprocessor"></span> Q3Canvas * canvas = <span class="keyword">new</span> Q3Canvas (); <a name="l00547"></a>00547 <span class="preprocessor">#endif</span> <a name="l00548"></a>00548 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1CanvasView.html" title="This class implements additional FigureEditor functionality particular to QtView...">CanvasView</a> * <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5c859b6c290bc4c4fc555b123686fe7e" title="The CanvasView object that is being browsed.">m_browsed_canvas</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1CanvasView.html" title="This class implements additional FigureEditor functionality particular to QtView...">CanvasView</a> ( canvas, <span class="keyword">this</span> ); <a name="l00549"></a>00549 m_browsed_canvas -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2f528bf73c72e1abaeefa236cba448f7" title="Initializes this object from contents of file.">initFromFile</a> ( fn ); <a name="l00550"></a>00550 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> == 0 ) { <a name="l00551"></a>00551 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1PlotTable.html" title="A derived class of PlotTableBase class which is generated by the Qt designer.">PlotTable</a> (); <a name="l00552"></a>00552 } <a name="l00553"></a>00553 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> -> setBrowserMode ( <span class="keyword">true</span>, <span class="keyword">this</span> ); <a name="l00554"></a>00554 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> -> setCanvas ( m_browsed_canvas ); <a name="l00555"></a>00555 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> -> show (); <a name="l00556"></a>00556 } <a name="l00557"></a>00557 } <a name="l00558"></a>00558 } <a name="l00559"></a>00559 <a name="l00560"></a>00560 <span class="keywordtype">void</span> <a name="l00561"></a>00561 <a class="code" href="classhippodraw_1_1CanvasWindow.html#af05f83a4ff53e8104b4b5c4e4e242725" title="Opens an existing file.">CanvasWindow::</a> <a name="l00562"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#af05f83a4ff53e8104b4b5c4e4e242725">00562</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#af05f83a4ff53e8104b4b5c4e4e242725" title="Opens an existing file.">fileOpen</a> () <a name="l00563"></a>00563 { <a name="l00564"></a>00564 <span class="keyword">const</span> <span class="keywordtype">string</span> & filter = <a class="code" href="classhippodraw_1_1QtFileDialog.html#add59d3b2816afeec75a340d7d776e902" title="Creates the open file filter.">QtFileDialog::createOpenFilter</a> (); <a name="l00565"></a>00565 <a name="l00566"></a>00566 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> filename <a name="l00567"></a>00567 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00568"></a>00568 <span class="preprocessor"></span> = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileName">QFileDialog::getOpenFileName</a> ( QString::null, <span class="comment">// starting dir</span> <a name="l00569"></a>00569 #<span class="keywordflow">else</span> <a name="l00570"></a>00570 = Q3FileDialog::getOpenFileName ( QString::null, <span class="comment">// starting dir</span> <a name="l00571"></a>00571 #endif <a name="l00572"></a>00572 filter.c_str(), <a name="l00573"></a>00573 <span class="keyword">this</span>, <a name="l00574"></a>00574 <span class="stringliteral">"Open"</span>, <span class="comment">// name</span> <a name="l00575"></a>00575 <span class="stringliteral">"Choose file to open"</span> ); <span class="comment">// caption</span> <a name="l00576"></a>00576 <span class="keywordflow">if</span> ( filename != QString::null ) { <a name="l00577"></a>00577 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> s = filename.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#stripWhiteSpace">stripWhiteSpace</a> (); <a name="l00578"></a>00578 <span class="keyword">const</span> <span class="keywordtype">string</span> fn = s.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#latin1">latin1</a>(); <a name="l00579"></a>00579 <a name="l00580"></a>00580 <span class="keywordtype">string</span> suffix; <a name="l00581"></a>00581 string::size_type pos = fn.find_last_of ( <span class="charliteral">'.'</span> ); <a name="l00582"></a>00582 <span class="keywordflow">if</span> ( pos != string::npos ) { <a name="l00583"></a>00583 suffix = fn.substr ( pos ); <a name="l00584"></a>00584 } <a name="l00585"></a>00585 <a name="l00586"></a>00586 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a759e51a8e06c1f0133544f2a04907a23" title="Returns true if suffix is one corresponding to document file.">QtFileDialog::isDocSuffix</a> ( suffix ) ) { <a name="l00587"></a>00587 <a name="l00588"></a>00588 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l00589"></a>00589 <a name="l00590"></a>00590 <span class="comment">// Will fix the size and position of the new Canvas.</span> <a name="l00591"></a>00591 controller-><a class="code" href="classhippodraw_1_1WindowController.html#a4245b54076200ff4045a5e846b063e00" title="Creates the Inspector object and positions it on the desktop.">createInspector</a>(); <a name="l00592"></a>00592 <a name="l00593"></a>00593 <a class="code" href="classhippodraw_1_1CanvasWindow.html" title="A concrete window class that contains the canvas and responds to menu item and tool...">CanvasWindow</a> * window = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad2b3a4554c9bd6ed889489421ffe5977" title="constructor.">CanvasWindow</a> (); <a name="l00594"></a>00594 <span class="keywordflow">try</span> { <a name="l00595"></a>00595 window -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2f528bf73c72e1abaeefa236cba448f7" title="Initializes this object from contents of file.">initFromFile</a> ( fn ); <a name="l00596"></a>00596 } <a name="l00597"></a>00597 <span class="keywordflow">catch</span> ( exception & e ) { <a name="l00598"></a>00598 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message (<span class="stringliteral">"Attempt to read file\n"</span> ); <a name="l00599"></a>00599 message +=<span class="stringliteral">"`"</span>; <a name="l00600"></a>00600 message += filename; <a name="l00601"></a>00601 message += <span class="stringliteral">"' led to error:\n"</span>; <a name="l00602"></a>00602 message += e.what(); <a name="l00603"></a>00603 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#critical">QMessageBox::critical</a> ( <span class="keyword">this</span>, <span class="comment">// parent</span> <a name="l00604"></a>00604 <span class="stringliteral">"File error"</span>, <a name="l00605"></a>00605 message, <a name="l00606"></a>00606 QMessageBox::Ok, <a name="l00607"></a>00607 0 ); <a name="l00608"></a>00608 window -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5709b5e85a645f261c83696681346f95" title="Sets the changed flag.">setChanged</a> ( <span class="keyword">false</span> ); <a name="l00609"></a>00609 window -> close (); <a name="l00610"></a>00610 } <a name="l00611"></a>00611 <span class="keywordflow">return</span>; <a name="l00612"></a>00612 } <a name="l00613"></a>00613 <a name="l00614"></a>00614 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#aceaf259a4bc29c155c1d18bbaf3120b3" title="Returns true if suffix is one corresponding to text NTuple file.">QtFileDialog::isTextSuffix</a> ( suffix ) ) { <a name="l00615"></a>00615 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> openTextTuple ( fn ); <a name="l00616"></a>00616 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00617"></a>00617 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> addRecentFile (s, <a class="code" href="classCanvasWindowBase.html#a78c5a3015db0e584064b73e8cb29de50">m_recent_files</a>); <a name="l00618"></a>00618 <span class="keywordflow">return</span>; <a name="l00619"></a>00619 } <a name="l00620"></a>00620 <span class="preprocessor">#ifdef HAVE_ROOT</span> <a name="l00621"></a>00621 <span class="preprocessor"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a5f07ace06c409b8e470fc17a6c0e02c6" title="Returns true if suffix is one corresponding to ROOT DataSource files.">QtFileDialog::isRootSuffix</a> ( suffix ) ) { <a name="l00622"></a>00622 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> openRootTuple ( fn, <span class="keyword">this</span> ); <a name="l00623"></a>00623 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00624"></a>00624 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> addRecentFile (s, <a class="code" href="classCanvasWindowBase.html#a78c5a3015db0e584064b73e8cb29de50">m_recent_files</a>); <a name="l00625"></a>00625 <span class="keywordflow">return</span>; <a name="l00626"></a>00626 } <a name="l00627"></a>00627 <span class="preprocessor">#endif</span> <a name="l00628"></a>00628 <span class="preprocessor"></span> <a name="l00629"></a>00629 <span class="preprocessor">#ifdef HAVE_CFITSIO</span> <a name="l00630"></a>00630 <span class="preprocessor"></span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a234760bedcb99a3bc6642d193bd8f763" title="Returns true if suffix is one corresponding to FITS DataSource file.">QtFileDialog::isFitsSuffix</a> ( suffix ) ) { <a name="l00631"></a>00631 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> openFitsTuple ( fn, <span class="keyword">this</span> ); <a name="l00632"></a>00632 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00633"></a>00633 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> addRecentFile (s, <a class="code" href="classCanvasWindowBase.html#a78c5a3015db0e584064b73e8cb29de50">m_recent_files</a>); <a name="l00634"></a>00634 <span class="keywordflow">return</span>; <a name="l00635"></a>00635 } <a name="l00636"></a>00636 <span class="keywordflow">else</span> { <a name="l00637"></a>00637 <span class="keywordtype">bool</span> yes = <a class="code" href="classhippodraw_1_1QtFileDialog.html#ad25b2ee08d028ae14aa594b95e072764" title="Returns true if the file filename is a FITS file.">QtFileDialog::isFitsFile</a> ( fn ); <a name="l00638"></a>00638 <span class="keywordflow">if</span> ( yes ) { <a name="l00639"></a>00639 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> openFitsTuple ( fn, <span class="keyword">this</span> ); <a name="l00640"></a>00640 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00641"></a>00641 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> addRecentFile (s, <a class="code" href="classCanvasWindowBase.html#a78c5a3015db0e584064b73e8cb29de50">m_recent_files</a>); <a name="l00642"></a>00642 <span class="keywordflow">return</span>; <a name="l00643"></a>00643 } <a name="l00644"></a>00644 } <a name="l00645"></a>00645 <span class="preprocessor">#endif</span> <a name="l00646"></a>00646 <span class="preprocessor"></span> <span class="comment">// if all else fails, try text file</span> <a name="l00647"></a>00647 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> openTextTuple ( fn ); <a name="l00648"></a>00648 <a name="l00649"></a>00649 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00650"></a>00650 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> addRecentFile ( s, <a class="code" href="classCanvasWindowBase.html#a78c5a3015db0e584064b73e8cb29de50">m_recent_files</a> ); <a name="l00651"></a>00651 } <a name="l00652"></a>00652 } <a name="l00653"></a>00653 <a name="l00657"></a>00657 <span class="keywordtype">void</span> <a name="l00658"></a>00658 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2f528bf73c72e1abaeefa236cba448f7" title="Initializes this object from contents of file.">CanvasWindow::</a> <a name="l00659"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a2f528bf73c72e1abaeefa236cba448f7">00659</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2f528bf73c72e1abaeefa236cba448f7" title="Initializes this object from contents of file.">initFromFile</a> ( <span class="keyword">const</span> std::string & filename ) <a name="l00660"></a>00660 { <a name="l00661"></a>00661 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2f528bf73c72e1abaeefa236cba448f7" title="Initializes this object from contents of file.">initFromFile</a> ( filename ); <a name="l00662"></a>00662 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa989e546fb7b3d232ecb7d326dfc87c" title="Sets the file name component of the window&#39;s title.">setTitleFileName</a> ( filename ); <a name="l00663"></a>00663 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5709b5e85a645f261c83696681346f95" title="Sets the changed flag.">setChanged</a> ( <span class="keyword">false</span> ); <a name="l00664"></a>00664 <a name="l00665"></a>00665 show(); <a name="l00666"></a>00666 } <a name="l00667"></a>00667 <a name="l00668"></a>00668 <span class="keywordtype">void</span> <a name="l00669"></a>00669 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac8bb3912a3ce86b15842e79d0b421204" title="Removes all items from the canvas.">CanvasWindow::</a> <a name="l00670"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ac8bb3912a3ce86b15842e79d0b421204">00670</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ac8bb3912a3ce86b15842e79d0b421204" title="Removes all items from the canvas.">clear</a>() <a name="l00671"></a>00671 { <a name="l00672"></a>00672 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#ac8bb3912a3ce86b15842e79d0b421204" title="Removes all the QCanvasItem objects from the canvas.">clear</a>(); <a name="l00673"></a>00673 } <a name="l00674"></a>00674 <a name="l00675"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aafa66cd3e7e9f8b8302cdfe69a5230f3">00675</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aafa66cd3e7e9f8b8302cdfe69a5230f3" title="Informs the Canvas to re-size as well.">CanvasWindow::resizeEvent</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qresizeevent.html">QResizeEvent</a> * e ) <a name="l00676"></a>00676 { <a name="l00677"></a>00677 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#a187352630b824a4dadd3139b95cf6215" title="Re-sizes the QCanvas in response to parent window receiving QResizeEvent.">resizeEvent</a> ( e ); <a name="l00678"></a>00678 <a name="l00679"></a>00679 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aafa66cd3e7e9f8b8302cdfe69a5230f3" title="Informs the Canvas to re-size as well.">QWidget::resizeEvent</a> ( e ); <a name="l00680"></a>00680 } <a name="l00681"></a>00681 <a name="l00682"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad8db96c609e519e74673c26dd095c10b">00682</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad8db96c609e519e74673c26dd095c10b" title="Adds a page to the canvas.">CanvasWindow::viewAddPage</a>() <a name="l00683"></a>00683 { <a name="l00684"></a>00684 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#a7652bda0debcbe693e345d535efa4616" title="Adds a page to the canvas.">addPage</a> (); <a name="l00685"></a>00685 } <a name="l00686"></a>00686 <a name="l00687"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a6dd05e3fc376db734392859790dc0d08">00687</a> <span class="keywordtype">bool</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6dd05e3fc376db734392859790dc0d08" title="Returns true if all the data sources used by the document have been saved to or read...">CanvasWindow::areDataSourcesSaved</a> () <a name="l00688"></a>00688 { <a name="l00689"></a>00689 <span class="keyword">const</span> vector < const ViewBase * > & <a class="code" href="classhippodraw_1_1CanvasWindow.html#a80b660656e50e69002a74ab71395fbe3" title="Returns the list of ViewBase objects on the canvas.">views</a> = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a1ded918fda8c42bd2a74d847d8052c9c" title="Returns temporary list of all QtView objects on the canvas.">views</a> (); <a name="l00690"></a>00690 <span class="keywordtype">bool</span> yes = <a class="code" href="classhippodraw_1_1CanvasWindow.html#a760bb1af5579dee755788006e13333c0" title="The controller object capable of serializing the canvas contents as XML and serializing...">m_xml_controller</a>-><a class="code" href="classhippodraw_1_1XmlController.html#a6c1763610e1beac3e7d9c293c30ba61f" title="Returns true if all the NTuple objects used by the views have been saved to or read...">areDataSourcesSaved</a> ( views ); <a name="l00691"></a>00691 <a name="l00692"></a>00692 <span class="keywordflow">if</span> ( yes == <span class="keyword">false</span> ) { <a name="l00693"></a>00693 <span class="keyword">const</span> <span class="keywordtype">string</span> & app_name = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> applicationName (); <a name="l00694"></a>00694 <a name="l00695"></a>00695 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> menutext = <a class="code" href="classCanvasWindowBase.html#a7894fe60d69b58b8a624a6b1d842271a">m_exportTextTuple</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#menuText">menuText</a>(); <a name="l00696"></a>00696 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message (<span class="stringliteral">"Document can not be saved.\n\n"</span> <a name="l00697"></a>00697 <span class="stringliteral">"It uses data sources that were neither\n"</span> <a name="l00698"></a>00698 <span class="stringliteral">"read from nor saved to a file.\n\n"</span> <a name="l00699"></a>00699 <span class="stringliteral">"Use File menu: \""</span> ); <a name="l00700"></a>00700 message += menutext; <a name="l00701"></a>00701 message += <span class="stringliteral">"\"\n"</span> <a name="l00702"></a>00702 <span class="stringliteral">"to save the data sources first, or\n"</span> <a name="l00703"></a>00703 <span class="stringliteral">"use the File menu: \""</span>; <a name="l00704"></a>00704 <a name="l00705"></a>00705 menutext = <a class="code" href="classCanvasWindowBase.html#af3e761442e61615073b7fb8f6fa111f7">m_fileSaveAllAction</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html#menuText">menuText</a>(); <a name="l00706"></a>00706 message += menutext; <a name="l00707"></a>00707 message += <span class="stringliteral">"\"."</span>; <a name="l00708"></a>00708 <a name="l00709"></a>00709 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#critical">QMessageBox::critical</a> ( <span class="keyword">this</span>, <span class="comment">// parent</span> <a name="l00710"></a>00710 app_name.c_str(), <span class="comment">// caption</span> <a name="l00711"></a>00711 message, <a name="l00712"></a>00712 QMessageBox::Ok, <a name="l00713"></a>00713 Qt::NoButton ); <a name="l00714"></a>00714 } <a name="l00715"></a>00715 <a name="l00716"></a>00716 <span class="keywordflow">return</span> yes; <a name="l00717"></a>00717 } <a name="l00718"></a>00718 <a name="l00719"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a4fe143fdf8fc530110f11226baa31b33">00719</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a4fe143fdf8fc530110f11226baa31b33" title="Saves the document.">CanvasWindow::fileSave</a>() <a name="l00720"></a>00720 { <a name="l00721"></a>00721 <span class="keywordtype">bool</span> yes = <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6dd05e3fc376db734392859790dc0d08" title="Returns true if all the data sources used by the document have been saved to or read...">areDataSourcesSaved</a> (); <a name="l00722"></a>00722 <span class="keywordflow">if</span> ( ! yes ) <span class="keywordflow">return</span>; <a name="l00723"></a>00723 <a name="l00724"></a>00724 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6143aea0c19b2c689ac80d6745635d42" title="True if filename has been assigned, false if not.">m_filenameExists</a> ) <a name="l00725"></a>00725 { <a name="l00726"></a>00726 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a27067b0a0ede892c817d459d0630ed63" title="The current changed status.">m_hasChanged</a> ) <a name="l00727"></a>00727 { <a name="l00728"></a>00728 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message ( <span class="stringliteral">"Document file exists\n\n"</span> ); <a name="l00729"></a>00729 message.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#append">append</a> ( <span class="stringliteral">"Over-write existing file?"</span> ); <a name="l00730"></a>00730 <span class="keywordtype">int</span> retval <a name="l00731"></a>00731 = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#warning">QMessageBox::warning</a> ( <span class="keyword">this</span>, <a name="l00732"></a>00732 <span class="stringliteral">"Warning"</span>, <a name="l00733"></a>00733 message, <a name="l00734"></a>00734 QMessageBox::Yes, <a name="l00735"></a>00735 QMessageBox::No ); <a name="l00736"></a>00736 <span class="keywordflow">if</span> ( retval != QMessageBox::Yes ) <span class="keywordflow">return</span>; <a name="l00737"></a>00737 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b" title="Saves the document to the specified file.">saveAs</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a> ); <a name="l00738"></a>00738 } <a name="l00739"></a>00739 } <a name="l00740"></a>00740 <span class="keywordflow">else</span> <a name="l00741"></a>00741 { <a name="l00742"></a>00742 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a63e11dace32ba4a25b71ab5e54088565" title="Saves the document after display a file dialog to the user.">fileSaveAs</a> (); <a name="l00743"></a>00743 } <a name="l00744"></a>00744 } <a name="l00745"></a>00745 <a name="l00746"></a>00746 std::string <a name="l00747"></a>00747 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ab79b41778672d7def4de9359bffd643e" title="Returns the chosen file name from a save canvas dialog.">CanvasWindow::</a> <a name="l00748"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ab79b41778672d7def4de9359bffd643e">00748</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ab79b41778672d7def4de9359bffd643e" title="Returns the chosen file name from a save canvas dialog.">getSaveDocFilename</a> () <a name="l00749"></a>00749 { <a name="l00750"></a>00750 <span class="keyword">const</span> <span class="keywordtype">string</span> & filter = <a class="code" href="classhippodraw_1_1QtFileDialog.html#a36d737e04a2be6a5f65494a12c2c8adb" title="Creates a filter for saving a document.">QtFileDialog:: createDocumentFilter</a> (); <a name="l00751"></a>00751 <a name="l00752"></a>00752 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> filename; <a name="l00753"></a>00753 <span class="keywordflow">while</span> ( <span class="keyword">true</span> ) { <a name="l00754"></a>00754 filename <a name="l00755"></a>00755 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00756"></a>00756 <span class="preprocessor"></span> = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfiledialog.html#getSaveFileName">QFileDialog::getSaveFileName</a> ( QString::null, <span class="comment">// starting dir</span> <a name="l00757"></a>00757 #<span class="keywordflow">else</span> <a name="l00758"></a>00758 = Q3FileDialog::getSaveFileName ( QString::null, <span class="comment">// starting dir</span> <a name="l00759"></a>00759 #endif <a name="l00760"></a>00760 filter.c_str(), <span class="comment">// filter</span> <a name="l00761"></a>00761 <span class="keyword">this</span>, <span class="comment">// parent</span> <a name="l00762"></a>00762 <span class="stringliteral">"save doc"</span>, <a name="l00763"></a>00763 <span class="stringliteral">"Save canvas to ..."</span> ); <span class="comment">// caption</span> <a name="l00764"></a>00764 <a name="l00765"></a>00765 <span class="keywordflow">if</span> ( filename == QString::null ) <span class="keywordflow">return</span> string(); <a name="l00766"></a>00766 <a name="l00767"></a>00767 <span class="keyword">const</span> <span class="keywordtype">string</span> & suffix = <a class="code" href="classhippodraw_1_1QtFileDialog.html#ac798253375e9e1ef4ef73734dd35c65e" title="Returns the suffix for a document.">QtFileDialog:: getDocSuffix</a> (); <a name="l00768"></a>00768 <span class="keywordflow">if</span> ( filename.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#endsWith">endsWith</a> ( suffix.c_str() ) == <span class="keyword">false</span> ) { <a name="l00769"></a>00769 filename += suffix.c_str(); <a name="l00770"></a>00770 } <a name="l00771"></a>00771 <a name="l00772"></a>00772 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfileinfo.html">QFileInfo</a> info ( filename ); <a name="l00773"></a>00773 filename = info.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfileinfo.html#absFilePath">absFilePath</a>(); <a name="l00774"></a>00774 <a name="l00775"></a>00775 <span class="keywordtype">bool</span> yes = info.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfileinfo.html#exists">exists</a> (); <a name="l00776"></a>00776 <span class="keywordflow">if</span> ( yes == <span class="keyword">false</span> ) <span class="keywordflow">break</span>; <a name="l00777"></a>00777 <a name="l00778"></a>00778 <span class="keywordtype">string</span> message ( <span class="stringliteral">"File exists. \n\n"</span> ); <a name="l00779"></a>00779 message += <span class="stringliteral">"Over write existing file?"</span>; <a name="l00780"></a>00780 <span class="keywordtype">int</span> result = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#warning">QMessageBox::warning</a> ( <span class="keyword">this</span>, <span class="comment">// parent</span> <a name="l00781"></a>00781 <span class="stringliteral">"Warning"</span>, <span class="comment">// caption</span> <a name="l00782"></a>00782 message.c_str (), <span class="comment">//</span> <a name="l00783"></a>00783 QMessageBox::Yes, <a name="l00784"></a>00784 QMessageBox::No ); <a name="l00785"></a>00785 <span class="keywordflow">if</span> ( result == QMessageBox::Yes ) <span class="keywordflow">break</span>; <a name="l00786"></a>00786 } <a name="l00787"></a>00787 <span class="keywordtype">string</span> name = filename.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#latin1">latin1</a>(); <a name="l00788"></a>00788 <a name="l00789"></a>00789 <span class="keywordflow">return</span> name; <a name="l00790"></a>00790 } <a name="l00791"></a>00791 <span class="keywordtype">bool</span> <a name="l00792"></a>00792 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaccd52a00ae24d75bc1851d9139568c9" title="Sets the file name of document.">CanvasWindow::</a> <a name="l00793"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aaccd52a00ae24d75bc1851d9139568c9">00793</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaccd52a00ae24d75bc1851d9139568c9" title="Sets the file name of document.">setFilenameFromDialog</a> () <a name="l00794"></a>00794 { <a name="l00795"></a>00795 <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a> = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ab79b41778672d7def4de9359bffd643e" title="Returns the chosen file name from a save canvas dialog.">getSaveDocFilename</a> (); <a name="l00796"></a>00796 <a name="l00797"></a>00797 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6143aea0c19b2c689ac80d6745635d42" title="True if filename has been assigned, false if not.">m_filenameExists</a> = <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a>.empty () ? <span class="keyword">false</span> : <span class="keyword">true</span>; <a name="l00798"></a>00798 <a name="l00799"></a>00799 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6143aea0c19b2c689ac80d6745635d42" title="True if filename has been assigned, false if not.">m_filenameExists</a>; <a name="l00800"></a>00800 } <a name="l00801"></a>00801 <a name="l00802"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a63e11dace32ba4a25b71ab5e54088565">00802</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a63e11dace32ba4a25b71ab5e54088565" title="Saves the document after display a file dialog to the user.">CanvasWindow::fileSaveAs</a>() <a name="l00803"></a>00803 { <a name="l00804"></a>00804 <span class="keywordtype">bool</span> yes = <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6dd05e3fc376db734392859790dc0d08" title="Returns true if all the data sources used by the document have been saved to or read...">areDataSourcesSaved</a> (); <a name="l00805"></a>00805 <span class="keywordflow">if</span> ( ! yes ) <span class="keywordflow">return</span>; <a name="l00806"></a>00806 <a name="l00807"></a>00807 <span class="keywordtype">bool</span> ok = <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaccd52a00ae24d75bc1851d9139568c9" title="Sets the file name of document.">setFilenameFromDialog</a> (); <a name="l00808"></a>00808 <span class="keywordflow">if</span> ( ! ok ) <span class="keywordflow">return</span>; <a name="l00809"></a>00809 <a name="l00810"></a>00810 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b" title="Saves the document to the specified file.">saveAs</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a> ); <a name="l00811"></a>00811 } <a name="l00812"></a>00812 <a name="l00813"></a>00813 <a name="l00814"></a>00814 <span class="keywordtype">void</span> <a name="l00815"></a>00815 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2712ead0f1c838e629f07b365bef9252" title="Saves the canvas document and any NTuple that were not read from or written to a...">CanvasWindow::</a> <a name="l00816"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a2712ead0f1c838e629f07b365bef9252">00816</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2712ead0f1c838e629f07b365bef9252" title="Saves the canvas document and any NTuple that were not read from or written to a...">fileSaveAll</a>() <a name="l00817"></a>00817 { <a name="l00818"></a>00818 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6143aea0c19b2c689ac80d6745635d42" title="True if filename has been assigned, false if not.">m_filenameExists</a> == <span class="keyword">false</span> ) { <a name="l00819"></a>00819 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a901b7144869b7e55d1d18a7f49b9c975" title="Saves the canvas document and its NTuple.">fileSaveAllAs</a> (); <a name="l00820"></a>00820 <span class="keywordflow">return</span>; <a name="l00821"></a>00821 } <a name="l00822"></a>00822 <a class="code" href="classhippodraw_1_1CanvasWindow.html#abc061ea31d2a189b88ce020c39a20eac" title="Saves the document along with its NTuple objects.">saveAllAs</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a> ); <a name="l00823"></a>00823 } <a name="l00824"></a>00824 <a name="l00825"></a>00825 <span class="keywordtype">void</span> <a name="l00826"></a>00826 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a901b7144869b7e55d1d18a7f49b9c975" title="Saves the canvas document and its NTuple.">CanvasWindow::</a> <a name="l00827"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a901b7144869b7e55d1d18a7f49b9c975">00827</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a901b7144869b7e55d1d18a7f49b9c975" title="Saves the canvas document and its NTuple.">fileSaveAllAs</a>() <a name="l00828"></a>00828 { <a name="l00829"></a>00829 <span class="keywordtype">bool</span> ok = <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaccd52a00ae24d75bc1851d9139568c9" title="Sets the file name of document.">setFilenameFromDialog</a> (); <a name="l00830"></a>00830 <span class="keywordflow">if</span> ( ! ok ) <span class="keywordflow">return</span>; <a name="l00831"></a>00831 <a class="code" href="classhippodraw_1_1CanvasWindow.html#abc061ea31d2a189b88ce020c39a20eac" title="Saves the document along with its NTuple objects.">saveAllAs</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a> ); <a name="l00832"></a>00832 } <a name="l00833"></a>00833 <a name="l00836"></a>00836 <span class="keywordtype">void</span> <a name="l00837"></a>00837 <a class="code" href="classhippodraw_1_1CanvasWindow.html#abc061ea31d2a189b88ce020c39a20eac" title="Saves the document along with its NTuple objects.">CanvasWindow::</a> <a name="l00838"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#abc061ea31d2a189b88ce020c39a20eac">00838</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#abc061ea31d2a189b88ce020c39a20eac" title="Saves the document along with its NTuple objects.">saveAllAs</a> ( <span class="keyword">const</span> std::string & filename ) <a name="l00839"></a>00839 { <a name="l00840"></a>00840 <span class="keyword">const</span> <span class="keywordtype">string</span> & suffix = <a class="code" href="classhippodraw_1_1QtFileDialog.html#ac798253375e9e1ef4ef73734dd35c65e" title="Returns the suffix for a document.">QtFileDialog:: getDocSuffix</a> (); <a name="l00841"></a>00841 string::size_type pos = filename.find ( suffix ); <a name="l00842"></a>00842 <span class="keywordtype">string</span> prefix = filename.substr ( 0, pos ); <a name="l00843"></a>00843 <a class="code" href="classhippodraw_1_1NTupleController.html" title="A singleton class that is the interface between GUI and the NTuple objects.">NTupleController</a> * controller = <a class="code" href="classhippodraw_1_1NTupleController.html#ae02f71abaf1f85101c7044455ca8ac1a" title="Returns the pointer to the singleton instance.">NTupleController::instance</a> (); <a name="l00844"></a>00844 <a name="l00845"></a>00845 <span class="keyword">const</span> <span class="keywordtype">string</span> & data_suffix = <a class="code" href="classhippodraw_1_1QtFileDialog.html#a3361840c45e54073ceba0df219404632" title="Returns the suffix for a text data source files.">QtFileDialog::getTextSuffix</a> (); <a name="l00846"></a>00846 controller -> saveNTuples ( prefix, data_suffix ); <a name="l00847"></a>00847 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b" title="Saves the document to the specified file.">saveAs</a> ( filename ); <a name="l00848"></a>00848 } <a name="l00849"></a>00849 <a name="l00850"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a8fdbc61626b168401b3a0a9938a71ce0">00850</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8fdbc61626b168401b3a0a9938a71ce0" title="Saves the selected ViewBase object as an image file.">CanvasWindow::fileSaveSelectedImages</a> () <a name="l00851"></a>00851 { <a name="l00852"></a>00852 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a5b8671d496bb421324c0561dd38e9801" title="Saves the selected QCanvasItem objects to a image file.">saveSelectedImages</a> (); <a name="l00853"></a>00853 } <a name="l00854"></a>00854 <a name="l00855"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a609998edd275d22ac53d480c566853b6">00855</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8fdbc61626b168401b3a0a9938a71ce0" title="Saves the selected ViewBase object as an image file.">CanvasWindow::fileSaveSelectedImages</a> ( <span class="keyword">const</span> std::string & filename ) <a name="l00856"></a>00856 { <a name="l00857"></a>00857 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a5b8671d496bb421324c0561dd38e9801" title="Saves the selected QCanvasItem objects to a image file.">saveSelectedImages</a>(filename); <a name="l00858"></a>00858 } <a name="l00859"></a>00859 <a name="l00860"></a>00860 <span class="keywordtype">void</span> <a name="l00861"></a>00861 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b" title="Saves the document to the specified file.">CanvasWindow::</a> <a name="l00862"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b">00862</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b" title="Saves the document to the specified file.">saveAs</a> ( <span class="keyword">const</span> std::string & filename ) <a name="l00863"></a>00863 { <a name="l00864"></a>00864 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7fc2b9a05b9b196e40b34b8a7edd905b" title="Saves the document to the specified file.">saveAs</a> ( filename ); <a name="l00865"></a>00865 <a name="l00866"></a>00866 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa989e546fb7b3d232ecb7d326dfc87c" title="Sets the file name component of the window&#39;s title.">setTitleFileName</a> ( filename ); <a name="l00867"></a>00867 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5709b5e85a645f261c83696681346f95" title="Sets the changed flag.">setChanged</a> ( <span class="keyword">false</span> ); <a name="l00868"></a>00868 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">setCaption</a> (); <a name="l00869"></a>00869 } <a name="l00870"></a>00870 <a name="l00871"></a>00871 <a class="code" href="classhippodraw_1_1CanvasView.html" title="This class implements additional FigureEditor functionality particular to QtView...">CanvasView</a> * <a name="l00872"></a>00872 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8cf948ef405131428268aa3efa86e79f" title="Returns the CanvasView object.">CanvasWindow::</a> <a name="l00873"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a8cf948ef405131428268aa3efa86e79f">00873</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8cf948ef405131428268aa3efa86e79f" title="Returns the CanvasView object.">getCanvasView</a> () <a name="l00874"></a>00874 { <a name="l00875"></a>00875 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>; <a name="l00876"></a>00876 } <a name="l00877"></a>00877 <a name="l00878"></a>00878 <span class="keywordtype">void</span> <a name="l00879"></a>00879 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a4df1ae4fc7cb1b5f4c85a2e2c88657ab">CanvasWindow::</a> <a name="l00880"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a4df1ae4fc7cb1b5f4c85a2e2c88657ab">00880</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a4df1ae4fc7cb1b5f4c85a2e2c88657ab">fileExportTextTuple</a> () <a name="l00881"></a>00881 { <a name="l00882"></a>00882 <a name="l00883"></a>00883 <a class="code" href="classhippodraw_1_1Inspector.html" title="A derived class of InspectorBase class which is generated by the Qt designer.">Inspector</a> * inspector = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> getInspector (); <a name="l00884"></a>00884 <span class="keyword">const</span> <span class="keywordtype">string</span> tuple_name = inspector -> getSelectedDataSourceName (); <a name="l00885"></a>00885 <a name="l00886"></a>00886 <span class="keywordtype">string</span> fn = <a class="code" href="classhippodraw_1_1QtFileDialog.html#a378a8303d381b11f573f977c363121a6" title="Returns a filename for exporting a DataSource.">QtFileDialog:: getExportTupleFilename</a> ( <span class="keyword">this</span> ); <a name="l00887"></a>00887 <span class="keywordflow">if</span> (fn.empty()==<span class="keyword">true</span>) <span class="keywordflow">return</span>; <a name="l00888"></a>00888 <a name="l00889"></a>00889 <a name="l00890"></a>00890 string::size_type pos = fn.find_last_of ( <span class="charliteral">'.'</span> ); <a name="l00891"></a>00891 <span class="keyword">const</span> <span class="keywordtype">string</span> suffix = fn.substr ( pos ); <a name="l00892"></a>00892 <a name="l00893"></a>00893 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#aceaf259a4bc29c155c1d18bbaf3120b3" title="Returns true if suffix is one corresponding to text NTuple file.">QtFileDialog:: isTextSuffix</a> ( suffix ) ) { <a name="l00894"></a>00894 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> saveTextTuple ( fn, <span class="keyword">this</span> ); <a name="l00895"></a>00895 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00896"></a>00896 <span class="keywordflow">return</span>; <a name="l00897"></a>00897 } <a name="l00898"></a>00898 <a name="l00899"></a>00899 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a234760bedcb99a3bc6642d193bd8f763" title="Returns true if suffix is one corresponding to FITS DataSource file.">QtFileDialog::isFitsSuffix</a> ( suffix ) || <a name="l00900"></a>00900 <a class="code" href="classhippodraw_1_1QtFileDialog.html#a044d445cb171bac4d9bab24639ba17c9" title="Returns true if the file filename is a compressed FITS file.">QtFileDialog::isZippedFitsSuffix</a> (suffix) ) { <a name="l00901"></a>00901 <span class="preprocessor">#ifdef HAVE_CFITSIO</span> <a name="l00902"></a>00902 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> saveFitsTuple ( fn, <span class="keyword">this</span> ); <a name="l00903"></a>00903 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00904"></a>00904 <span class="preprocessor">#else</span> <a name="l00905"></a>00905 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> showFitsError (); <a name="l00906"></a>00906 <span class="preprocessor">#endif</span> <a name="l00907"></a>00907 <span class="preprocessor"></span> <span class="keywordflow">return</span>; <a name="l00908"></a>00908 } <a name="l00909"></a>00909 <a name="l00910"></a>00910 <span class="keywordflow">else</span> { <a name="l00911"></a>00911 <span class="keywordtype">bool</span> yes = <a class="code" href="classhippodraw_1_1QtFileDialog.html#ad25b2ee08d028ae14aa594b95e072764" title="Returns true if the file filename is a FITS file.">QtFileDialog:: isFitsFile</a> ( fn ); <a name="l00912"></a>00912 <span class="keywordflow">if</span> ( yes ) { <a name="l00913"></a>00913 <span class="preprocessor">#ifdef HAVE_CFITSIO</span> <a name="l00914"></a>00914 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> saveFitsTuple ( fn, <span class="keyword">this</span> ); <a name="l00915"></a>00915 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l00916"></a>00916 <span class="preprocessor">#else</span> <a name="l00917"></a>00917 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> showFitsError (); <a name="l00918"></a>00918 <span class="preprocessor">#endif</span> <a name="l00919"></a>00919 <span class="preprocessor"></span> <span class="keywordflow">return</span>; <a name="l00920"></a>00920 } <a name="l00921"></a>00921 } <a name="l00922"></a>00922 <a name="l00923"></a>00923 <span class="comment">// if all else fails, show error message.</span> <a name="l00924"></a>00924 <a name="l00925"></a>00925 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a>(<span class="stringliteral">"The file type: %1\n"</span>).arg ( suffix.c_str() ); <a name="l00926"></a>00926 message.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#append">append</a>(<span class="stringliteral">"is not supported.\n\n"</span>); <a name="l00927"></a>00927 message.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#append">append</a>(<span class="stringliteral">"Please use Text ntuple (.tnt)\n"</span>); <a name="l00928"></a>00928 message.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#append">append</a>(<span class="stringliteral">"or FITS file (.fits)."</span>); <a name="l00929"></a>00929 <a name="l00930"></a>00930 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#critical">QMessageBox::critical</a> ( <span class="keyword">this</span>, <span class="comment">// parent</span> <a name="l00931"></a>00931 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> (<span class="stringliteral">"Unsupported file type"</span>), <span class="comment">// caption</span> <a name="l00932"></a>00932 message, <a name="l00933"></a>00933 QMessageBox::Ok, <a name="l00934"></a>00934 Qt::NoButton ); <a name="l00935"></a>00935 } <a name="l00936"></a>00936 <a name="l00937"></a>00937 <span class="keywordtype">void</span> <a name="l00938"></a>00938 <a class="code" href="classhippodraw_1_1CanvasWindow.html#af3e60f495b113335e919e9e20948fc9d" title="Create a new NTuple from selected cut and column.">CanvasWindow::</a> <a name="l00939"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#af3e60f495b113335e919e9e20948fc9d">00939</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#af3e60f495b113335e919e9e20948fc9d" title="Create a new NTuple from selected cut and column.">fileCreateNTuple</a> () <a name="l00940"></a>00940 { <a name="l00941"></a>00941 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> createNTuple(); <a name="l00942"></a>00942 } <a name="l00943"></a>00943 <a name="l00944"></a>00944 <span class="keywordtype">void</span> <a name="l00945"></a>00945 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8378ac165178047e362554acf5d2b9bb" title="Responds to the Quit item in the File menu.">CanvasWindow::</a> <a name="l00946"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a8378ac165178047e362554acf5d2b9bb">00946</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8378ac165178047e362554acf5d2b9bb" title="Responds to the Quit item in the File menu.">fileExit</a> () <a name="l00947"></a>00947 { <a name="l00948"></a>00948 <span class="keywordtype">bool</span> ok = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> () -> okToQuit(); <a name="l00949"></a>00949 <a name="l00950"></a>00950 <span class="keywordflow">if</span> ( ok ) { <a name="l00951"></a>00951 <span class="comment">// save dock window and recent files</span> <a name="l00952"></a>00952 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7c2df6a2846d39e0c2ee2a7c165fb548" title="Automatically save dock windows and recently opened files.">autosaveSettings</a>(); <a name="l00953"></a>00953 qApp->quit (); <a name="l00954"></a>00954 } <a name="l00955"></a>00955 } <a name="l00956"></a>00956 <a name="l00957"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a85d0b87ef3373b60fafc5e824f3e7ad2">00957</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a85d0b87ef3373b60fafc5e824f3e7ad2" title="Enlarges the view of the canvas.">CanvasWindow::viewZoomIn</a>() <a name="l00958"></a>00958 { <a name="l00959"></a>00959 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#a85d0b87ef3373b60fafc5e824f3e7ad2" title="Enlarges the view of the canvas.">viewZoomIn</a> (); <a name="l00960"></a>00960 } <a name="l00961"></a>00961 <a name="l00962"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a2c52b060335284f90f9ebb31a6deba65">00962</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2c52b060335284f90f9ebb31a6deba65" title="Reduces the view of the canvas.">CanvasWindow::viewZoomOut</a>() <a name="l00963"></a>00963 { <a name="l00964"></a>00964 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#a2c52b060335284f90f9ebb31a6deba65" title="Reduces the view of the canvas.">viewZoomOut</a> (); <a name="l00965"></a>00965 } <a name="l00966"></a>00966 <a name="l00967"></a>00967 <span class="keywordtype">void</span> <a name="l00968"></a>00968 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a417c881be703d6837d7910ccd7b03094" title="Returns the view of the canvas to normal.">CanvasWindow::</a> <a name="l00969"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a417c881be703d6837d7910ccd7b03094">00969</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a417c881be703d6837d7910ccd7b03094" title="Returns the view of the canvas to normal.">viewZoomReset</a>() <a name="l00970"></a>00970 { <a name="l00971"></a>00971 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a417c881be703d6837d7910ccd7b03094" title="Returns the view of the canvas to normal.">viewZoomReset</a> (); <a name="l00972"></a>00972 } <a name="l00973"></a>00973 <a name="l00974"></a>00974 <span class="keywordtype">void</span> <a name="l00975"></a>00975 <a class="code" href="classhippodraw_1_1CanvasWindow.html#af17ea1de533b391ba24d65ea7d94435a" title="Locks a canvas item.">CanvasWindow::</a> <a name="l00976"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#af17ea1de533b391ba24d65ea7d94435a">00976</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#af17ea1de533b391ba24d65ea7d94435a" title="Locks a canvas item.">viewLock</a> () <a name="l00977"></a>00977 { <a name="l00978"></a>00978 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#aa8bf2565cebad75b39569fcc6ed40ade" title="Sets the selected QCanvasItem to be locked in size and position.">setLocked</a> ( <span class="keyword">true</span> ); <a name="l00979"></a>00979 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a> (); <a name="l00980"></a>00980 } <a name="l00981"></a>00981 <a name="l00982"></a>00982 <span class="keywordtype">void</span> <a name="l00983"></a>00983 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9083940821f605690e4f66cb5a650e30" title="Unlocks a canvas item.">CanvasWindow::</a> <a name="l00984"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a9083940821f605690e4f66cb5a650e30">00984</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9083940821f605690e4f66cb5a650e30" title="Unlocks a canvas item.">viewUnlock</a> () <a name="l00985"></a>00985 { <a name="l00986"></a>00986 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#aa8bf2565cebad75b39569fcc6ed40ade" title="Sets the selected QCanvasItem to be locked in size and position.">setLocked</a> ( <span class="keyword">false</span> ); <a name="l00987"></a>00987 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a> (); <a name="l00988"></a>00988 } <a name="l00989"></a>00989 <a name="l00993"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aa7dce183178da542692e3e9eb634b11d">00993</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa7dce183178da542692e3e9eb634b11d" title="Brings up standard window showing version, authors, etc.">CanvasWindow::helpAbout</a>() <a name="l00994"></a>00994 { <a name="l00995"></a>00995 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa7dce183178da542692e3e9eb634b11d" title="Brings up standard window showing version, authors, etc.">helpAbout</a> (); <a name="l00996"></a>00996 } <a name="l00997"></a>00997 <a name="l00998"></a>00998 <span class="keywordtype">void</span> <a name="l00999"></a>00999 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9924d78384ecf8f75b3caea1b9f5ca62" title="Brings up a QAssistant client.">CanvasWindow::</a> <a name="l01000"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a9924d78384ecf8f75b3caea1b9f5ca62">01000</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9924d78384ecf8f75b3caea1b9f5ca62" title="Brings up a QAssistant client.">helpHelp</a> () <a name="l01001"></a>01001 { <a name="l01002"></a>01002 <span class="preprocessor">#ifndef HAVE_HELP</span> <a name="l01003"></a>01003 <span class="preprocessor"></span> <span class="keyword">const</span> <span class="keywordtype">string</span> & app_name = <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> applicationName (); <a name="l01004"></a>01004 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> message ( <span class="stringliteral">"The application was built without\n"</span> <a name="l01005"></a>01005 <span class="stringliteral">"built-in help support"</span> ); <a name="l01006"></a>01006 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qmessagebox.html#information">QMessageBox::information</a> ( <span class="keyword">this</span>, <a name="l01007"></a>01007 app_name.c_str(), <a name="l01008"></a>01008 message, <a name="l01009"></a>01009 QMessageBox::Ok ); <a name="l01010"></a>01010 <span class="keywordflow">return</span>; <a name="l01011"></a>01011 <span class="preprocessor">#endif</span> <a name="l01012"></a>01012 <span class="preprocessor"></span> <a name="l01013"></a>01013 <a class="code" href="classhippodraw_1_1WindowController.html" title="A singleton class for keeping track the window components of HippoDraw.">WindowController</a> * controller = <a class="code" href="classhippodraw_1_1WindowController.html#a1d915480a9fc96b6ea18836b113f16ef" title="Returns the application instance.">WindowController::instance</a> (); <a name="l01014"></a>01014 controller -> openAssistant (); <a name="l01015"></a>01015 } <a name="l01016"></a>01016 <a name="l01017"></a>01017 <span class="keywordtype">void</span> <a name="l01018"></a>01018 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a00c8cab01450ddddd5d4c60b9607a8ee" title="Brings up Qt&#39;s about message box.">CanvasWindow::</a> <a name="l01019"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a00c8cab01450ddddd5d4c60b9607a8ee">01019</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a00c8cab01450ddddd5d4c60b9607a8ee" title="Brings up Qt&#39;s about message box.">aboutQt</a> () <a name="l01020"></a>01020 { <a name="l01021"></a>01021 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a00c8cab01450ddddd5d4c60b9607a8ee" title="Brings up Qt&#39;s about message box.">QMessageBox::aboutQt</a> ( <span class="keyword">this</span> ); <a name="l01022"></a>01022 } <a name="l01023"></a>01023 <a name="l01024"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8">01024</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">CanvasWindow::setCaption</a> () <a name="l01025"></a>01025 { <a name="l01026"></a>01026 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> fn = <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a>.c_str(); <a name="l01027"></a>01027 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa1490c13d54b077e28c4f5d58a7b8c8" title="Sets the Windows title.">QWidget::setCaption</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a88961a286341eaace0a792404d1f72e1" title="The prefix part of the window title.">m_prefix</a> + fn + <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3c5bf73c275c140d8facd93d5f8a5cf5" title="The changed status part of the window title.">m_changed</a> ); <a name="l01028"></a>01028 } <a name="l01029"></a>01029 <a name="l01030"></a>01030 <span class="keywordtype">void</span> <a name="l01031"></a>01031 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa989e546fb7b3d232ecb7d326dfc87c" title="Sets the file name component of the window&#39;s title.">CanvasWindow::</a> <a name="l01032"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa989e546fb7b3d232ecb7d326dfc87c">01032</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aaa989e546fb7b3d232ecb7d326dfc87c" title="Sets the file name component of the window&#39;s title.">setTitleFileName</a> ( <span class="keyword">const</span> std::string & name ) <a name="l01033"></a>01033 { <a name="l01034"></a>01034 <a class="code" href="classhippodraw_1_1CanvasWindow.html#abeab36922e15d948509bdf36c5a46cd9" title="The file name part of the window title.">m_filename</a> = name; <a name="l01035"></a>01035 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a6143aea0c19b2c689ac80d6745635d42" title="True if filename has been assigned, false if not.">m_filenameExists</a> = <span class="keyword">true</span>; <a name="l01036"></a>01036 } <a name="l01037"></a>01037 <a name="l01038"></a>01038 <span class="keywordtype">void</span> <a name="l01039"></a>01039 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2e45837c2b226ab9da7ee339dd02dd99" title="Adds a textual display to the canvas of type type.">CanvasWindow::</a> <a name="l01040"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a2e45837c2b226ab9da7ee339dd02dd99">01040</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2e45837c2b226ab9da7ee339dd02dd99" title="Adds a textual display to the canvas of type type.">addTextDisplay</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <a name="l01041"></a>01041 <span class="keyword">const</span> std::string & s ) <a name="l01042"></a>01042 { <a name="l01043"></a>01043 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#ad410f77f390dca59b1ffce2e22e79fdd" title="Add a display of text Adds a display of text to that will be associated with plotter...">addTextDisplay</a> ( plotter, s ); <a name="l01044"></a>01044 } <a name="l01045"></a>01045 <a name="l01046"></a>01046 <span class="keywordtype">void</span> <a name="l01047"></a>01047 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2e45837c2b226ab9da7ee339dd02dd99" title="Adds a textual display to the canvas of type type.">CanvasWindow::</a> <a name="l01048"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a54ab36603a7bc11993cc7733bea0e710">01048</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2e45837c2b226ab9da7ee339dd02dd99" title="Adds a textual display to the canvas of type type.">addTextDisplay</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <a name="l01049"></a>01049 <span class="keyword">const</span> std::string & <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a>, <a name="l01050"></a>01050 <span class="keyword">const</span> std::string & text) <a name="l01051"></a>01051 { <a name="l01052"></a>01052 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#ad410f77f390dca59b1ffce2e22e79fdd" title="Add a display of text Adds a display of text to that will be associated with plotter...">addTextDisplay</a> ( plotter, type, text ); <a name="l01053"></a>01053 } <a name="l01054"></a>01054 <a name="l01055"></a>01055 std::pair<double, double> <a name="l01056"></a>01056 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a87c888fa5051ac0674aba42b96e0fe68" title="Adds a text display at the relative position (xrel, yrel) in the selected item&#39;s...">CanvasWindow::</a> <a name="l01057"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a87c888fa5051ac0674aba42b96e0fe68">01057</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a87c888fa5051ac0674aba42b96e0fe68" title="Adds a text display at the relative position (xrel, yrel) in the selected item&#39;s...">addTextDisplayAt</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <a name="l01058"></a>01058 <span class="keyword">const</span> std::string & <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a>, <a name="l01059"></a>01059 <span class="keyword">const</span> std::string & text, <a name="l01060"></a>01060 <span class="keywordtype">double</span> xrel, <span class="keywordtype">double</span> yrel ) <a name="l01061"></a>01061 { <a name="l01062"></a>01062 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a87c888fa5051ac0674aba42b96e0fe68" title="Adds a text display at the relative position (xrel, yrel) in the selected item&#39;s...">addTextDisplayAt</a>( plotter, type, text, xrel, yrel ); <a name="l01063"></a>01063 } <a name="l01064"></a>01064 <a name="l01065"></a>01065 <span class="keywordtype">void</span> <a name="l01066"></a>01066 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2ae8fd77348776223cbaaeebefef0deb" title="Adds function textual display to the canvas.">CanvasWindow::</a> <a name="l01067"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a2ae8fd77348776223cbaaeebefef0deb">01067</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a2ae8fd77348776223cbaaeebefef0deb" title="Adds function textual display to the canvas.">addFuncDisplay</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <span class="keyword">const</span> std::string & s ) <a name="l01068"></a>01068 { <a name="l01069"></a>01069 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a87c0e3bda3e4d0cfeddf5b60933e4536" title="Add a text display which displays functions parameters.">addFuncDisplay</a> ( plotter, s ); <a name="l01070"></a>01070 } <a name="l01071"></a>01071 <a name="l01072"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a5c17ad4ba233b41587174adaa8169375">01072</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a5c17ad4ba233b41587174adaa8169375" title="Adds a new plot display to the canvas.">CanvasWindow::addPlotDisplay</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <span class="keywordtype">bool</span> sel ) <a name="l01073"></a>01073 { <a name="l01074"></a>01074 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a5c17ad4ba233b41587174adaa8169375" title="Creates a QtView object for the display and inserts it onto the canvas in the next...">addPlotDisplay</a> ( plotter, sel ); <a name="l01075"></a>01075 } <a name="l01076"></a>01076 <a name="l01077"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1b11968e6201c459776c3fb5e024297">01077</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad1b11968e6201c459776c3fb5e024297" title="Adds a new plot to the canvas and selects it.">CanvasWindow::addDisplay</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter ) <a name="l01078"></a>01078 { <a name="l01079"></a>01079 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a5c17ad4ba233b41587174adaa8169375" title="Creates a QtView object for the display and inserts it onto the canvas in the next...">addPlotDisplay</a> ( plotter ); <a name="l01080"></a>01080 } <a name="l01081"></a>01081 <a name="l01084"></a>01084 <span class="keywordtype">void</span> <a name="l01085"></a>01085 <a class="code" href="classhippodraw_1_1CanvasWindow.html#abbbbf272b52ae2ae533cd640cd3ee6ba" title="Removes the plotter and its view from the canvas.">CanvasWindow::</a> <a name="l01086"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#abbbbf272b52ae2ae533cd640cd3ee6ba">01086</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#abbbbf272b52ae2ae533cd640cd3ee6ba" title="Removes the plotter and its view from the canvas.">removeDisplay</a> ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter ) <a name="l01087"></a>01087 { <a name="l01088"></a>01088 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#abbbbf272b52ae2ae533cd640cd3ee6ba" title="Removes the display from the canvas.">removeDisplay</a> ( plotter ); <a name="l01089"></a>01089 } <a name="l01090"></a>01090 <a name="l01093"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c84a1ef41ff9a9c8f178da6208aeac2">01093</a> <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c84a1ef41ff9a9c8f178da6208aeac2" title="Returns the selected plotter.">CanvasWindow::selectedPlotter</a> () <a name="l01094"></a>01094 { <a name="l01095"></a>01095 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#af5c92dad44ecf542c3b14576e15505e0" title="Returns the selected PlotterBase object.">selectedPlotter</a> (); <a name="l01096"></a>01096 } <a name="l01097"></a>01097 <a name="l01098"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a80b660656e50e69002a74ab71395fbe3">01098</a> <span class="keyword">const</span> vector < const ViewBase * > & <a class="code" href="classhippodraw_1_1CanvasWindow.html#a80b660656e50e69002a74ab71395fbe3" title="Returns the list of ViewBase objects on the canvas.">CanvasWindow::views</a> () <a name="l01099"></a>01099 { <a name="l01100"></a>01100 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a1ded918fda8c42bd2a74d847d8052c9c" title="Returns temporary list of all QtView objects on the canvas.">views</a> (); <a name="l01101"></a>01101 } <a name="l01102"></a>01102 <a name="l01103"></a>01103 <span class="keywordtype">void</span> <a name="l01104"></a>01104 <a class="code" href="classhippodraw_1_1CanvasWindow.html#afe16dd5c051f9a066cc5ed119ff89baf" title="Clears and fills plotter_list with all the PlotterBase objects on the canvas.">CanvasWindow::</a> <a name="l01105"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#afe16dd5c051f9a066cc5ed119ff89baf">01105</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#afe16dd5c051f9a066cc5ed119ff89baf" title="Clears and fills plotter_list with all the PlotterBase objects on the canvas.">fillPlotterList</a> ( std::vector < PlotterBase * > & plotters ) <a name="l01106"></a>01106 { <a name="l01107"></a>01107 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#afe16dd5c051f9a066cc5ed119ff89baf" title="Clears and fills plotter_list with all the PlotterBase objects on the canvas.">fillPlotterList</a> ( plotters ); <a name="l01108"></a>01108 } <a name="l01109"></a>01109 <a name="l01110"></a>01110 <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * <a name="l01111"></a>01111 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1de633dbbcc530cdf8815deef9d82126" title="Returns the QtView object that is the Observer of the plotter.">CanvasWindow::</a> <a name="l01112"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a1de633dbbcc530cdf8815deef9d82126">01112</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1de633dbbcc530cdf8815deef9d82126" title="Returns the QtView object that is the Observer of the plotter.">getViewFor</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter )<span class="keyword"> const</span> <a name="l01113"></a>01113 <span class="keyword"></span>{ <a name="l01114"></a>01114 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a1de633dbbcc530cdf8815deef9d82126" title="Returns the QtView object that is the Observer of the plotter.">getViewFor</a> ( plotter ); <a name="l01115"></a>01115 } <a name="l01116"></a>01116 <a name="l01117"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad889288071f3192cbbbc4eddcf3adfae">01117</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad889288071f3192cbbbc4eddcf3adfae" title="Sets the display interval feature to enabled if yes is true, otherwise sets it to...">CanvasWindow::setIntervalEnabled</a> ( <span class="keywordtype">bool</span> yes ) <a name="l01118"></a>01118 { <a name="l01119"></a>01119 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#ad889288071f3192cbbbc4eddcf3adfae" title="Sets the display interval feature of all views to enabled if yes is true, otherwise...">setIntervalEnabled</a> ( yes ); <a name="l01120"></a>01120 } <a name="l01121"></a>01121 <a name="l01122"></a>01122 <span class="keywordtype">void</span> <a name="l01123"></a>01123 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1b6d4946f2c1b550211d5624baa58724" title="Shows the Inspector window.">CanvasWindow::</a> <a name="l01124"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a1b6d4946f2c1b550211d5624baa58724">01124</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1b6d4946f2c1b550211d5624baa58724" title="Shows the Inspector window.">viewShowInspector</a> () <a name="l01125"></a>01125 { <a name="l01126"></a>01126 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> showInspector (); <a name="l01127"></a>01127 } <a name="l01128"></a>01128 <a name="l01129"></a>01129 <span class="keywordtype">void</span> <a name="l01130"></a>01130 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a260f0de579517217f98ac67cddadb1aa" title="Shows the plot table.">CanvasWindow::</a> <a name="l01131"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a260f0de579517217f98ac67cddadb1aa">01131</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a260f0de579517217f98ac67cddadb1aa" title="Shows the plot table.">viewShowPlotTable</a> () <a name="l01132"></a>01132 { <a name="l01133"></a>01133 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> == 0 ) { <a name="l01134"></a>01134 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1PlotTable.html" title="A derived class of PlotTableBase class which is generated by the Qt designer.">PlotTable</a> (); <a name="l01135"></a>01135 } <a name="l01136"></a>01136 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a>-><a class="code" href="classhippodraw_1_1PlotTable.html#a0b2de321e53be52b47bd66232372aeb4" title="Sets the canvas to be used by the table.">setCanvas</a> ( <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> ); <a name="l01137"></a>01137 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a50f9341ba2f0de63c009539870a22183" title="The singleton instance of PlotTable.">s_plot_table</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qdialog.html#show">show</a>(); <a name="l01138"></a>01138 } <a name="l01139"></a>01139 <a name="l01140"></a>01140 <span class="keywordtype">void</span> <a name="l01141"></a>01141 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a75073880c1979cbb730e81f2c27e170c" title="Shows the pick table window.">CanvasWindow::</a> <a name="l01142"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a75073880c1979cbb730e81f2c27e170c">01142</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a75073880c1979cbb730e81f2c27e170c" title="Shows the pick table window.">viewShowPickTable</a> () <a name="l01143"></a>01143 { <a name="l01144"></a>01144 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a75073880c1979cbb730e81f2c27e170c" title="Show the pick table.">viewShowPickTable</a>(); <a name="l01145"></a>01145 <a name="l01146"></a>01146 <a class="code" href="classCanvasWindowBase.html#ab657a7285ebcc38e9f0094c644e9afcd">m_pick</a> -> toggle (); <span class="comment">// need to get in this mode</span> <a name="l01147"></a>01147 } <a name="l01148"></a>01148 <a name="l01149"></a>01149 <span class="keywordtype">void</span> <a name="l01150"></a>01150 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c9a87b6935486a4bc630b54e31426e6" title="Saves the plotter as image file.">CanvasWindow::</a> <a name="l01151"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c9a87b6935486a4bc630b54e31426e6">01151</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c9a87b6935486a4bc630b54e31426e6" title="Saves the plotter as image file.">savePlotAsImage</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <a name="l01152"></a>01152 <span class="keyword">const</span> std::string & filename ) <a name="l01153"></a>01153 { <a name="l01154"></a>01154 <a class="code" href="classhippodraw_1_1SaveAsImageEvent.html" title="A derived class of QCustomEvent to handle saving a PlotterBase object as image file...">SaveAsImageEvent</a> * <span class="keyword">event</span> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1SaveAsImageEvent.html" title="A derived class of QCustomEvent to handle saving a PlotterBase object as image file...">SaveAsImageEvent</a> ( plotter, filename ); <a name="l01155"></a>01155 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qapplication.html#postEvent">QApplication::postEvent</a> ( <span class="keyword">this</span>, event ); <a name="l01156"></a>01156 } <a name="l01157"></a>01157 <a name="l01158"></a>01158 <span class="keywordtype">void</span> <a name="l01159"></a>01159 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a016f9d6f21c72867c0d52c7817940b23" title="Saves the plotter as image file.">CanvasWindow::</a> <a name="l01160"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a016f9d6f21c72867c0d52c7817940b23">01160</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a016f9d6f21c72867c0d52c7817940b23" title="Saves the plotter as image file.">saveAsImage</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter, <a name="l01161"></a>01161 <span class="keyword">const</span> std::string & filename ) <a name="l01162"></a>01162 { <a name="l01163"></a>01163 qApp -> lock (); <a name="l01164"></a>01164 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c9a87b6935486a4bc630b54e31426e6" title="Saves the plotter as image file.">savePlotAsImage</a> ( plotter, filename ); <a name="l01165"></a>01165 qApp -> unlock (); <a name="l01166"></a>01166 } <a name="l01167"></a>01167 <a name="l01168"></a>01168 <span class="keywordtype">void</span> <a name="l01169"></a>01169 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa24ac7bcb3bd0764774a88d2492218e2" title="Select or deselect all views in the window.">CanvasWindow::</a> <a name="l01170"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aa24ac7bcb3bd0764774a88d2492218e2">01170</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aa24ac7bcb3bd0764774a88d2492218e2" title="Select or deselect all views in the window.">setAllSelected</a> ( <span class="keywordtype">bool</span> flag ) <a name="l01171"></a>01171 { <a name="l01172"></a>01172 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#aa24ac7bcb3bd0764774a88d2492218e2" title="Sets selection flag on all QCanvasItem objects.">setAllSelected</a>( flag ); <a name="l01173"></a>01173 } <a name="l01174"></a>01174 <a name="l01175"></a>01175 <span class="keywordtype">void</span> <a name="l01176"></a>01176 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a537e615eb3ca39cc8cfd8c550788571f" title="Select a specific view in the window.">CanvasWindow::</a> <a name="l01177"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a537e615eb3ca39cc8cfd8c550788571f">01177</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a537e615eb3ca39cc8cfd8c550788571f" title="Select a specific view in the window.">setSelected</a> ( <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * view ) <a name="l01178"></a>01178 { <a name="l01179"></a>01179 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1FigureEditor.html#a488b4c5d8bd81938f6de2703af9781ab" title="Set the selected QCanvasItem.">setSelectedItem</a>( view ); <a name="l01180"></a>01180 } <a name="l01181"></a>01181 <a name="l01182"></a>01182 <span class="keywordtype">void</span> <a name="l01183"></a>01183 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a85299ad8f98b64d9ca3e0e966b372de9" title="Switches View to the previous view for the selected item on the canvas.">CanvasWindow::</a> <a name="l01184"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a85299ad8f98b64d9ca3e0e966b372de9">01184</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a85299ad8f98b64d9ca3e0e966b372de9" title="Switches View to the previous view for the selected item on the canvas.">previousView</a> ( ) <a name="l01185"></a>01185 { <a name="l01186"></a>01186 <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * currentPlotter = <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c84a1ef41ff9a9c8f178da6208aeac2" title="Returns the selected plotter.">selectedPlotter</a>(); <a name="l01187"></a>01187 <span class="keywordflow">if</span> (currentPlotter) { <a name="l01188"></a>01188 <span class="keywordflow">if</span> ( ! ( currentPlotter-><a class="code" href="classhippodraw_1_1PlotterBase.html#a7cc9083406f82e28ddeff2d513095489" title="Returns current_range_saved member t.">getCurrentRangeSaved</a> () ) ) { <a name="l01189"></a>01189 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> setCurrentRange(); <a name="l01190"></a>01190 } <a name="l01191"></a>01191 <a name="l01192"></a>01192 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c84a1ef41ff9a9c8f178da6208aeac2" title="Returns the selected plotter.">selectedPlotter</a>() -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a96cfb7661e7b6dbd25227974e9ec5486" title="Switches View to the next view for the selected item on the canvas.">nextView</a> (<span class="keyword">false</span> ); <a name="l01193"></a>01193 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> canvas () -> update(); <a name="l01194"></a>01194 } <a name="l01195"></a>01195 } <a name="l01196"></a>01196 <a name="l01197"></a>01197 <span class="keywordtype">void</span> <a name="l01198"></a>01198 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a96cfb7661e7b6dbd25227974e9ec5486" title="Switches View to the next view for the selected item on the canvas.">CanvasWindow::</a> <a name="l01199"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a96cfb7661e7b6dbd25227974e9ec5486">01199</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a96cfb7661e7b6dbd25227974e9ec5486" title="Switches View to the next view for the selected item on the canvas.">nextView</a> ( ) <a name="l01200"></a>01200 { <a name="l01201"></a>01201 <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * currentPlotter = <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c84a1ef41ff9a9c8f178da6208aeac2" title="Returns the selected plotter.">selectedPlotter</a>(); <a name="l01202"></a>01202 <span class="keywordflow">if</span> (currentPlotter) { <a name="l01203"></a>01203 <span class="keywordflow">if</span> ( !(currentPlotter-><a class="code" href="classhippodraw_1_1PlotterBase.html#a7cc9083406f82e28ddeff2d513095489" title="Returns current_range_saved member t.">getCurrentRangeSaved</a>()) ) { <a name="l01204"></a>01204 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a60906f4257f6e53fb37c7c7aab122b2a" title="Saves the current range of the selected plotter.">setCurrentRange</a>(); <a name="l01205"></a>01205 } <a name="l01206"></a>01206 <a name="l01207"></a>01207 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1c84a1ef41ff9a9c8f178da6208aeac2" title="Returns the selected plotter.">selectedPlotter</a>() -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a96cfb7661e7b6dbd25227974e9ec5486" title="Switches View to the next view for the selected item on the canvas.">nextView</a> ( <span class="keyword">true</span> ); <a name="l01208"></a>01208 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasview.html#canvas">canvas</a>()->update(); <a name="l01209"></a>01209 } <a name="l01210"></a>01210 } <a name="l01211"></a>01211 <a name="l01212"></a>01212 <a name="l01213"></a>01213 <span class="keywordtype">void</span> <a name="l01214"></a>01214 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8215c6f69770028ea27788bef9623a1e" title="Sets the zoom mode to true or false.">CanvasWindow::</a> <a name="l01215"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a8215c6f69770028ea27788bef9623a1e">01215</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8215c6f69770028ea27788bef9623a1e" title="Sets the zoom mode to true or false.">setZoomMode</a> ( <span class="keywordtype">bool</span> on ) <a name="l01216"></a>01216 { <a name="l01217"></a>01217 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a8215c6f69770028ea27788bef9623a1e" title="Sets the zoom mode to true or false.">setZoomMode</a> ( on ); <a name="l01218"></a>01218 } <a name="l01219"></a>01219 <a name="l01220"></a>01220 <span class="keyword">const</span> std::vector<double> & <a name="l01221"></a>01221 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a49f838f3b9d99a3737662070151be1f8" title="Retrieve a vector (x, y, z) points from the next mouse event.">CanvasWindow::</a> <a name="l01222"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a49f838f3b9d99a3737662070151be1f8">01222</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a49f838f3b9d99a3737662070151be1f8" title="Retrieve a vector (x, y, z) points from the next mouse event.">mouseEventData</a>() <a name="l01223"></a>01223 { <a name="l01224"></a>01224 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a>-><a class="code" href="classhippodraw_1_1CanvasView.html#a49f838f3b9d99a3737662070151be1f8" title="Retrieve a vector of (x, y, z) points from the next mouse event.">mouseEventData</a>(); <a name="l01225"></a>01225 } <a name="l01226"></a>01226 <a name="l01227"></a>01227 <span class="keywordtype">void</span> <a name="l01228"></a>01228 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a30e0b0d749e0e1f0307182ff129f2620" title="Sets the printer settings.">CanvasWindow::</a> <a name="l01229"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a30e0b0d749e0e1f0307182ff129f2620">01229</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a30e0b0d749e0e1f0307182ff129f2620" title="Sets the printer settings.">settingPrinter</a>() <a name="l01230"></a>01230 { <a name="l01231"></a>01231 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> setPrinterSettings (); <a name="l01232"></a>01232 } <a name="l01233"></a>01233 <a name="l01234"></a>01234 <span class="keywordtype">void</span> <a name="l01235"></a>01235 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a72a5a6a5f2a9d03368b1dbf86e385c99" title="Sets the canvas settings.">CanvasWindow::</a> <a name="l01236"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a72a5a6a5f2a9d03368b1dbf86e385c99">01236</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a72a5a6a5f2a9d03368b1dbf86e385c99" title="Sets the canvas settings.">settingCanvas</a>() <a name="l01237"></a>01237 { <a name="l01238"></a>01238 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> setup (); <a name="l01239"></a>01239 } <a name="l01240"></a>01240 <a name="l01241"></a>01241 <span class="keywordtype">void</span> <a name="l01242"></a>01242 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9feb1e4dd306c21a82b91bdf8cc2b942" title="Sets the font settings.">CanvasWindow::</a> <a name="l01243"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a9feb1e4dd306c21a82b91bdf8cc2b942">01243</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9feb1e4dd306c21a82b91bdf8cc2b942" title="Sets the font settings.">settingFonts</a>() <a name="l01244"></a>01244 { <a name="l01245"></a>01245 <span class="keywordtype">bool</span> ok; <a name="l01246"></a>01246 <a name="l01247"></a>01247 <span class="comment">// From the Qt documentation - "The usual way to use QFontDialog class is</span> <a name="l01248"></a>01248 <span class="comment">// to call one of the static convenience functions"</span> <a name="l01249"></a>01249 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfont.html">QFont</a> font <a name="l01250"></a>01250 = <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfontdialog.html#getFont">QFontDialog::getFont</a> ( &ok, <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qfont.html">QFont</a>( <span class="stringliteral">"Helvetica [Cronyx]"</span>, 10), <span class="keyword">this</span>); <a name="l01251"></a>01251 <a name="l01252"></a>01252 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> setFonts( font ); <a name="l01253"></a>01253 } <a name="l01254"></a>01254 <a name="l01255"></a>01255 <span class="keywordtype">void</span> <a name="l01256"></a>01256 <a class="code" href="classhippodraw_1_1CanvasWindow.html#aee1ebbc5bd62d90109af2091d19be08a" title="Prints the view to Postscript file without prompting user.">CanvasWindow::</a> <a name="l01257"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#aee1ebbc5bd62d90109af2091d19be08a">01257</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aee1ebbc5bd62d90109af2091d19be08a" title="Prints the view to Postscript file without prompting user.">print</a> ( <span class="keyword">const</span> std::string & filename ) <a name="l01258"></a>01258 { <a name="l01259"></a>01259 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#aee1ebbc5bd62d90109af2091d19be08a" title="Prints the view to Postscript file without prompting user.">print</a> ( filename ); <a name="l01260"></a>01260 } <a name="l01261"></a>01261 <a name="l01262"></a>01262 <span class="keywordtype">void</span> <a name="l01263"></a>01263 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a943c9eadea941405d8bac2d43448ce75" title="Sets the number of columns and rows of plots on each page.">CanvasWindow::</a> <a name="l01264"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a943c9eadea941405d8bac2d43448ce75">01264</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a943c9eadea941405d8bac2d43448ce75" title="Sets the number of columns and rows of plots on each page.">setPlotMatrix</a> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> columns, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rows ) <a name="l01265"></a>01265 { <a name="l01266"></a>01266 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a943c9eadea941405d8bac2d43448ce75" title="Sets the number of columns and rows of plots on each page.">setPlotMatrix</a> ( columns, rows ); <a name="l01267"></a>01267 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> reTile (); <a name="l01268"></a>01268 } <a name="l01269"></a>01269 <a name="l01270"></a>01270 <span class="keyword">const</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> & <a name="l01271"></a>01271 <a class="code" href="classhippodraw_1_1CanvasWindow.html#afa9e47dc90437ebeb4facb2192cf2a7c" title="Returns a reference the application&#39;s QSettings key.">CanvasWindow::</a> <a name="l01272"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#afa9e47dc90437ebeb4facb2192cf2a7c">01272</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#afa9e47dc90437ebeb4facb2192cf2a7c" title="Returns a reference the application&#39;s QSettings key.">getAppKey</a> ( )<span class="keyword"> const</span> <a name="l01273"></a>01273 <span class="keyword"></span>{ <a name="l01274"></a>01274 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#afa9e47dc90437ebeb4facb2192cf2a7c" title="Returns a reference the application&#39;s QSettings key.">getAppKey</a> (); <a name="l01275"></a>01275 } <a name="l01276"></a>01276 <a name="l01277"></a>01277 <span class="keywordtype">void</span> <a name="l01278"></a>01278 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a780d015b8f1e5a0e908b67523cd0608d" title="Responds to change in fitter settings.">CanvasWindow::</a> <a name="l01279"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a780d015b8f1e5a0e908b67523cd0608d">01279</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a780d015b8f1e5a0e908b67523cd0608d" title="Responds to change in fitter settings.">setFitter</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html">QAction</a> * action ) <a name="l01280"></a>01280 { <a name="l01281"></a>01281 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> name = action -> menuText (); <a name="l01282"></a>01282 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> setFitterDefault ( name ); <a name="l01283"></a>01283 } <a name="l01284"></a>01284 <a name="l01285"></a>01285 <span class="keywordtype">void</span> <a name="l01286"></a>01286 <a class="code" href="classhippodraw_1_1CanvasWindow.html#adbcb5e1630b492f9177b57563eba7f28" title="Sets to flag to make plots in their selected state when added to the canvas.">CanvasWindow::</a> <a name="l01287"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#adbcb5e1630b492f9177b57563eba7f28">01287</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#adbcb5e1630b492f9177b57563eba7f28" title="Sets to flag to make plots in their selected state when added to the canvas.">setAddedSelected</a> ( <span class="keywordtype">bool</span> yes ) <a name="l01288"></a>01288 { <a name="l01289"></a>01289 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#adbcb5e1630b492f9177b57563eba7f28" title="Sets to flag to make plots in their selected state when added to the canvas.">setAddedSelected</a> ( yes ); <a name="l01290"></a>01290 } <a name="l01291"></a>01291 <a name="l01292"></a>01292 <span class="keywordtype">void</span> <a name="l01293"></a>01293 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a" title="Sets the cut mode.">CanvasWindow::</a> <a name="l01294"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a">01294</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a" title="Sets the cut mode.">setCutMode</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html">QAction</a> * action ) <a name="l01295"></a>01295 { <a name="l01296"></a>01296 <span class="keywordflow">if</span> ( action == <a class="code" href="classCanvasWindowBase.html#a0a716c682e110f9ffbd6dab3c2833df8">m_cut1</a> ) <a name="l01297"></a>01297 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a" title="Sets the cut mode.">setCutMode</a> (1); <a name="l01298"></a>01298 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( action == <a class="code" href="classCanvasWindowBase.html#a1cee84c6b29cef84bfde2a3b01d4c2a6">m_cut2</a> ) <a name="l01299"></a>01299 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a" title="Sets the cut mode.">setCutMode</a> (2); <a name="l01300"></a>01300 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( action == <a class="code" href="classCanvasWindowBase.html#a33d8c6b51786072553cde45b21080894">m_cut3</a> ) <a name="l01301"></a>01301 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a" title="Sets the cut mode.">setCutMode</a> (3); <a name="l01302"></a>01302 <span class="keywordflow">else</span> <a name="l01303"></a>01303 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a712f76cc0cf56259e82d237d6105d56a" title="Sets the cut mode.">setCutMode</a> (0); <span class="comment">// pick mode</span> <a name="l01304"></a>01304 } <a name="l01305"></a>01305 <a name="l01306"></a>01306 <a class="code" href="classhippodraw_1_1NTuple.html" title="A DataSource class implemented with std::vector&lt;double&gt; to store the column...">NTuple</a> * <a name="l01307"></a>01307 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table the selected plotter.">CanvasWindow::</a> <a name="l01308"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c">01308</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table the selected plotter.">getPickTable</a> ()<span class="keyword"> const</span> <a name="l01309"></a>01309 <span class="keyword"></span>{ <a name="l01310"></a>01310 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table the selected plotter.">getPickTable</a>(); <a name="l01311"></a>01311 } <a name="l01312"></a>01312 <a name="l01313"></a>01313 <a class="code" href="classhippodraw_1_1NTuple.html" title="A DataSource class implemented with std::vector&lt;double&gt; to store the column...">NTuple</a> * <a name="l01314"></a>01314 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table the selected plotter.">CanvasWindow::</a> <a name="l01315"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ad9cbe18454f07355fd25aa4eaa8ac560">01315</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table the selected plotter.">getPickTable</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter )<span class="keyword"> const</span> <a name="l01316"></a>01316 <span class="keyword"></span>{ <a name="l01317"></a>01317 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table the selected plotter.">getPickTable</a> ( plotter ); <a name="l01318"></a>01318 } <a name="l01319"></a>01319 <a name="l01320"></a>01320 <span class="keywordtype">void</span> <a name="l01321"></a>01321 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a678f9126b5bb80571b6a597a4e1a67ea" title="Group the views.">CanvasWindow::</a> <a name="l01322"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a678f9126b5bb80571b6a597a4e1a67ea">01322</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a678f9126b5bb80571b6a597a4e1a67ea" title="Group the views.">groupView</a> () <a name="l01323"></a>01323 { <a name="l01324"></a>01324 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a678f9126b5bb80571b6a597a4e1a67ea" title="Group the views.">groupView</a> (); <a name="l01325"></a>01325 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l01326"></a>01326 } <a name="l01327"></a>01327 <a name="l01328"></a>01328 <span class="keywordtype">void</span> <a name="l01329"></a>01329 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ae22500439e17509d77c5edb068ca8504" title="Ungroup the views.">CanvasWindow::</a> <a name="l01330"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#ae22500439e17509d77c5edb068ca8504">01330</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ae22500439e17509d77c5edb068ca8504" title="Ungroup the views.">ungroupView</a> () <a name="l01331"></a>01331 { <a name="l01332"></a>01332 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#ae22500439e17509d77c5edb068ca8504" title="Ungroup the views.">ungroupView</a> (); <a name="l01333"></a>01333 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a1aeea95493e6f5d814b9ae40575fac52" title="Update Action objects.">updateActions</a>(); <a name="l01334"></a>01334 } <a name="l01335"></a>01335 <a name="l01336"></a>01336 <span class="keywordtype">void</span> <a name="l01337"></a>01337 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a93bee9e4639a06665f76d1da1c9586b1" title="Responds to open recent file.">CanvasWindow::</a> <a name="l01338"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a93bee9e4639a06665f76d1da1c9586b1">01338</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a93bee9e4639a06665f76d1da1c9586b1" title="Responds to open recent file.">openRecentFile</a>(<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qaction.html">QAction</a> * action ) <a name="l01339"></a>01339 { <a name="l01340"></a>01340 <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> filename = action -> menuText (); <a name="l01341"></a>01341 <a name="l01342"></a>01342 <span class="keyword">const</span> <span class="keywordtype">string</span> fn = filename.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#latin1">latin1</a>(); <a name="l01343"></a>01343 string::size_type pos = fn.find_last_of ( <span class="charliteral">'.'</span> ); <a name="l01344"></a>01344 <span class="keyword">const</span> <span class="keywordtype">string</span> suffix = fn.substr ( pos ); <a name="l01345"></a>01345 <a name="l01346"></a>01346 <a name="l01347"></a>01347 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#aceaf259a4bc29c155c1d18bbaf3120b3" title="Returns true if suffix is one corresponding to text NTuple file.">QtFileDialog::isTextSuffix</a> ( suffix ) ) { <a name="l01348"></a>01348 <a class="code" href="classhippodraw_1_1QtFileDialog.html#a9e1b41dab59aeb9fed2a93266e8aab53" title="Opens a text NTuple file.">QtFileDialog::openTextTuple</a> ( fn ); <a name="l01349"></a>01349 action -> setToggleAction ( <span class="keyword">false</span> ); <a name="l01350"></a>01350 action -> setToggleAction ( <span class="keyword">true</span> ); <a name="l01351"></a>01351 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l01352"></a>01352 <span class="keywordflow">return</span>; <a name="l01353"></a>01353 } <a name="l01354"></a>01354 <a name="l01355"></a>01355 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a234760bedcb99a3bc6642d193bd8f763" title="Returns true if suffix is one corresponding to FITS DataSource file.">QtFileDialog::isFitsSuffix</a> ( suffix ) ) { <a name="l01356"></a>01356 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -><a class="code" href="classhippodraw_1_1QtFileDialog.html#a44538f225a6f109bd5fbb98c5eee2bb0" title="Opens a FITS DataSource file.">openFitsTuple</a> ( fn, <span class="keyword">this</span> ); <a name="l01357"></a>01357 action -> setToggleAction ( <span class="keyword">false</span> ); <a name="l01358"></a>01358 action -> setToggleAction ( <span class="keyword">true</span> ); <a name="l01359"></a>01359 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l01360"></a>01360 <span class="keywordflow">return</span>; <a name="l01361"></a>01361 } <a name="l01362"></a>01362 <a name="l01363"></a>01363 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtFileDialog.html#a5f07ace06c409b8e470fc17a6c0e02c6" title="Returns true if suffix is one corresponding to ROOT DataSource files.">QtFileDialog::isRootSuffix</a> ( suffix ) ) { <a name="l01364"></a>01364 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -><a class="code" href="classhippodraw_1_1QtFileDialog.html#a0f77e14eb1b8db637d55dff8623c9521" title="Opens a ROOT DataSource file.">openRootTuple</a> ( fn, <span class="keyword">this</span> ); <a name="l01365"></a>01365 action -> setToggleAction ( <span class="keyword">false</span> ); <a name="l01366"></a>01366 action -> setToggleAction ( <span class="keyword">true</span> ); <a name="l01367"></a>01367 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l01368"></a>01368 <span class="keywordflow">return</span>; <a name="l01369"></a>01369 } <a name="l01370"></a>01370 <a name="l01371"></a>01371 <a class="code" href="classhippodraw_1_1CanvasWindow.html#a3a71629fb19004232d4aa1f3c051260e" title="The open file dialog for this window.">m_file_dialog</a> -> openTextTuple ( fn ); <a name="l01372"></a>01372 <a name="l01373"></a>01373 <span class="comment">// Should use normal menu item.</span> <a name="l01374"></a>01374 action -> setToggleAction ( <span class="keyword">false</span> ); <a name="l01375"></a>01375 action -> setToggleAction ( <span class="keyword">true</span> ); <a name="l01376"></a>01376 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> notifyObservers (); <a name="l01377"></a>01377 } <a name="l01378"></a>01378 <a name="l01379"></a>01379 <span class="keywordtype">void</span> <a name="l01380"></a><a class="code" href="classhippodraw_1_1CanvasWindow.html#a7c2df6a2846d39e0c2ee2a7c165fb548">01380</a> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7c2df6a2846d39e0c2ee2a7c165fb548" title="Automatically save dock windows and recently opened files.">CanvasWindow::autosaveSettings</a>() <a name="l01381"></a>01381 { <a name="l01382"></a>01382 <a class="code" href="classhippodraw_1_1CanvasWindow.html#ad6e6c8077e603e04ca6db53b58fb0900" title="The CanvasView object which is the central widget.">m_canvas_view</a> -> <a class="code" href="classhippodraw_1_1CanvasWindow.html#a7c2df6a2846d39e0c2ee2a7c165fb548" title="Automatically save dock windows and recently opened files.">autosaveSettings</a> ( <span class="keyword">this</span> ); <a name="l01383"></a>01383 } </pre></div></div> <hr size="1"><address style="align: right;"><small> Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0> </a> </small></address> </body> </html>