[TOADBase] [Index] [TPen]

Class TPen


File: <toad/pen.hh>

Is used for drawing operations.
Note:
TPen represents a X11 graphic context (GC) and because you can use more than one GC with a single window, the drawing operations aren't part of the window itself.
TPen adds the feature for 2 dimensional translations because it simplifys certain operations with pens a lot. When a new pen is created TPen gets its initial origin from the window.
The fill operations differ from X11 in the way that they fill the whole object while X11 fills the interior. Currently this reduces performance until the handling for foreground (outline) and background (interior) colors is implemented.
The AIX X11 implementation causes some small trouble with the arc and circle operations.
Pen for server-side bitmaps.

Super Classes

TOADBase

Attributes

public _TOAD_DRAWABLE _drawable
public _TOAD_GC f_gc
public _TOAD_GC o_gc
public TRegion *region

Methods

Ascent
public int Ascent()
Ascent of the current font.
ClrClipBox
public void ClrClipBox()
Removes the clipping region.
Note: does this really work?
Descent
public int Descent()
Descent of the current font.
DrawArc
public void DrawArc(int, int, int, int, double, double)
DrawBezier
public void DrawBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
public void DrawBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
public void DrawBezier(const TPoint *points)
public void DrawBezier(const TDPoint *points)
DrawBitmap
public void DrawBitmap(int x, int y, const TBitmap *)
public void DrawBitmap(int x, int y, const TBitmap &)
public void DrawBitmap(int, int, const TBitmap *, int, int, int, int)
public void DrawBitmap(int, int, const TBitmap &, int, int, int, int)
DrawCircle
public void DrawCircle(int x, int y, int w, int h)
DrawLine
public void DrawLine(int x1, int y1, int x2, int y2)
public void DrawLine(const TPoint &a, const TPoint &b)
DrawLines
public void DrawLines(const TPoint *points, int n)
DrawPoint
public void DrawPoint(int x, int y)
DrawPolyBezier
public void DrawPolyBezier(const TPoint *points, int n)
public void DrawPolyBezier(const TPolygon &p)
public void DrawPolyBezier(const TDPoint *points, int n)
public void DrawPolyBezier(const TDPolygon &p)
DrawPolygon
public void DrawPolygon(const TPoint *points, int n)
DrawRectangle
public void DrawRectangle(int x, int y, int w, int h)
public void DrawRectangle(const TRect &r)
public void DrawRectangle(const TRect *r)
DrawString
public void DrawString(int x, int y, const char*, int len)
public void DrawString(int x, int y, const string&)
Draw string `str'. x, y is the upper left coordinate of the string.
DrawString is a little bit slower than FillString.
DrawString16
public void DrawString16(int x, int y, const wchar_t*, int len)
DrawTextWidth
public int DrawTextWidth(int x, int y, const string &text, unsigned width)
Draw string 'str' in multiple lines, reduce spaces between words to one an break lines to fit width. 'str' can contain '\n'.
FillCircle
public void FillCircle(int x, int y, int w, int h)
FillPolyBezier
public void FillPolyBezier(const TPoint *points, int n)
public void FillPolyBezier(const TPolygon &p)
public void FillPolyBezier(const TDPoint *points, int n)
public void FillPolyBezier(const TDPolygon &p)
FillPolygon
public void FillPolygon(const TPoint *points, int n)
FillRectangle
public void FillRectangle(int x, int y, int w, int h)
public void FillRectangle(const TRect &r)
public void FillRectangle(const TRect *r)
FillString
public void FillString(int x, int y, const char*, int len)
public void FillString(int x, int y, const string&)
Experimental
FillString will fill the background with the current back color when drawing the string.
The back color can be set with SetBackColor.
Please note that FillString doesn't support color dithering and will use the nearest color TOAD was able to allocate.
Maybe i'm going to rename this method into `PrintString' since `FillString' is really a very idiotic name.
GetClipBox
public void GetClipBox(TRect*)
Returns the bounding rectangle of the pens current clipping region or the size of the window the pen is related to, when the pen has no clipping region.
Height
public int Height()
Height of the current font.
LineTo
public void LineTo(int x, int y)
public void LineTo(const TPoint &p)
MoveTo
public void MoveTo(int x, int y)
public void MoveTo(const TPoint &p)
OriginX
public int OriginX()
OriginY
public int OriginY()
Poly2Bezier
public static void Poly2Bezier(const TPoint *src, int n, TPolygon &dst)
public static void Poly2Bezier(const TPolygon &p, TPolygon &d)
public static void Poly2Bezier(const TDPoint *src, int n, TDPolygon &dst)
public static void Poly2Bezier(const TDPolygon &p, TDPolygon &d)
SetBackColor
public void SetBackColor(const TColor &)
public void SetBackColor(byte r, byte g, byte b)
Experimental
Sets the background color for `FillString(..)'.
SetClipChildren
public void SetClipChildren(bool)
When true, TPen will not paint inside the child windows of the current window (which is the standard setting) and when false, TPen will use the entire area of the current window for painting including its children.
SetClipRect
public void SetClipRect(const TRect&)
Sets a clipping rectangle.
SetClipRegion
public void SetClipRegion(TRegion*)
You shouldn't call this yourself currently, it's used by TWindow::_DispatchPaintEvent()
SetColor
public void SetColor(const TColor &)
public void SetColor(byte r, byte g, byte b)
public void SetColor(const TRGB &c)
public void SetColor(TColor ::ESystemColor c)
public void SetColor(TColor ::EColor16 c)
Set the line and fill color to color.
SetColorMode
public void SetColorMode(TColor ::EDitherMode)
Select the color dithering mode:
  • TColor::NEAREST
  • TColor::DITHER
SetFillColor
public void SetFillColor(const TColor &)
public void SetFillColor(byte r, byte g, byte b)
Set the fill color to color.
SetFont
public TFont * SetFont(TFont *)
Sets a new font for DrawString and return the old font.
SetLineColor
public void SetLineColor(const TColor &)
public void SetLineColor(byte r, byte g, byte b)
Set the line color to color.
SetLineStyle
public void SetLineStyle(EPenLineStyle)
How to draw lines:
  • TPen::SOLID
  • TPen::DASH
  • TPen::DOT
  • TPen::DASHDOT
  • TPen::DASHDOTDOT
SetLineWidth
public void SetLineWidth(int)
Sets the width of the line for all line drawing operations, eg. DrawLine, DrawRectangle, etc.
Note: there is a difference between 0 and 1, but i have to learn more about it eg. 0 is faster and the like
SetMode
public void SetMode(EPenMode)
Sets the mode for the drawing operations. Possible values are:
  • TPen::NORMAL
  • TPen::XOR
  • TPen::INVERT
SetOrigin
public void SetOrigin(int x, int y)
TPen
public TPen(TBitmap *)
public TPen(TWindow*)
public virtual ~TPen()
public TPen(TWindow *)
Pen for windows
TextWidth
public int TextWidth(const char* string)
public int TextWidth(const char* string, int len)
public int TextWidth(const string&)
Width of 'str' when printed with the current font.
Translate
public void Translate(int dx, int dy)
operator&=
public void operator&=(TRect&)
Adds a clipping rectangle to the pens current clipping region.
Note: when the pen has no clipping region yet, this method doesn't do anything. I guess we will change the behaviour by the time.

This page was generated with Stupid -- Another stupid C++ to HTML generator
Written 1998,99 by The Wizards of Zilog
Copyright © 1998,99 by the TOAD Project