diff options
Diffstat (limited to 'doc/tutorial2.doc')
-rw-r--r-- | doc/tutorial2.doc | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/doc/tutorial2.doc b/doc/tutorial2.doc index efe2b1d8b..75225b0db 100644 --- a/doc/tutorial2.doc +++ b/doc/tutorial2.doc @@ -90,10 +90,10 @@ the program's functionality. The program provides two dialogs, one to set options, and the other to create and edit a data set. Both dialogs are launched from chart form menu options or toolbar buttons. -The chart form's main widget is a QCanvasView which displays the -QCanvas on which we draw the pie chart or bar graph. We subclass -QCanvasView to obtain some specialised behaviour. Similarly we -subclass the QCanvasText class (used to place text items on a canvas) +The chart form's main widget is a TQCanvasView which displays the +TQCanvas on which we draw the pie chart or bar graph. We subclass +TQCanvasView to obtain some specialised behaviour. Similarly we +subclass the TQCanvasText class (used to place text items on a canvas) since we require slightly more than the standard class provides. The project file, \c chart.pro, is used to create the Makefile that is @@ -378,8 +378,8 @@ context menu. \table \row -\i The QCanvas class is used for drawing 2D vector graphics. The -QCanvasView class is used to present a view of a canvas in an +\i The TQCanvas class is used for drawing 2D vector graphics. The +TQCanvasView class is used to present a view of a canvas in an application's GUI. All our drawing operations take place on the canvas; but events (e.g. mouse clicks) take place on the canvas view. \endtable @@ -524,12 +524,12 @@ updateChartType() slot. And now that we know the window size and position we can resize and move the chart form's window accordingly. -\skipto new QCanvas +\skipto new TQCanvas \printuntil show -We create a new QCanvas and set its size to that of the chart form +We create a new TQCanvas and set its size to that of the chart form window's client area. We also create a \c CanvasView (our own subclass -of QCanvasView) to display the QCanvas. We make the canvas view the +of TQCanvasView) to display the TQCanvas. We make the canvas view the chart form's main widget and show it. \skipto isEmpty @@ -808,7 +808,7 @@ value. \printuntil show -We create a new QCanvasRectangle for each bar with an x position of 0 +We create a new TQCanvasRectangle for each bar with an x position of 0 (since this is a horizontal bar chart every bar begins at the left), a y value that starts at 0 and grows by the height of each bar as each one is drawn, the height of the bar and the canvas that the bar should @@ -856,30 +856,30 @@ proportional height ready to draw the next element. \printline \printline -\section1 Subclassing QCanvasText +\section1 Subclassing TQCanvasText (Extracts from \c canvastext.h.) \quotefile chart/canvastext.h -\skipto public QCanvasText +\skipto public TQCanvasText \printuntil private \printuntil }; Our CanvasText subclass is a very simple specialisation of -QCanvasText. All we've done is added a single private member \c +TQCanvasText. All we've done is added a single private member \c m_index which holds the element vector index of the element associated with this text item, and provided a getter and setter for this value. -\section1 Subclassing QCanvasView +\section1 Subclassing TQCanvasView (Extracts from \c canvasview.h.) \quotefile chart/canvasview.h -\skipto public QCanvasView +\skipto public TQCanvasView \printuntil private \printuntil }; -We need to subclass QCanvasView so that we can handle: +We need to subclass TQCanvasView so that we can handle: \list 1 \i Context menu requests. \i Form resizing. @@ -944,17 +944,17 @@ element's proportional x and y positions for the current chart type to the current x and y positions proportional to the width and height respectively. We know which element to update because when we create each canvas text item we pass it the index position of the element it -corresponds to. We subclassed QCanvasText so that we could set and get +corresponds to. We subclassed TQCanvasText so that we could set and get this index value. Finally we call update() to make the canvas redraw. \table \row -\i A QCanvas has no visual representation. To see the contents of a -canvas you must create a QCanvasView to present the canvas. Items only +\i A TQCanvas has no visual representation. To see the contents of a +canvas you must create a TQCanvasView to present the canvas. Items only appear in the canvas view if they have been show()n, and then, only if -QCanvas::update() has been called. By default a QCanvas's background +TQCanvas::update() has been called. By default a TQCanvas's background color is white, and by default shapes drawn on the canvas, e.g. -QCanvasRectangle, QCanvasEllipse, etc., have their fill color set to +TQCanvasRectangle, TQCanvasEllipse, etc., have their fill color set to white, so setting a non-white brush color is highly recommended! \endtable |