11#if defined(BI_MULTI_THREAD_RTL)
21#if defined(BI_MULTI_THREAD_RTL)
25 THatchBrush():Brush(THatch8x8Brush::Hatch13F1)
33#if defined(BI_MULTI_THREAD_RTL)
41static THatchBrush& GetHatchBrush()
43#if defined(BI_MULTI_THREAD_RTL)
44 static TTlsContainer<THatchBrush> hatchBrush;
45 return hatchBrush.Get();
47 static THatchBrush hatchBrush;
57 THatchBrush& InitHashBrush = GetHatchBrush();
60#if defined(BI_MULTI_THREAD_RTL)
74 HandleBox(thickness, thickness)
93 Frame.Offset(x-Frame.left, y-Frame.top);
103 Frame.right = Frame.left + w;
104 Frame.bottom = Frame.top + h;
151 TPoint halfHandle(HandleBox.x/2, HandleBox.y/2);
152 if (point.x < insideFrame.left)
154 else if (point.x >= insideFrame.right)
157 int center = insideFrame.left + insideFrame.
Width()/2;
158 if (point.x >= center-halfHandle.x && point.x <= center+halfHandle.x)
163 if (point.y < insideFrame.top)
165 else if (point.y >= insideFrame.bottom)
168 int middle = insideFrame.top + insideFrame.
Height()/2;
169 if (point.y >= middle-halfHandle.y && point.y <= middle+halfHandle.y)
186 static uint16 cursorId[] = {
195 return cursorId[where];
233 int center = outerRect.
Width()/2 - grappleBox.x/2;
234 int middle = outerRect.
Height()/2 - grappleBox.y/2;
239 const uint32 rop = DSTINVERT;
240 dc.
PatBlt(outerRect.left, outerRect.top,
241 grappleBox.x, grappleBox.y, rop);
242 dc.
PatBlt(outerRect.left+center, outerRect.top,
243 grappleBox.x, grappleBox.y, rop);
244 dc.
PatBlt(outerRect.right-HandleBox.x, outerRect.top,
245 grappleBox.x, grappleBox.y, rop);
247 dc.
PatBlt(outerRect.left, outerRect.top+middle,
248 grappleBox.x, grappleBox.y, rop);
249 dc.
PatBlt(outerRect.right-HandleBox.x, outerRect.top+middle,
250 grappleBox.x, grappleBox.y, rop);
252 dc.
PatBlt(outerRect.left, outerRect.bottom-HandleBox.y,
253 grappleBox.x, grappleBox.y, rop);
254 dc.
PatBlt(outerRect.left+center, outerRect.bottom-HandleBox.y,
255 grappleBox.x, grappleBox.y, rop);
256 dc.
PatBlt(outerRect.right-HandleBox.x, outerRect.bottom-HandleBox.y,
257 grappleBox.x, grappleBox.y, rop);
263 const uint32 rop = PATINVERT;
267 int center2 = outerRect.
Width() - center - grappleBox.x;
268 int middle2 = outerRect.
Height() - middle - grappleBox.y;
270 dc.
PatBlt(outerRect.left+grappleBox.x, outerRect.top,
271 center-grappleBox.x, HandleBox.y, rop);
272 dc.
PatBlt(outerRect.left+center+grappleBox.x, outerRect.top,
273 center2-grappleBox.x, HandleBox.y, rop);
275 dc.
PatBlt(outerRect.left, outerRect.top+HandleBox.y,
276 HandleBox.x, middle-HandleBox.y, rop);
277 dc.
PatBlt(outerRect.left, outerRect.top+middle+grappleBox.y,
278 HandleBox.x, middle2-HandleBox.y, rop);
280 dc.
PatBlt(outerRect.right-HandleBox.x, outerRect.top+HandleBox.y,
281 HandleBox.x, middle-HandleBox.y, rop);
282 dc.
PatBlt(outerRect.right-HandleBox.x, outerRect.top+middle+grappleBox.y,
283 HandleBox.x, middle2-HandleBox.y, rop);
285 dc.
PatBlt(outerRect.left+grappleBox.x, outerRect.bottom-HandleBox.y,
286 center-grappleBox.x, HandleBox.y, rop);
287 dc.
PatBlt(outerRect.left+center+grappleBox.x, outerRect.bottom-HandleBox.y,
288 center2-grappleBox.x, HandleBox.y, rop);
291 dc.
PatBlt(outerRect, rop);
The GDI Brush class is derived from TGdiObject.
static const TColor White
Static TColor object with fixed Value set by RGB(255, 255, 255).
static const TColor Black
Static TColor object with fixed Value set by RGB(0, 0, 0).
TDC is the root class for GDI DC wrappers.
bool FrameRect(int x1, int y1, int x2, int y2, const TBrush &brush)
Draws a border on this DC around the given rectangle, rect, using the given brush,...
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
void RestorePen()
Restores the original GDI pen object to this DC.
int SetROP2(int mode)
Sets the current foreground mix mode mode of this DC to the given mode value and returns the previous...
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
bool Rectangle(int x1, int y1, int x2, int y2)
Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
void RestoreBrush()
Restores the original GDI brush object to this DC.
virtual void SelectStockObject(int index)
Selects into the DC a predefined stock pen, brush, font, or palette.
bool PatBlt(int x, int y, int w, int h, uint32 rop=PATCOPY)
int GetROP2() const
Returns the current drawing (raster operation) mode of this DC.
TPen is derived from TGdiObject.
TPoint is a support class, derived from tagPOINT.
TPoint()
Constructs an uninitialized point.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
TRect InflatedBy(int dx, int dy) const
Returns a rectangle inflated by the given delta arguments.
TRect & Inflate(int dx, int dy)
Inflates a rectangle inflated by the given delta arguments.
int Width() const
Returns the width of this rectangle (right - left).
bool Contains(const TPoint &point) const
Returns true if the given point lies within this rectangle; otherwise, it returns false.
void Paint(TDC &dc) const
Paints the TUIHandle object onto the specified device context, dc.
void MoveTo(int x, int y)
Moves the rectangle to the given x and y coordinates.
static uint16 GetCursorId(TWhere where)
Helper function to convert a where code into a cursor shape Id.
TWhere
Enumeration describing the location of a grapple selection.
@ Outside
Hit completely outside the object.
@ MidCenter
Somewhere inside the rectangle.
@ Inside
Hit inside object, not on handles, & InsideSpecial is set.
void Size(int w, int h)
Sets the size of the rectangle according to the measurements specified in w, the width,...
TUIHandle(const TRect &frame, uint style=HandlesIn|Grapples|HatchBorder, int thickness=5)
Constructs a TUIHandle object for the specified frame, with eight grapples drawn in a hatched border ...
void Move(int dx, int dy)
Moves the rectangle relative to the values specified in dx and dy.
TRect GetBoundingRect() const
Calculate the outside frame rectangle.
@ Grapples
Eight grapple boxes are drawn.
@ DashFramed
Frame rect is drawn dashed.
@ HandlesOut
Handles on the outside of the rectangle.
@ HatchRect
Whole rect drawn hatched.
@ HatchBorder
Border handle area drawn hatched.
@ Framed
Frame rect is drawn solid.
@ InsideSpecial
Inside area hit-tested independently.
TWhere HitTest(const TPoint &point) const
Compares a given point (point) to various parts of the rectangle.
Definition of abstract GDI object class and derived classes.
Object Windows Library (OWLNext Core).
General definitions used by all ObjectWindows programs.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.