41inline int F2Arr(
int arrow,
int width)
43 return arrow == -1 ? width*1/4 : arrow;
46inline int Arr2F(
int arrow,
int width)
48 return arrow == -1 ? width*1/3 : arrow;
73 TPopupGuard(
const TPopupGuard&) =
delete;
74 TPopupGuard(TPopupGuard&&) =
delete;
75 auto operator =(
const TPopupGuard&) -> TPopupGuard& =
delete;
76 auto operator =(TPopupGuard&&) -> TPopupGuard& =
delete;
78 static auto IsPopupActive() ->
bool {
return Flag;}
86bool TPopupGuard::Flag =
false;
96 bool sharedGlyph,
uint numChars)
99 sharedGlyph, numChars),
135 int arrowwidth = F2Arr(
ArrowWidth, Bounds.Width());
139 Bounds.right -= arrowwidth;
144 Bounds.right += arrowwidth;
146 TRect faceRect, textRect, btnRect;
150 faceRect.right -= arrowwidth;
152 Layout(faceRect, textRect, btnRect);
160 faceRect.right += arrowwidth;
178 boundsRect.left = boundsRect.right - F2Arr(
ArrowWidth, Bounds.Width());
205 TUIBorder(boundsRect, edgeStyle).Paint(dc);
228 TPoint dstPt(innerRect.right - F2Arr(
ArrowWidth,Bounds.Width())/2 - (flat?1:2),
229 innerRect.top + (innerRect.
Height()-4)/2);
241 dc.
MoveTo(dstPt.x, dstPt.y);
242 dc.
LineTo(dstPt.x+5, dstPt.y);
243 dc.
MoveTo(dstPt.x+1, dstPt.y+1);
244 dc.
LineTo(dstPt.x+4, dstPt.y+1);
245 dc.
SetPixel(dstPt.x+2, dstPt.y+2, col);
262 if (TPopupGuard::IsPopupActive())
return;
275 Bounds.right-Bounds.left,Bounds.bottom-Bounds.top).Contains(p)){
298 if (TPopupGuard::IsPopupActive())
return;
309 if (TPopupGuard::IsPopupActive())
return;
321 if (TPopupGuard::IsPopupActive())
return;
329 if (TPopupGuard::IsPopupActive())
return;
374 bool enabled,
TState state,
bool sharedGlyph,
uint numChars)
377 sharedGlyph, numChars),
400 Window->ClientToScreen(p1);
403 Window->ClientToScreen(p2);
405 tpm.cbSize =
sizeof(TPMPARAMS);
406 tpm.rcExclude.top = p1.y;
407 tpm.rcExclude.left = 0;
408 tpm.rcExclude.bottom = p2.y;
409 tpm.rcExclude.right = 32000;
412 if(!IsWindow(Window->GetHandle()))
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
virtual void Layout(TRect &srcRect, TRect &textRect, TRect &btnRect)
Layout button and text in the control area.
virtual void SetBounds(const TRect &rect)
If (Style & sBitmap) calls TButtonGadget::SetBounds; otherwise calls TGadget::SetBounds to set the bo...
TStyle
TStyle contains values that defines how gadget will be displayed:
@ sBitmap
Only the bitmap is displayed.
@ sText
Only text is displayed.
virtual void PaintText(TDC &dc, TRect &rect, const tstring &text)
Paint Text.
TButtonTextGadget(int id, TResId glyphResIdOrIndex, TStyle style=sBitmapText, TType type=Command, bool enabled=false, TState state=Up, bool sharedGlyph=false, uint numChars=4)
Constructs a TButtonTextGadget object using the specified bitmap ID, button gadget ID,...
virtual void GetDesiredSize(TSize &size)
Calls TButtonGadget::GetDesiredSize if (Style & sBitmap); calls TGadget::GetDesiredSize and adds the ...
Class wrapper for management of color values.
static const TColor SysBtnText
The symbolic system color value for the text on buttons.
static const TColor Sys3dHilight
The symbolic system color value for highlighted 3-dimensional display elements (for edges facing the ...
static const TColor Sys3dShadow
The symbolic system color value for the shadow regions of 3-dimensional display elements (for edges f...
TDC is the root class for GDI DC wrappers.
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.
TColor SetPixel(int x, int y, const TColor &color)
Sets the color of the pixel at the given location to the given color and returns the pixel's previous...
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.
bool LineTo(int x, int y)
Draws a line on this DC using the current pen object.
bool IsHaveMouse() const
Return true if mouse inside gadget.
TRect & GetBounds()
Returns the boundary rectangle for the gadget.
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.
void SetInMouse(bool state)
Sets if mouse inside gadget or not.
TGadgetWindow * GetGadgetWindow()
Return a pointer to the owning or parent window for the gadget.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
void Update()
Paint now if possible.
TGadget * GadgetGetCaptured()
Retrieves gadget with capture.
static uint GetFlatStyle()
Returns the flat style.
@ FlatXPTheme
Windows XP theme styles.
@ FlatStandard
Flat style IE 3.0 - base style.
void GadgetReleaseCapture(TGadget &gadget)
Releases the capture so that other windows can receive mouse messages.
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).
const TPoint & BottomRight() const
Returns the TPoint object representing the bottom right corner of this rectangle.
const TPoint & TopLeft() const
Returns the upperleft point.
int Width() const
Returns the width of this rectangle (right - left).
TRect()
Default constructor that does nothing.
The tagSIZE struct is defined as.
@ Flat
Flat instead of 3d for use in non-3d windows.
@ Soft
Soft edge look for buttons.
TEdge
Enumeration describing the type of edge to be drawn.
@ RaisedInner
Raised inner edge only.
@ SunkenOuter
Sunken outer edge only.
@ EdgeSunken
Both inner & outer sunken.
@ EdgeRaised
Both inner & outer raised.
TUIBorder(const TRect &frame, TStyle style, uint flags=0)
Constructs a UIBorder object given a frame and a high-level style type.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Object Windows Library (OWLNext Core).
DIAG_DECLARE_GROUP(OwlThread)
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.