1 /*-*- c++ -*-********************************************************
2 * wxLayoutList.h - a formatted text rendering engine for wxWindows *
4 * (C) 1999 by Karsten Ballüder (Ballueder@usa.net) *
7 *******************************************************************/
14 # pragma interface "wxllist.h"
21 #include "wx/printdlg.h"
22 #include "wx/generic/printps.h"
23 #include "wx/generic/prntdlgg.h"
25 // skip the following defines if embedded in M application
27 # define WXMENU_LAYOUT_LCLICK 1111
28 # define WXMENU_LAYOUT_RCLICK 1112
29 # define WXMENU_LAYOUT_DBLCLICK 1113
33 # define WXLAYOUT_DEBUG
37 # define WXLO_TRACE(x) wxLogDebug(x)
39 # define WXLO_TRACE(x)
44 #ifndef WXLO_DEFAULTFONTSIZE
45 # define WXLO_DEFAULTFONTSIZE 12
49 /// Types of currently supported layout objects.
50 enum wxLayoutObjectType
52 /// illegal object type, should never appear
53 WXLO_TYPE_INVALID
= 0,
54 /// text object, containing normal text
56 /// command object, containing font or colour changes
58 /// icon object, any kind of image
62 /// Type used for coordinates in drawing. Must be signed.
63 typedef long CoordType
;
65 // Forward declarations.
73 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
75 The wxLayout objects which make up the lines.
77 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
79 /** The base class defining the interface to each object which can be
80 part of the layout. Each object needs to draw itself and calculate
86 /** This structure can be used to contain data associated with the
88 It is refcounted, so the caller has to do a DecRef() on it
93 UserData() { m_refcount
= 1; }
94 void IncRef(void) { m_refcount
++; }
95 void DecRef(void) { m_refcount
--; if(m_refcount
== 0) delete this;}
99 virtual ~UserData() { wxASSERT(m_refcount
== 0); }
100 /// prevents gcc from generating stupid warnings
101 friend class dummy_UserData
;
104 /// return the type of this object
105 virtual wxLayoutObjectType
GetType(void) const { return WXLO_TYPE_INVALID
; }
106 /** Calculates the size of an object.
107 @param dc the wxDC to draw on
109 virtual void Layout(wxDC
&) = 0;
112 @param dc the wxDC to draw on
113 @param coords where to draw the baseline of the object.
115 virtual void Draw(wxDC
& /* dc */, wxPoint
const & /* coords */) { }
117 /** Calculates and returns the size of the object.
118 @param top where to store height above baseline
119 @param bottom where to store height below baseline
120 @return the size of the object's box in pixels
122 virtual wxPoint
GetSize(CoordType
* top
, CoordType
*bottom
) const
123 { *top
= 0; *bottom
= 0; return wxPoint(0,0); }
125 /// Return just the width of the object on the screen.
126 virtual CoordType
GetWidth(void) const { return 0; }
127 /// returns the number of cursor positions occupied by this object
128 virtual CoordType
GetLength(void) const { return 1; }
129 /** Returns the cursor offset relating to the screen x position
130 relative to begin of object.
131 @param dc the wxDC to use for calculations
132 @param xpos relative x position from head of object
133 @return cursor coordinate offset
135 virtual CoordType
GetOffsetScreen(wxDC
&dc
, CoordType xpos
) const { return 0; }
138 wxLayoutObject() { m_UserData
= NULL
; }
139 /// delete the user data
140 virtual ~wxLayoutObject() { if(m_UserData
) m_UserData
->DecRef(); }
142 #ifdef WXLAYOUT_DEBUG
143 virtual void Debug(void);
146 /** Tells the object about some user data. This data is associated
147 with the object and will be deleted at destruction time.
149 void SetUserData(UserData
*data
)
152 m_UserData
->DecRef();
154 m_UserData
->IncRef();
157 /** Return the user data. */
158 void * GetUserData(void) const { if(m_UserData
) m_UserData
->IncRef(); return m_UserData
; }
160 /** Makes a copy of this object.
162 virtual wxLayoutObject
*Copy(void) = 0;
164 /// optional data for application's use
165 UserData
*m_UserData
;
168 /// Define a list type of wxLayoutObject pointers.
169 KBLIST_DEFINE(wxLayoutObjectList
, wxLayoutObject
);
171 /// An illegal iterator to save typing.
172 #define NULLIT (wxLayoutObjectList::iterator(NULL))
173 /// The iterator type.
174 #define wxLOiterator wxLayoutObjectList::iterator
176 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
180 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
181 /** This class implements a wxLayoutObject holding plain text.
183 class wxLayoutObjectText
: public wxLayoutObject
186 wxLayoutObjectText(const wxString
&txt
);
188 virtual wxLayoutObjectType
GetType(void) const { return WXLO_TYPE_TEXT
; }
189 virtual void Layout(wxDC
&dc
);
190 virtual void Draw(wxDC
&dc
, wxPoint
const &coords
);
191 /** Calculates and returns the size of the object.
192 @param top where to store height above baseline
193 @param bottom where to store height below baseline
194 @return the size of the object's box in pixels
196 virtual wxPoint
GetSize(CoordType
* top
, CoordType
*bottom
) const;
197 /// Return just the width of the object on the screen.
198 virtual CoordType
GetWidth(void) const { return m_Width
; }
199 /** Returns the cursor offset relating to the screen x position
200 relative to begin of object.
201 @param dc the wxDC to use for calculations
202 @param xpos relative x position from head of object
203 @return cursor coordinate offset
205 virtual CoordType
GetOffsetScreen(wxDC
&dc
, CoordType xpos
) const;
208 #ifdef WXLAYOUT_DEBUG
209 virtual void Debug(void);
212 virtual CoordType
GetLength(void) const { return strlen(m_Text
.c_str()); }
215 wxString
& GetText(void) { return m_Text
; }
216 void SetText(wxString
const &text
) { m_Text
= text
; }
217 /** Makes a copy of this object.
219 virtual wxLayoutObject
*Copy(void);
222 /// size of the box containing text
223 long m_Width
, m_Height
;
224 /// Height above baseline.
226 /// Height below baseline.
230 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
234 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
235 /** This class implements a wxLayoutObject holding a graphic.
237 class wxLayoutObjectIcon
: public wxLayoutObject
240 wxLayoutObjectIcon(wxBitmap
*icon
);
241 wxLayoutObjectIcon(wxBitmap
const &icon
);
243 ~wxLayoutObjectIcon() { delete m_Icon
; }
245 virtual wxLayoutObjectType
GetType(void) const { return WXLO_TYPE_ICON
; }
246 virtual void Layout(wxDC
&dc
);
247 virtual void Draw(wxDC
&dc
, wxPoint
const &coords
);
249 /** Calculates and returns the size of the object.
250 @param top where to store height above baseline
251 @param bottom where to store height below baseline
252 @return the size of the object's box in pixels
254 virtual wxPoint
GetSize(CoordType
* top
, CoordType
*bottom
) const;
255 /// Return just the width of the object on the screen.
256 virtual CoordType
GetWidth(void) const { return m_Icon
->GetWidth(); }
257 // return a pointer to the icon
258 wxBitmap
*GetIcon(void) const { return m_Icon
; }
259 /** Makes a copy of this object.
261 virtual wxLayoutObject
*Copy(void);
266 /// for export to html:
267 struct wxLayoutStyleInfo
271 family
= -1; // this marks the styleinfo as uninitialised
273 int size
, family
, style
, weight
;
275 unsigned fg_red
, fg_green
, fg_blue
;
276 unsigned bg_red
, bg_green
, bg_blue
;
279 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
283 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
284 /** This class implements a wxLayoutObject holding style change commands.
286 class wxLayoutObjectCmd
: public wxLayoutObject
289 virtual wxLayoutObjectType
GetType(void) const { return WXLO_TYPE_CMD
; }
290 virtual void Layout(wxDC
&dc
);
291 virtual void Draw(wxDC
&dc
, wxPoint
const &coords
);
292 wxLayoutObjectCmd(int size
, int family
, int style
, int weight
,
294 wxColour
const *fg
, wxColour
const *bg
);
295 ~wxLayoutObjectCmd();
296 /** Stores the current style in the styleinfo structure */
297 void GetStyle(wxLayoutStyleInfo
*si
) const;
298 /// return the background colour for setting colour of window
299 wxColour
const *GetBGColour(void) const { return m_ColourBG
; }
300 /** Makes a copy of this object.
302 virtual wxLayoutObject
*Copy(void);
306 /// foreground colour
307 wxColour
const *m_ColourFG
;
308 /// background colour
309 wxColour
const *m_ColourBG
;
312 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
314 The wxLayoutLine object
316 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
318 /** This class represents a single line of objects to be displayed.
319 It knows its height and total size and whether it needs to be
321 It has pointers to its first and next line so it can automatically
322 update them as needed.
328 @param prev pointer to previous line or NULL
329 @param next pointer to following line or NULL
331 wxLayoutLine(wxLayoutLine
*prev
);
332 /** This function inserts a new object at cursor position xpos.
333 @param xpos where to insert new object
334 @param obj the object to insert
335 @return true if that xpos existed and the object was inserted
337 bool Insert(CoordType xpos
, wxLayoutObject
*obj
);
339 /** This function inserts text at cursor position xpos.
340 @param xpos where to insert
341 @param text the text to insert
342 @return true if that xpos existed and the object was inserted
344 bool Insert(CoordType xpos
, wxString text
);
346 /** This function appends an object to the line.
347 @param obj the object to insert
349 void Append(wxLayoutObject
* obj
)
352 m_ObjectList
.push_back(obj
);
353 m_Length
+= obj
->GetLength();
356 /** This function appens the next line to this, i.e. joins the two
359 void MergeNextLine(void);
361 /** This function deletes npos cursor positions from position xpos.
362 @param xpos where to delete
363 @param npos how many positions
364 @return number of positions still to be deleted
366 CoordType
Delete(CoordType xpos
, CoordType npos
);
368 /** This function breaks the line at a given cursor position.
369 @param xpos where to break it
370 @return pointer to the new line object replacing the old one
372 wxLayoutLine
*Break(CoordType xpos
);
374 /** Deletes the next word from this position, including leading
376 This function does not delete over font changes, i.e. a word
377 with formatting instructions in the middle of it is treated as
378 two (three actually!) words. In fact, if the cursor is on a non-text object, that
379 one is treated as a word.
380 @param xpos from where to delete
381 @return true if a word was deleted
383 bool DeleteWord(CoordType npos
);
385 /** Finds a suitable position left to the given column to break the
387 @param column we want to break the line to the left of this
388 @return column for breaking line or -1 if no suitable location found
390 CoordType
GetWrapPosition(CoordType column
);
392 /** Finds the object which covers the cursor position xpos in this
394 @param xpos the column number
395 @param offset where to store the difference between xpos and
397 @return iterator to the object or NULLIT
399 wxLayoutObjectList::iterator
FindObject(CoordType xpos
, CoordType
402 /** Finds the object which covers the screen position xpos in this
404 @param dc the wxDC to use for calculations
405 @param xpos the screen x coordinate
406 @param offset where to store the difference between xpos and
408 @return iterator to the object or NULLIT
410 wxLayoutObjectList::iterator
FindObjectScreen(wxDC
&dc
,
412 CoordType
*offset
) const ;
414 /** Get the first object in the list. This is used by the wxlparser
415 functions to export the list.
416 @return iterator to the first object
418 wxLayoutObjectList::iterator
GetFirstObject(void)
420 return m_ObjectList
.begin();
423 /** Deletes this line, returns pointer to next line.
424 @param update If true, update all following lines.
426 wxLayoutLine
*DeleteLine(bool update
);
428 /**@name Cursor Management */
430 /** Return the line number of this line.
431 @return the line number
433 CoordType
GetLineNumber(void) const { return m_LineNumber
; }
434 /** Return the length of the line.
435 @return line lenght in cursor positions
437 CoordType
GetLength(void) const { return m_Length
; }
440 /**@name Drawing and Layout */
442 /** Draws the line on a wxDC.
443 @param dc the wxDC to draw on
444 @param offset an optional offset to shift printout
446 void Draw(wxDC
&dc
, const wxPoint
&offset
= wxPoint(0,0)) const;
448 /** Recalculates the positions of objects and the height of the
450 @param dc the wxDC to draw on
451 @param cursorPos if not NULL, set cursor screen position in there
452 @param cursorSize if not cursorPos != NULL, set cursor size in there
453 @param cx if cursorPos != NULL, the cursor x position
455 void Layout(wxDC
&dc
,
456 wxPoint
*cursorPos
= NULL
,
457 wxPoint
*cursorSize
= NULL
,
459 /** This function finds an object belonging to a given cursor
460 position. It assumes that Layout() has been called before.
461 @param dc the wxDC to use for calculations
462 @param xpos screen x position
463 @return pointer to the object
465 wxLayoutObject
* FindObjectScreen(wxDC
&dc
, CoordType xpos
);
468 /**@name List traversal */
470 /// Returns pointer to next line.
471 wxLayoutLine
*GetNextLine(void) const { return m_Next
; }
472 /// Returns pointer to previous line.
473 wxLayoutLine
*GetPreviousLine(void) const { return m_Previous
; }
474 /// Sets the link to the next line.
475 void SetNext(wxLayoutLine
*next
)
476 { m_Next
= next
; if(next
) next
->m_Previous
= this; }
477 /// Sets the link to the previous line.
478 void SetPrevious(wxLayoutLine
*previous
)
479 { m_Previous
= previous
; if(previous
) previous
->m_Next
= this; }
482 /// Returns the position of this line on the canvas.
483 wxPoint
GetPosition(void) const { return m_Position
; }
484 /// Returns the height of this line.
485 CoordType
GetHeight(void) const { return m_Height
; }
486 /// Returns the width of this line.
487 CoordType
GetWidth(void) const { return m_Width
; }
488 /** This will recalculate the position and size of this line.
489 If called recursively it will abort if the position of an
490 object is unchanged, assuming that none of the following
491 objects need to move.
492 @param recurse if greater 0 then it will be used as the
493 minimum(!) recursion level, continue with all lines till the end of
494 the list or until the coordinates no longer changed.
496 void RecalculatePositions(int recurse
= 0);
497 /// Recalculates the position of this line on the canvas.
498 wxPoint
RecalculatePosition(void);
500 /// Destructor is private. Use DeleteLine() to remove it.
503 /**@name Functions to let the lines synchronise with each other. */
505 /** Sets the height of this line. Will mark following lines as
507 @param height new height
509 void SetHeight(CoordType height
)
510 { m_Height
= height
; RecalculatePositions(true); }
512 /** Moves the linenumbers one on, because a line has been inserted
514 @param delta either +1 or -1
516 void MoveLines(int delta
)
518 m_LineNumber
+= delta
;
519 if(m_Next
) m_Next
->MoveLines(delta
);
524 CoordType m_LineNumber
;
525 /// The line length in cursor positions.
527 /// The total height of the line.
529 /// The total width of the line on screen.
531 /// The baseline for drawing objects
532 CoordType m_BaseLine
;
533 /// The position on the canvas.
535 /// The list of objects
536 wxLayoutObjectList m_ObjectList
;
537 /// Have we been changed since the last layout?
539 /// Pointer to previous line if it exists.
540 wxLayoutLine
*m_Previous
;
541 /// Pointer to next line if it exists.
542 wxLayoutLine
*m_Next
;
543 /// Just to suppress gcc compiler warnings.
548 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
550 The wxLayoutList object
552 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
553 /** The wxLayoutList is a list of wxLayoutLine objects. It provides a
554 higher level of abstraction for the text and can generally be considered
555 as representing "the text".
566 void Clear(int family
= wxROMAN
,
567 int size
=WXLO_DEFAULTFONTSIZE
,
571 char const *fg
="black",
572 char const *bg
="white");
573 /// Empty: clear the list but leave font settings.
576 /**@name Cursor Management */
578 /** Set new cursor position.
579 @param p new position
580 @return bool if it could be set
582 bool MoveCursorTo(wxPoint
const &p
);
583 /** Move cursor up or down.
585 @return bool if it could be moved
587 bool MoveCursorVertically(int n
);
588 /** Move cursor left or right.
590 @return bool if it could be moved
592 bool MoveCursorHorizontally(int n
);
594 /// Move cursor to end of line.
595 void MoveCursorToEndOfLine(void)
597 wxASSERT(m_CursorLine
);
598 MoveCursorHorizontally(m_CursorLine
->GetLength()-m_CursorPos
.x
);
601 /// Move cursor to begin of line.
602 void MoveCursorToBeginOfLine(void)
603 { MoveCursorHorizontally(-m_CursorPos
.x
); }
605 /// Returns current cursor position.
606 wxPoint
GetCursorPos(void) const { return m_CursorPos
; }
609 /**@name Editing functions.
610 All of these functions return true on success and false on
613 /// Insert text at current cursor position.
614 bool Insert(wxString
const &text
);
615 /// Insert some other object at current cursor position.
616 bool Insert(wxLayoutObject
*obj
);
617 /// Inserts a linebreak at current cursor position.
618 bool LineBreak(void);
619 /** Wraps the current line. Searches to the left of the cursor to
620 break the line. Does nothing if the cursor position is before
621 the break position parameter.
622 @param column the break position for the line, maximum length
623 @return true if line got broken
625 bool WrapLine(CoordType column
);
626 /** This function deletes npos cursor positions.
627 @param npos how many positions
628 @return true if everything got deleted
630 bool Delete(CoordType npos
);
632 /** Delete the next n lines.
633 @param n how many lines to delete
634 @return how many it could not delete
636 int DeleteLines(int n
);
638 /// Delete to end of line.
639 void DeleteToEndOfLine(void)
641 wxASSERT(m_CursorLine
);
642 Delete(m_CursorLine
->GetLength()-m_CursorPos
.x
);
644 /// Delete to begin of line.
645 void DeleteToBeginOfLine(void)
647 wxASSERT(m_CursorLine
);
648 CoordType n
= m_CursorPos
.x
;
649 #ifdef WXLAYOUT_DEBUG
650 wxASSERT(MoveCursorHorizontally(-n
));
652 MoveCursorHorizontally(-n
);
657 /** Delete the next word.
659 void DeleteWord(void)
661 wxASSERT(m_CursorLine
);
662 m_CursorLine
->DeleteWord(m_CursorPos
.x
);
667 /**@name Formatting options */
669 /// sets font parameters
670 void SetFont(int family
, int size
, int style
,
671 int weight
, int underline
,
674 /// sets font parameters, colours by name
675 void SetFont(int family
=-1, int size
= -1, int style
=-1,
676 int weight
=-1, int underline
= -1,
677 char const *fg
= NULL
,
678 char const *bg
= NULL
);
679 /// changes to the next larger font size
680 inline void SetFontLarger(void)
681 { SetFont(-1,(12*m_FontPtSize
)/10); }
682 /// changes to the next smaller font size
683 inline void SetFontSmaller(void)
684 { SetFont(-1,(10*m_FontPtSize
)/12); }
687 inline void SetFontFamily(int family
) { SetFont(family
); }
689 inline void SetFontSize(int size
) { SetFont(-1,size
); }
691 inline void SetFontStyle(int style
) { SetFont(-1,-1,style
); }
693 inline void SetFontWeight(int weight
) { SetFont(-1,-1,-1,weight
); }
694 /// toggle underline flag
695 inline void SetFontUnderline(bool ul
) { SetFont(-1,-1,-1,-1,(int)ul
); }
696 /// set font colours by name
697 inline void SetFontColour(char const *fg
, char const *bg
= NULL
) { SetFont(-1,-1,-1,-1,-1,fg
,bg
); }
699 Returns a pointer to the default settings.
700 This is only valid temporarily and should not be stored
702 @return the default settings of the list
704 wxLayoutObjectCmd
const *GetDefaults(void) const { return m_DefaultSetting
; }
709 /** Draws the complete list on a wxDC.
710 @param dc the wxDC to draw on
711 @param offset an optional offset to shift printout
712 @param top optional y coordinate where to start drawing
713 @param bottom optional y coordinate where to stop drawing
715 void Draw(wxDC
&dc
, const wxPoint
&offset
= wxPoint(0,0),
716 CoordType top
= -1, CoordType bottom
= -1) const;
718 /** Calculates new layout for the list, like Draw() but does not
720 @param dc the wxDC to draw on
721 @param bottom optional y coordinate where to stop calculating
723 void Layout(wxDC
&dc
, CoordType bottom
= -1) const;
725 /** Calculates new sizes for everything in the list, like Layout()
726 but this is needed after the list got changed.
727 @param dc the wxDC to draw on
728 @param bottom optional y coordinate where to stop calculating
730 void Recalculate(wxDC
&dc
, CoordType bottom
= -1) const;
732 /** Returns the size of the list in screen coordinates.
733 The return value only makes sense after the list has been
735 @return a wxPoint holding the maximal x/y coordinates used for
738 wxPoint
GetSize(void) const;
740 /** Returns the cursor position on the screen.
741 @return cursor position in pixels
743 wxPoint
GetCursorScreenPos(void) const
744 { return m_CursorScreenPos
; }
746 /** Draws the cursor.
747 @param active If true, draw a bold cursor to mark window as
749 @param translate optional translation of cursor coords on screen
751 void DrawCursor(wxDC
&dc
,
753 const wxPoint
& translate
= wxPoint(0,0));
755 /** This function finds an object belonging to a given screen
756 position. It assumes that Layout() has been called before.
757 @param pos screen position
758 @param cursorPos if non NULL, store cursor position in there
759 @return pointer to the object
761 wxLayoutObject
* FindObjectScreen(wxDC
&dc
,
763 wxPoint
*cursorPos
= NULL
);
767 /**@name For exporting one object after another. */
769 /** Returns a pointer to the first line in the list. */
770 wxLayoutLine
*GetFirstLine(void)
772 wxASSERT(m_FirstLine
);
778 void InternalClear(void);
780 /// The list of lines.
781 wxLayoutLine
*m_FirstLine
;
782 /**@name Cursor Management */
784 /// Where the text cursor (column,line) is.
786 /// The size of the cursor.
787 wxPoint m_CursorSize
;
788 /// Where the cursor should be drawn.
789 wxPoint m_CursorScreenPos
;
790 /// The line where the cursor is.
791 wxLayoutLine
*m_CursorLine
;
794 /** @name Font parameters. */
796 int m_FontFamily
, m_FontStyle
, m_FontWeight
;
798 bool m_FontUnderline
;
800 wxColour
const * m_ColourFG
;
801 wxColour
const * m_ColourBG
;
802 /// the default setting:
803 wxLayoutObjectCmd
*m_DefaultSetting
;
810 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
812 The wxLayoutPrintout object for printing within the wxWindows print
815 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
816 /** This class implements a wxPrintout for printing a wxLayoutList within
817 the wxWindows printing framework.
819 class wxLayoutPrintout
: public wxPrintout
823 @param llist pointer to the wxLayoutList to be printed
824 @param title title for PS file or windows
826 wxLayoutPrintout(wxLayoutList
*llist
,
827 wxString
const & title
=
828 "wxLayout Printout");
829 /** Function which prints the n-th page.
830 @param page the page number to print
831 @return bool true if we are not at end of document yet
833 bool OnPrintPage(int page
);
834 /** Checks whether page exists in document.
835 @param page number of page
836 @return true if page exists
838 bool HasPage(int page
);
840 /** Gets called from wxWindows to find out which pages are existing.
841 I'm not totally sure about the parameters though.
842 @param minPage the first page in the document
843 @param maxPage the last page in the document
844 @param selPageFrom the first page to be printed
845 @param selPageTo the last page to be printed
847 void GetPageInfo(int *minPage
, int *maxPage
,
848 int *selPageFrom
, int *selPageTo
);
850 /** This little function scales the DC so that the printout has
851 roughly the same size as the output on screen.
852 @param dc the wxDC to scale
853 @return the scale that was applied
855 float ScaleDC(wxDC
*dc
);
858 virtual void DrawHeader(wxDC &dc, wxPoint topleft, wxPoint bottomright, int pageno);
861 /// The list to print.
862 wxLayoutList
*m_llist
;
863 /// Title for PS file or window.
865 /// The real paper size.
866 int m_PageHeight
, m_PageWidth
;
867 /// How much we actually print per page.
868 int m_PrintoutHeight
;
869 /// How many pages we need to print.
871 /// Top left corner where we start printing.