20#if defined(__TRACE) || defined(__WARN)
21# if !defined(OWL_PROFILE_H)
57uint TGadgetWindow::FlatStyle = NonFlatNormal;
64 LOGFONT MakeGadgetWindowFont_(
int pointSize,
bool bold,
bool italic)
68 f.lfHeight = -pointSize *
TScreenDC().GetDeviceCaps(LOGPIXELSY) / 72;
69 f.lfWeight = bold ? FW_BOLD : FW_NORMAL;
70 f.lfItalic = italic ? TRUE : FALSE;
89 :
TFont(MakeGadgetWindowFont_(pointSize, bold, italic))
103 WantTimer(false),TimerID(0), ThemeBackgroundMode(false)
117 Direction = direction;
121#if defined(BI_COMP_GNUC)
126 ShrinkWrapWidth = (
static_cast<int>(Direction)) !=
Horizontal;
127 ShrinkWrapHeight = (
static_cast<int>(Direction)) !=
Vertical;
137 Font->GetTextMetrics(metrics);
138 FontHeight = metrics.tmHeight + metrics.tmExternalLeading;
146 if (Attr.Style & WS_BORDER)
151 SharedCels =
nullptr;
182 for (
TGadget* g = Gadgets; g; g = g->NextGadget())
193 if (idleCount == 0) {
208 for (
TGadget* g = Gadgets; g; g = g->NextGadget())
209 g->IdleAction(idleCount);
252 ShrinkWrapWidth = shrinkWrapWidth;
253 ShrinkWrapHeight = shrinkWrapHeight;
288 if (&gadget == Capture) {
307 while (parent && !frame) {
345 const long unitsPerEM = 8;
347 return int((
long(units) * FontHeight + unitsPerEM / 2) / unitsPerEM);
383 if (ShrinkWrapWidth || ShrinkWrapHeight)
396 if (ShrinkWrapHeight) {
413 if (ShrinkWrapWidth || ShrinkWrapHeight) {
419 if (ShrinkWrapHeight)
451#if defined(BI_COMP_GNUC)
453 if (dir != direction || DirtyLayout) {
454 if (dir != direction) {
456 if ((
static_cast<int>(Direction)) != direction || DirtyLayout) {
460 if ((
static_cast<int>(Direction)) != direction) {
465 int t = Margins.Left; Margins.Left = Margins.Top; Margins.Top = t;
466 t = Margins.Right; Margins.Right = Margins.Bottom; Margins.Bottom = t;
470 bool sww = ShrinkWrapWidth;
471 ShrinkWrapWidth = ShrinkWrapHeight;
472 ShrinkWrapHeight = sww;
474 Direction = direction;
516 ThemeBackgroundMode = enable;
525 return ThemeBackgroundMode;
544 if (width != RowWidth || (rowMargin >= 0 && rowMargin != RowMargin))
548 RowMargin = rowMargin;
566 int left, right, top, bottom;
567 GetMargins(Margins, left, right, top, bottom);
571 rect.right = Attr.W - right;
572 if (Attr.Style & WS_BORDER)
581 rect.bottom = Attr.H - bottom;
582 if (Attr.Style & WS_BORDER)
623 TRect invalidRect(0,0,0,0);
625 for (
TGadget* gadget = Gadgets; gadget; gadget = gadget->Next, i++) {
626 TRect originalBounds = gadget->GetBounds();
628 if (originalBounds != bounds) {
629 gadget->SetBounds(bounds);
631 invalidRect |= originalBounds;
632 invalidRect |= bounds;
643TGadgetWindow::LayoutHorizontally(TLayoutInfo& layout)
648 int leftM, rightM, topM, bottomM;
649 GetMargins(Margins, leftM, rightM, topM, bottomM);
651 layout.DesiredSize =
TSize(0,0);
652 layout.GadgetBounds =
new TRect[NumGadgets];
659 int wideAsPossibleWidth;
660 if (WideAsPossible) {
662 for (
TGadget* gadget = Gadgets; gadget; gadget = gadget->Next) {
663 if (!gadget->WideAsPossible) {
664 TSize desiredSize(0, 0);
666 gadget->GetDesiredSize(desiredSize);
667 width += desiredSize.cx;
671 TPoint spacing(0, 0);
677 wideAsPossibleWidth = std::max(( (innerRect.
Width() - width) /
static_cast<int>(WideAsPossible) ), 0);
680 wideAsPossibleWidth = 0;
693 for (gadget = Gadgets; gadget; gadget = gadget->Next, i++) {
694 TSize desiredSize(0, 0);
695 gadget->GetDesiredSize(desiredSize);
699 layout.GadgetBounds[i].left = desiredSize.cx;
700 layout.GadgetBounds[i].top = desiredSize.cy;
702 h = std::max(h,
static_cast<int>(desiredSize.cy));
708 for (gadget = Gadgets; gadget; gadget = gadget->Next, i++) {
709 TRect bounds = gadget->GetBounds();
713 TSize desiredSize(layout.GadgetBounds[i].left, layout.GadgetBounds[i].top);
716 bounds.top = y + (h - desiredSize.cy) / 2;
717 if (gadget->WideAsPossible)
718 bounds.right = bounds.left + std::max(wideAsPossibleWidth,
static_cast<int>(desiredSize.cx));
720 bounds.right = bounds.left + desiredSize.cx;
721 bounds.bottom = bounds.top + desiredSize.cy;
723 layout.GadgetBounds[i] = bounds;
735 layout.DesiredSize.cx = std::max(
int(bounds.right+rightM),
static_cast<int>(layout.DesiredSize.cx));
736 layout.DesiredSize.cy = std::max(
int(bounds.bottom+bottomM),
static_cast<int>(layout.DesiredSize.cy));
744TGadgetWindow::LayoutVertically(
TLayoutInfo& layout)
749 int leftM, rightM, topM, bottomM;
750 GetMargins(Margins, leftM, rightM, topM, bottomM);
752 layout.DesiredSize =
TSize(0,0);
753 layout.GadgetBounds =
new TRect[NumGadgets];
765 for (gadget = Gadgets; gadget; gadget = gadget->Next, i++) {
766 TSize desiredSize(0, 0);
767 gadget->GetDesiredSize(desiredSize);
771 layout.GadgetBounds[i].left = desiredSize.cx;
772 layout.GadgetBounds[i].top = desiredSize.cy;
774 w = std::max(w,
static_cast<int>(desiredSize.cx));
780 for (gadget = Gadgets; gadget; gadget = gadget->Next, i++) {
781 TRect bounds = gadget->GetBounds();
785 TSize desiredSize(layout.GadgetBounds[i].left, layout.GadgetBounds[i].top);
788 bounds.bottom = bounds.top + desiredSize.cy;
789 bounds.left = x + (w - desiredSize.cx) / 2;
790 bounds.right = bounds.left + desiredSize.cx;
792 layout.GadgetBounds[i] = bounds;
794 y += bounds.Height();
805 layout.DesiredSize.cx =
static_cast<int>(std::max(
int(bounds.right+rightM),
static_cast<int>(layout.DesiredSize.cx)));
806 layout.DesiredSize.cy =
static_cast<int>(std::max(
int(bounds.bottom+bottomM),
static_cast<int>(layout.DesiredSize.cy)));
814void TGadgetWindow::FinishRow(
int istart,
TGadget* rowStart,
TGadget* lastBreak,
821 for (j = istart, g = rowStart; g; g = g->Next, j++) {
822 rowHeight = std::max(rowHeight,
static_cast<int>(layout.GadgetBounds[j].bottom));
826 for (j = istart, g = rowStart; g; g = g->Next, j++) {
828 layout.GadgetBounds[j].top = rowTop + (rowHeight - layout.GadgetBounds[j].bottom) / 2;
829 layout.GadgetBounds[j].bottom = layout.GadgetBounds[j].top + layout.GadgetBounds[j].bottom;
832 layout.DesiredSize.cy = max(
static_cast<LONG
>(layout.GadgetBounds[j].bottom), layout.DesiredSize.cy);
834 layout.DesiredSize.cy = max(layout.GadgetBounds[j].bottom, layout.DesiredSize.cy);
845TGadgetWindow::LayoutRectangularly(
TLayoutInfo& layout)
850 layout.DesiredSize =
TSize(0,0);
851 layout.GadgetBounds =
new TRect[NumGadgets];
854 int leftM, rightM, topM, bottomM;
855 GetMargins(Margins, leftM, rightM, topM, bottomM);
861 int right = RowWidth - rightM;
866 for (gadget = Gadgets; gadget; gadget = gadget->Next) {
868 gadget->GetDesiredSize(desiredSize);
871 right = max(right,
static_cast<int>(x + desiredSize.cx + rightM));
878 bool contRow =
false;
879 bool contBreak =
false;
888 for (gadget = Gadgets; gadget; gadget = gadget->Next, i++) {
889 gadget->SetEndOfRow(
false);
894 gadget->GetDesiredSize(desiredSize);
896 TRect bounds = gadget->GetBounds();
901 bounds.right = bounds.left + desiredSize.cx;
907 bounds.bottom = desiredSize.cy;
912 if ((bounds.right > right || contBreak) &&
913 gadget != rowStart && gadget->IsVisible()) {
915 lastBreak->SetEndOfRow(
true);
919 layout.DesiredSize.cx =
920 std::max((layout.GadgetBounds[iend].right+rightM), layout.DesiredSize.cx);
924 FinishRow(istart, rowStart, lastBreak, y, layout, rowHeight);
926 contRow = lastBreak->IsVisible();
935 rowStart = lastBreak = gadget->Next;
941 layout.GadgetBounds[i] = bounds;
945 if (gadget->IsVisible()) {
946 if (lastBreak->IsVisible()) {
951 else if (!gadget->Next || !gadget->Next->IsVisible()) {
975 layout.DesiredSize.cx =
976 static_cast<int>(std::max(
int(layout.GadgetBounds[iend].right+rightM),
static_cast<int>(layout.DesiredSize.cx)));
980 FinishRow(istart, rowStart,
nullptr, y, layout, rowHeight);
981 layout.DesiredSize.cy += bottomM;
992 LayoutHorizontally(layout);
995 LayoutVertically(layout);
1000 LayoutRectangularly(layout);
1065 gadget.Window =
this;
1074 if (gadget.WideAsPossible)
1088 if (gadget.Window !=
this)
1104 if (gadget.WideAsPossible)
1109 if (&gadget == AtMouse)
1119 gadget.Window =
nullptr;
1120 gadget.Next =
nullptr;
1133 SharedCels = sharedCels;
1182 if ((ShrinkWrapWidth && Attr.W != size.cx) || (ShrinkWrapHeight && Attr.H != size.cy))
1184 if (ShrinkWrapWidth)
1186 if (ShrinkWrapHeight)
1191 SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER);
1215 AtMouse->MouseLeave(0,
TPoint(-1, -1));
1233 if (Tooltip && Tooltip->IsWindow()) {
1234 if (msg.hwnd == *
this ||
IsChild(msg.hwnd)) {
1235 if (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST) {
1236 Tooltip->RelayEvent(msg);
1261 for (
TGadget* g = Gadgets; g; g = g->NextGadget())
1277 if (!(windowPos.flags&SWP_NOSIZE))
1282 Attr.W = windowPos.cx;
1283 Attr.H = windowPos.cy;
1289 if (DirtyLayout || WideAsPossible)
1295 if (ShrinkWrapWidth)
1296 windowPos.cx = Attr.W;
1297 if (ShrinkWrapHeight)
1298 windowPos.cy = Attr.H;
1319 for (
TGadget* gadget = Gadgets; gadget; gadget = gadget->Next) {
1320 if (gadget->GetBounds().Touches(rect)) {
1369#if defined(__TRACE) || defined(__WARN)
1376 bool useDiagColor = iniFile.
GetInt(
_T(
"DiagToolbarBorders")) != 0;
1378 if (useDiagColor && Tooltip && Tooltip->IsWindow()) {
1379 uint count = Tooltip->GetToolCount();
1386 if (Tooltip->EnumTools(--count, ti)) {
1387 dc.
MoveTo(ti.rect.left, ti.rect.top);
1388 dc.
LineTo(ti.rect.right,ti.rect.top);
1389 dc.
LineTo(ti.rect.right,ti.rect.bottom);
1390 dc.
LineTo(ti.rect.left, ti.rect.bottom);
1391 dc.
LineTo(ti.rect.left, ti.rect.top);
1409 if (gadget && (gadget->
GetEnabled() || Capture)) {
1426 if (gadget && (gadget->
GetEnabled() || Capture)){
1456 if (gadget && (gadget->
GetEnabled() || Capture)) {
1476 if (gadget && (gadget->
GetEnabled() || Capture)){
1499 (g->*f)(modKeys, p);
1508 if (gadget != AtMouse)
1556 if (Tooltip->GetHandle())
1557 Tooltip->Activate(enable);
1572 if (Tooltip->GetHandle())
1573 Tooltip->SendMessage(WM_CLOSE);
1582 if(
GetHandle() && !Tooltip->GetHandle()) {
1584 Tooltip->ModifyStyle(0,WS_DISABLED);
1597 TRACEX(OwlCmd, 1,
"TGadgetWindow::EvCommand - id(" <<
id <<
"), ctl("
1598 <<
static_cast<void*
>(hWndCtl) <<
"), code(" << notifyCode <<
")");
1605 if (
Find(eventInfo)) {
1641 return target->
EvCommand(
id, hWndCtl, notifyCode);
1661 if (
Find(eventInfo)) {
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
TCelArray(TBitmap *bmp, int numCels, TSize celSize=TSize(), TPoint offset=TPoint(), int numRows=1, TAutoDelete=AutoDelete)
Constructs a TCelArray from a bitmap by slicing the bitmap into a horizontal array of cels of a speci...
TColor()
Construct a null color.
static const TColor Sys3dFace
The symbolic system color value for the face color of 3-dimensional display elements.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
uint GetId() const
Retrieves the id of the command.
bool GetHandled()
Return true if the command enabler has been handled.
bool IsReceiver(HWND hReceiver)
Returns true if receiver is the same as the message responder originally set up in the constructor.
void SetReceiver(HWND hReceiver)
Sets the receiver for the enabler.
TDC is the root class for GDI DC wrappers.
virtual bool SetViewportOrg(const TPoint &origin, TPoint *oldOrg=nullptr)
Sets this DC's viewport origin to the given origin value, and saves the previous origin in oldOrg.
bool MoveTo(int x, int y)
Moves the current position of this DC to the given x- and y-coordinates or to the given point.
bool GetViewportOrg(TPoint &point) const
The first version sets in the point argument the x- and y-extents (in device-units) of this DC's view...
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 IntersectClipRect(const TRect &rect)
Creates a new clipping region for this DC's window by forming the intersection of the current region ...
int SelectClipRgn(const TRegion ®ion)
Selects the given region as the current clipping region for this DC.
int GetClipRgn(TRegion ®ion) const
Retrieves this DC's current clip-region and, if successful, places a copy of it in the region argumen...
bool LineTo(int x, int y)
Draws a line on this DC using the current pen object.
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
Encapsulates the system font used for a specific GUI element, e.g. icon, caption, menu,...
A nested class, TEventInfo provides specific information about the type of message sent,...
virtual bool Find(TEventInfo &info, TEqualOperator op=0)
Searches the list of response table entries looking for a match.
TResult Dispatch(TEventInfo &info, TParam1, TParam2=0)
Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handl...
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
TFont(HFONT handle, TAutoDelete autoDelete=NoAutoDelete)
TFont encapsulates an HFONT.
Derived from TWindow, TFrameWindow controls such window-specific behavior as keyboard navigation and ...
virtual HWND GetCommandTarget()
Locates and returns the child window that is the target of the command and command enable messages.
TGadgetControl(TWindow *parent=nullptr, TGadget *soleGadget=nullptr, TFont *font=nullptr, TModule *module=nullptr)
Constructs a control out of a gadget.
TGadget is the base class for the following derived gadget classes:
TRect & GetBounds()
Returns the boundary rectangle for the gadget.
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.
virtual void MouseEnter(uint modKeys, const TPoint &point)
Mouse is entering this gadget.
virtual void MouseLeave(uint modKeys, const TPoint &point)
Mouse is leaving this gadget.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
virtual void Created()
This is the virtual called after the window holding a gadget has been created.
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.
TBorderStyle GetBorderStyle() const
Gets the style for the gadget's borders.
@ Plain
Plain window frame.
virtual void LButtonUp(uint modKeys, const TPoint &point)
Releases the mouse capture if TrackMouse is set.
TPlacement
Enumerates the placement of a gadget.
TGadget * GadgetFromPoint(const TPoint &point) const
Returns the gadget that a given window-relative point is in, or 0 if none is found.
virtual void Insert(TGadget &gadget, TPlacement=After, TGadget *sibling=nullptr)
Inserts a Gadget.
virtual void InsertFrom(TGadgetList &list, TPlacement=After, TGadget *sibling=nullptr)
Inserts a list of gadgets.
virtual TGadget * Remove(TGadget &gadget)
Removes (unlinks) a gadget.
Gadget layout information used during the layout process.
TAPointer< TRect > GadgetBounds
TGadgetWindowFont()
Constructs a font based on TDefaultGuiFont.
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
auto IdleAction(long idleCount) -> bool override
During idle time, iterates over the Gadgets invoking their CommandEnable() member function.
void EnableThemeBackground(bool enable=true)
virtual void PaintGadgets(TDC &dc, bool erase, TRect &rect)
Called by Paint to repaint all of the gadgets, PaintGadgets iterates through the list of gadgets,...
bool IsBackgroundThemed() const
~TGadgetWindow() override
Destructs this gadget window.
void Insert(TGadget &, TPlacement=After, TGadget *sibling=nullptr) override
Inserts a gadget before or after a sibling gadget (TPlacement).
void EnableTooltip(bool enable=true) override
int LayoutUnitsToPixels(int units)
Converts layout units to pixels.
void SetHintCommand(int id)
(id <= 0) to clear
void EvMouseMove(uint modKeys, const TPoint &point)
Forward mouse moves to the gadget that has captured the mouse, if any.
void SetupWindow() override
Overrides TWindow::SetupWindow to create tooltips for the gadget window.
bool EvWindowPosChanging(WINDOWPOS &windowPos)
Intercepts window size changes to make sure that this gadget window follows its own sizing rules.
bool EnableTimer()
Inform GadgetWindow to start a Timer notification.
@ FlatDefault
System automatically select apropriated style.
@ FlatXPTheme
Windows XP theme styles.
@ FlatGrayButtons
Adds Gray buttons effect to FlatStandard.
@ FlatSingleDiv
Adds single divider ala IE 4.01.
@ FlatHotText
Adds hot text effect like.
@ FlatStandard
Flat style IE 3.0 - base style.
void EvRButtonUp(uint modKeys, const TPoint &point)
Pass RButton messages to the gadget at the mouse location or the one with capture.
void Inserted(TGadget &) override
A gadget has been inserted into this gadget window.
void CleanupWindow() override
virtual TRect TileGadgets()
Tiles the Gadgets in the current direction.
void EvSysColorChange()
Responds to WM_SYSCOLORCHANGE to let the gadgets update their UI colors, and to let this gadget windo...
void SetMargins(const TMargins &margins)
Sets or changes the margins for the gadget window and calls LayoutSession().
void EvLButtonDown(uint modKeys, const TPoint &point)
Responds to a left button-down mouse message by forwarding the event to the gadget (if it is enabled)...
void UseDesiredSize()
Updates the Size in Attr.W and Attr.H to match that obtained using GetDesiredSize() for each dimensio...
virtual void SetCelArray(TCelArray *sharedCels)
Sets a new Shared CelArray for this gadget window.
void EvCommandEnable(TCommandEnabler &) override
When the gadget window receives a WM_COMMAND_ENABLE message, it is likely from a gadget or control wi...
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
When the gadget window receives a WM_COMMAND message, it is likely from a gadget or control within a ...
void SetTooltip(TTooltip *tooltip)
Sets the Tooltip data member equal to tooltip.
void EvLButtonUp(uint modKeys, const TPoint &point)
Responds to a left button-up mouse message by forwarding the event to the gadget that has the capture...
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.
virtual void GetDesiredSize(TSize &size)
Get the desired size for this gadget window by performing a trial layout of the gadgets without touch...
static void EnableFlatStyle(uint style=FlatDefault)
Set flat style options, or disable it.
virtual void GetInnerRect(TRect &rect)
GetInnerRect computes the rectangle inside of the borders and margins of the gadget.
void SetRectangularDimensions(int width, int height, int rowMargin=-1)
Sets the maximum width for each row used for rectangular layout.
void SetShrinkWrap(bool shrinkWrapWidth, bool shrinkWrapHeight)
Sets the width and height of the data members.
bool IsThemeBackgroundEnabled() const
void InsertFrom(TGadgetList &, TPlacement=After, TGadget *sibling=nullptr) override
Inserts a list of Gadgets.
void Removed(TGadget &) override
This indicates that a gadget has been removed from this gadget window.
void EvRButtonDown(uint modKeys, const TPoint &point)
Pass RButton messages to the gadget at the mouse location or the one with Capture.
void EvLButtonDblClk(uint modKeys, const TPoint &point)
Passes double clicks through as if they were just a second click; finishes the first click,...
virtual TCelArray & GetCelArray(int minX=0, int minY=0)
Gets the Shared CelArray for this gadget window.
TGadgetWindow(TWindow *parent=nullptr, TTileDirection direction=Horizontal, TFont *font=nullptr, TModule *module=nullptr)
Creates a TGadgetWindow interface object with the default tile direction and font and passes module w...
bool PreProcessMsg(MSG &msg) override
Relays 'interesting' messages to the tooltip window.
virtual void PositionGadget(TGadget *previous, TGadget *next, TPoint &point)
Virtual called by TileGadgets() for each gadget in order to give derived classes a chance to modify t...
virtual void SetDirection(TTileDirection direction)
Sets the horizontal or vertical orientation of the gadgets.
virtual void LayoutSession()
LayoutSession is typically called when a change occurs in the size of the margins or gadgets,...
TTileDirection
Enumeration describing how gadgets should be laid out within the gadget window.
@ Vertical
Arrange gadgets in a column.
@ Rectangular
Arrange gadgets in rows and columns (2-D grid).
@ Horizontal
Arrange gadgets in a row.
void GadgetReleaseCapture(TGadget &gadget)
Releases the capture so that other windows can receive mouse messages.
@ PressHints
Hints when a button is pressed.
virtual void LayoutGadgets(TTileDirection dir, TLayoutInfo &layout)
Calculate the layout of the Gadgets in a given direction.
void Paint(TDC &, bool erase, TRect &) override
Puts the font into the device context and calls PaintGadgets.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPen is derived from TGdiObject.
TPoint is a support class, derived from tagPOINT.
TPoint()
Constructs an uninitialized point.
An instance of TProfile encapsulates a setting within a system file, often referred to as a profile o...
int GetInt(LPCTSTR key, int defaultInt=0)
Looks up and returns the integer value associated with the given string, key.
TRect is a mathematical class derived from tagRect.
const TPoint & TopLeft() const
Returns the upperleft point.
int Width() const
Returns the width of this rectangle (right - left).
TRegion, derived from TGdiObject, represents GDI abstract shapes or regions.
The tagSIZE struct is defined as.
int Y() const
Returns the height.
TSize()
Default constructor that does nothing.
int X() const
Returns the width.
static TThemeModule & GetInstance()
Returns the module instance.
TModuleProc0< BOOL > IsAppThemed
Encapsulates a themed part.
void DrawBackground(HDC, const TRect &dest)
Paints the background of the themed part.
static const TUIMetric CyBorder
static const TUIMetric CxBorder
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
static void GetCursorPos(TPoint &pos)
Retrieves the cursor's current position (in window screen coordinates) and copies the values into the...
bool EvEraseBkgnd(HDC)
Handler for WM_ERASEBKGND.
HWND SetCapture()
Sets the mouse capture to the current window.
void EvLButtonUp(uint modKeys, const TPoint &point)
The default message handler for WM_LBUTTONUP.
bool KillTimer(UINT_PTR timerId)
Gets rid of the timer and removes any WM_TIMER messages from the message queue.
bool EvWindowPosChanging(WINDOWPOS &)
The default message handler for WM_WINDOWPOSCHANGING.
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
void EvRButtonDown(uint modKeys, const TPoint &point)
The default message handler for WM_RBUTTONDOWN.
static HWND WindowFromPoint(const TPoint &point)
Returns the handle of the window in which the specified point (point) lies.
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
bool SetWindowPos(HWND hWndInsertAfter, const TRect &rect, uint flags)
Changes the size of the window pointed to by rect.
virtual void EvCommandEnable(TCommandEnabler &ce)
Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-h...
virtual bool PreProcessMsg(MSG &msg)
Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing ...
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
virtual void InvalidateRect(const TRect &rect, bool erase=true)
Invalidates a specified client area.
void Init(TWindow *parent, LPCTSTR title, TModule *module)
Normal initialization of a default constructed TWindow.
void EvRButtonUp(uint modKeys, const TPoint &point)
The default message handler for WM_RBUTTONUP.
TWindow * GetParentO() const
Return the OWL's parent for this window.
static void ReleaseCapture()
Releases the mouse capture from this window.
bool IsWindow() const
Returns true if an HWND is being used.
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
virtual void CleanupWindow()
Always called immediately before the HWindow becomes invalid, CleanupWindow gives derived classes an ...
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
void EvLButtonDown(uint modKeys, const TPoint &point)
Response method for an incoming WM_LBUTTONDOWN message.
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
virtual bool IdleAction(long idleCount)
Called when no messages are waiting to be processed, IdleAction performs idle processing as long as t...
UINT_PTR SetTimer(UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
Creates a timer object associated with this window.
virtual TResult EvCommand(uint id, HWND hWndCtl, uint notifyCode)
WindowProc calls EvCommand to handle WM_COMMAND messages.
bool PostMessage(TMsgId, TParam1=0, TParam2=0)
Posts a message (msg) to the window in the application's message queue.
void EvMouseMove(uint modKeys, const TPoint &point)
The default message handler for WM_MOUSEMOVE.
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
bool IsFlagSet(uint mask)
Returns the state of the bit flag in Attr.Flags whose mask is supplied.
void GetClientRect(TRect &rect) const
Gets the coordinates of the window's client area and then copies them into the object referred to by ...
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
Definition of classes for CommonControl encapsulation.
Definition of class TDecoratedFrame, a TFrameWindow that can manage decorations around the client win...
#define WM_COMMAND_ENABLE
#define WM_OWLCREATETTIP
Notify gadget window to create tooltips.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of class TFrameWindow.
Base class TGadget and simple derived TSeparatorGadget.
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
@ wfMainWindow
This frame window is the main window.
Object Windows Library (OWLNext Core).
const uint GadgetWindowTimerID
LPARAM TParam2
Second parameter type.
auto GetCommCtrlVersion() -> DWORD
Returns the version number of the Common Control library (ComCtl32.dll).
TParam2 MkParam2(const T1 &lo, const T2 &hi)
LRESULT TResult
Result type.
const uint GadgetWindowTimeOut
DIAG_DEFINE_GROUP_INIT(OWL_INI, OwlApp, 1, 0)
DIAG_DECLARE_GROUP(OwlThread)
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of TProfile class.
Used by the TGadgetWindow and TGadget classes, TMargins contains the measurements of the margins for ...
Microsoft UxTheme Library Encapsulation.
Definition of TUIMetric, a UI metrics provider class.