43predefinedGadgetId(
int id)
91 Bounds =
TRect(0, 0, 0, 0);
92 Flags = Enabled | Visible;
94 MouseInGadget =
false;
96 WideAsPossible =
false;
97 ShrinkWrapWidth = ShrinkWrapHeight =
true;
181 Bounds.right = Bounds.left + size.cx;
182 Bounds.bottom = Bounds.top + size.cy;
213 if (
rect != Bounds) {
255 switch (BorderStyle) {
314 if (!predefinedGadgetId(Id)) {
345 if (!predefinedGadgetId(Id)) {
369 if (!predefinedGadgetId(Id)) {
374 ti.SetToolInfo(*Window, Id);
396 rect.right + Bounds.left,
rect.bottom + Bounds.top);
434 if (BorderStyle !=
None) {
439 if (BorderStyle ==
Plain) {
487 size.cx = ShrinkWrapWidth ? left+right : Bounds.
Width();
488 size.cy = ShrinkWrapHeight ? top+bottom : Bounds.
Height();
502 Window->
GetMargins(Margins, left, right, top, bottom);
545 MouseInGadget =
true;
584 hwnd = GetDesktopWindow();
597 MouseInGadget =
false;
658 ShrinkWrapWidth = ShrinkWrapHeight =
false;
667 Bounds.bottom = size;
763 size.cx = size.cy = 0;
767 int id =
gadg->GetId();
#define PRECONDITION(condition)
The GDI Brush class is derived from TGdiObject.
static const TColor SysWindowFrame
The symbolic system color value for the frame around each window.
TDC is the root class for GDI DC wrappers.
bool DPtoLP(TPoint *points, int count=1) const
Converts each of the count points in the points array from device points to logical points.
void RestoreBrush()
Restores the original GDI brush object to this DC.
void OWLFastWindowFrame(TBrush &brush, TRect &r, int xWidth, int yWidth, uint32 rop=PATCOPY)
Draws a frame of the specified size and thickness with the given brush.
TFlatHandleGadget(int id=IDG_FLATHANDLE)
virtual void Paint(TDC &dc)
virtual void GetDesiredSize(TSize &size)
TGadget is the base class for the following derived gadget classes:
virtual void RButtonUp(uint modKeys, const TPoint &point)
virtual void LButtonDown(uint modKeys, const TPoint &point)
Captures the mouse if TrackMouse is set.
virtual void RButtonDown(uint modKeys, const TPoint &point)
virtual void MouseMove(uint modKeys, const TPoint &point)
Mouse is moving over this gadget.
void GetOuterSizes(int &left, int &right, int &top, int &bottom)
Get the four total outer sizes in pixels which consists of the margins plus the borders.
virtual void MouseEnter(uint modKeys, const TPoint &point)
Mouse is entering this gadget.
void SetBorders(const TBorders &borders)
Sets the borders for the gadget.
virtual void Paint(TDC &dc)
Calls PaintBorder() to paint the indicated device context.
void SetSize(const TSize &size)
Alters the size of the gadget and then calls TGadgetWindow::GadgetChangedSize() for the size change t...
void Invalidate(bool erase=true)
Used to invalidate the active (usually nonborder) portion of the gadget, Invalidate calls InvalidateR...
void GetInnerRect(TRect &rect)
Computes the area of the gadget's rectangle excluding the borders and margins.
virtual bool IdleAction(long idleCount)
Called during idle time to allow the gadget to perform any idle actions.
bool IsWindowVisible() const
check to see if the button's created
virtual void MouseLeave(uint modKeys, const TPoint &point)
Mouse is leaving this gadget.
TGadget(int id=0, TBorderStyle borderStyle=None)
Construct a gadget with a given id and border style.
void SetMargins(const TMargins &margins)
Sets the margins of the gadget.
virtual bool PtIn(const TPoint &point)
Default behavior returns true if the point is within the receiver's bounding rect.
virtual void CommandEnable()
Provided so that the gadget can perform command enabling (so it can handle an incoming message if it'...
void InvalidateRect(const TRect &rect, bool erase=true)
Invalidate a rectangle in our containing window.
bool IsVisible() const
Returns true if the gadget is visible.
TGadgetWindow * GetGadgetWindow()
Return a pointer to the owning or parent window for the gadget.
virtual void Moved()
This is the virtual called when a gadget is relocated.
virtual void SetBounds(const TRect &rect)
Called by the gadget window to inform the gadget of a change in its bounding rectangle.
virtual void Created()
This is the virtual called after the window holding a gadget has been created.
void SetShrinkWrap(bool shrinkWrapWidth, bool shrinkWrapHeight)
Simple set accessor to set whether shrinkwrapping is performed horizontally and/or vertically.
virtual void Removed()
Virtual called after a gadget is removed from a window.
virtual void Inserted()
Called after a gadget is inserted into a window.
virtual void SysColorChange()
Called when the system colors have been changed so that gadgets can rebuild and repaint,...
TBorderStyle
Gadget border styles.
@ Embossed
Painted with an embossed border.
@ WndRecessed
Input field and other window are recessed.
@ Recessed
Recessed into the window.
@ None
No border painted at all.
@ WndRaised
Inner and outer edge of the window are raised.
@ ButtonUp
Button in up position.
@ Plain
Plain window frame.
@ Grooved
Grouping groove.
@ Raised
Raised above the gadget window.
@ ButtonDn
Button in down position.
virtual void SetEnabled(bool enabled)
Enables or disables keyboard and mouse input for the gadget.
virtual void SetVisible(bool visible)
Changes the visibility of the gadget.
void Update()
Paint now if possible.
virtual void GetDesiredSize(TSize &size)
Request by the gadget window to query the gadget's desired size.
virtual void PaintBorder(TDC &dc)
Self sent by method Paint().
virtual void LButtonUp(uint modKeys, const TPoint &point)
Releases the mouse capture if TrackMouse is set.
virtual ~TGadget()
Destroys a TGadget interface object and removes it from its associated window.
void SetBorderStyle(TBorderStyle bs)
Set the border style used by this gadget.
TGadget * NextGadget(TGadget &gadget) const
Returns the next gadget in the list relative to a given gadget.
static uint GetFlatStyle()
Returns the flat style.
@ FlatSingleDiv
Adds single divider ala IE 4.01.
@ FlatStandard
Flat style IE 3.0 - base style.
void GadgetChangedSize(TGadget &gadget)
Used to notify the gadget window that a gadget has changed its size, GadgetChangedSize calls LayoutSe...
auto Remove(TGadget &) -> TGadget *override
Removes a gadget from the gadget window.
bool GadgetSetCapture(TGadget &gadget)
Called by a gadget that wants to capture the mouse.
auto GetTooltip() const -> TTooltip *override
Returns Tooltip.
@ Vertical
Arrange gadgets in a column.
@ Rectangular
Arrange gadgets in rows and columns (2-D grid)
@ Horizontal
Arrange gadgets in a row.
TTileDirection GetDirection() const
Returns the direction of tiling for this gadget window.
void GadgetReleaseCapture(TGadget &gadget)
Releases the capture so that other windows can receive mouse messages.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
int Width() const
Returns the width of this rectangle (right - left).
TSeparatorGadget is a simple class you can use to create a separator between gadgets.
TSeparatorGadget(int size=0, int id=0, bool showseparator=true)
Used for both the width and the height of the separator, the default size is TUIMetric::CxSizeFrame t...
void Inserted()
This is an overridden virtual, called after a gadget is inserted into a window.
void Paint(TDC &dc)
Draws the resize gadget.
TSizeGripGadget(int id=IDG_SIZEGRIP)
Constructs a gadget that can be grabbed to resize the frame.
The tagSIZE struct is defined as.
Encapsulates a themed part.
Assists in drawing borders of many styles.
@ RaisedInner
Raised inner edge only.
@ SunkenOuter
Sunken outer edge only.
void Paint(TDC &dc) const
Paints this UIBorder object onto a given device context.
TStyle
Enumeration describing hilevel border styles.
@ Recessed
Status field style recessed.
@ Embossed
Grouping raised emboss bead.
static bool DrawEdge(TDC &dc, const TRect &frame, uint edge, uint flags)
This is a static function that performs the actual drawing of edges for a UIBorder or an external cli...
TUIMetric encapsulates the GetSystemMetric() API.
static const TUIMetric CyBorder
static const TUIMetric CxBorder
static const TUIMetric CySizeFrame
static const TUIMetric CxSizeFrame
Encapsulates the DrawFrameControl 32-bit API.
@ ScrollSizeGrip
Size grip in bottom-right corner of window.
@ uiScroll
Draw a scroll bar glyph.
virtual void InvalidateRect(const TRect &rect, bool erase=true)
Invalidates a specified client area.
void UpdateWindow()
Updates the client area of the specified window by immediately sending a WM_PAINT message.
bool IsWindowVisible() const
Returns true if the window is visible.
void GetClientRect(TRect &rect) const
Gets the coordinates of the window's client area and then copies them into the object referred to by ...
HWND GetHandle() const
Returns the handle of the window.
Definition of class TFrameWindow.
Base class TGadget and simple derived TSeparatorGadget.
#define IDG_LAST
last predefined gadget ID
#define IDG_FLATHANDLE
The ID for a flat bar handle.
#define IDG_FIRST
first predefined gadget ID
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Object Windows Library (OWLNext Core)
uint32 MkUint32(uint16 lo, uint16 hi)
const int DefaultGripSize
General definitions used by all ObjectWindows programs.
Used by the TGadgetWindow and TGadget classes, TMargins contains the measurements of the margins for ...
void GetPixels(int &left, int &right, int &top, int &bottom, int fontHeight) const
Microsoft UxTheme Library Encapsulation.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of TUIMetric, a UI metrics provider class.