13#if !defined(WS_EX_TOOLWINDOW)
14# define WS_EX_TOOLWINDOW 0x00000080L
48 CaptionFont =
nullptr;
294 WaitingForSysCmd =
true;
302 if (WaitingForSysCmd) {
502 WaitingForSysCmd =
false;
559 if (
r.Width() > 4 &&
r.Height() > 4) {
710 endPt.Offset(-1, -1);
855 boxRect.Offset(-CaptionHeight, 0);
896#if OWL_PERSISTENT_STREAMS
922TTinyCaption::Streamer::Write(opstream&
os)
const
924 TTinyCaption*
o = GetObject();
The GDI Brush class is derived from TGdiObject.
static const TColor SysBtnText
The symbolic system color value for the text on buttons.
static const TColor SysActiveCaption
The symbolic system color value for the caption of the active window.
static const TColor Sys3dHilight
The symbolic system color value for highlighted 3-dimensional display elements (for edges facing the ...
static const TColor SysCaptionText
The symbolic system color value for text in captions and size boxes, and for the arrow boxes on scrol...
static const TColor SysInactiveCaption
The symbolic system color value for the caption background of every inactive window.
static const TColor SysInactiveCaptionText
The symbolic system color value for the caption text of every inactive window.
static const TColor SysWindowFrame
The symbolic system color value for the frame around each window.
static const TColor Sys3dShadow
The symbolic system color value for the shadow regions of 3-dimensional display elements (for edges f...
static const TColor Sys3dFace
The symbolic system color value for the face color of 3-dimensional display elements.
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,...
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.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
bool GetTextExtent(const tstring &str, int stringLen, TSize &size) const
Computes the extent (width and height) in logical units of the text line consisting of stringLen char...
virtual bool ExtTextOut(int x, int y, uint16 options, const TRect *r, const tstring &str, int count=-1, const int *dx=nullptr)
Draws up to count characters of the given null-terminated string in the current font on this DC.
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
virtual void RestoreFont()
Restores the original GDI font object to this DC.
bool LineTo(int x, int y)
Draws a line on this DC using the current pen object.
virtual void SelectStockObject(int index)
Selects into the DC a predefined stock pen, brush, font, or palette.
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
int SetBkMode(int mode)
Sets the background mode to the given mode argument, which can be either OPAQUE or TRANSPARENT.
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).
TRect InflatedBy(int dx, int dy) const
Returns a rectangle inflated by the given delta arguments.
const TPoint & TopLeft() const
Returns the upperleft point.
int Width() const
Returns the width of this rectangle (right - left).
The tagSIZE struct is defined as.
Derived from TWindow, TTinyCaption is a mix-in class that handles a set of non-client events to produ...
TEventStatus DoNCLButtonDown(uint hitTest, const TPoint &screenPt)
If the caption bar is not enabled, returns esPartial.
void PaintCaption(bool active)
Calls dc.SelectObject() to select the given rectangle and dc.PatBlt() to paint the tiny caption bar u...
TRect GetMinBoxRect()
Returns the size of the minimize box rectangle.
void EvLButtonUp(uint hitTest, const TPoint &screenPt)
Responds to a mouse button-up message by calling DoLButtonUp.
void PaintSysBox(TDC &dc, TRect &boxRect, bool pressed)
Paints the system box.
~TTinyCaption() override
Destroys a TTinyCaption object and deletes the caption font.
void EvSysCommand(uint cmdType, const TPoint &p)
Responds to a WM_SYSCOMMAND message by calling DoSysCommand.
TEventStatus DoSysCommand(uint cmdType, const TPoint &p)
Handle WM_SYSCOMMAND to make sure that SC_KEYMENU and SC_MOUSEMENU bring up our sys menu at the right...
TTinyCaption()
Constructs a TTinyCaption object attached to the given parent window.
void EvMouseMove(uint hitTest, const TPoint &screenPt)
Responds to a mouse-move message by calling DoMouseMove.
TEventStatus DoNCPaint()
If the caption bar is not enabled or is iconized, returns esPartial.
TEventStatus DoMouseMove(uint hitTest, const TPoint &screenPt)
Returns TEventStatus.
void EnableTinyCaption(int ch=0, bool closeBox=false)
Pass closeBox=true to replace SystemMenu box with a box that will close window when clicked Used for ...
void PaintMaxBox(TDC &dc, TRect &boxRect, bool pressed)
Paints a maximize box on the tiny caption bar.
TEventStatus DoLButtonUp(uint hitTest, const TPoint &screenPt)
Releases the mouse capture if the caption bar is enabled and a mouse button is pressed.
TEventStatus DoNCHitTest(const TPoint &screenPt, uint &evRes)
If the caption bar is not enabled, returns esPartial.
TRect GetCaptionRect()
Gets the area of the caption for changing or repainting.
uint EvNCHitTest(const TPoint &screenPt)
Return where in the non client area we are.
TEventStatus DoCommand(uint id, HWND hWndCtl, uint notifyCode, TResult &evRes)
Displays the system menu using ::TrackPopup so that TTinyCaption sends WM_COMMAND instead of WM_SYSCO...
void EvNCLButtonDown(uint hitTest, const TPoint &screenPt)
Responds to a press of the left mouse button while the cursor is within the nonclient area of the cap...
TRect GetSysBoxRect()
Returns the size of the system box rectangle.
TEventStatus DoNCActivate(bool active, bool &evRes)
If the tiny caption is not enabled or is iconic, returns esPartial.
void PaintCloseBox(TDC &dc, TRect &boxRect, bool pressed)
Paints a close box on the tiny caption bar.
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
EvCommand provides extra processing for commands, but lets the focus window and its parent windows ha...
void DoSysMenu()
Gets the system menu and sets up menu items.
void PaintMinBox(TDC &dc, TRect &boxRect, bool pressed)
Paints a minimize box on the tiny caption bar.
TEventStatus DoNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &calcSize, uint &evRes)
Return the size of our client area, leaving room for caption bar.
TRect GetMaxBoxRect()
Returns the size of the maximize box rectangle.
void PaintButton(TDC &dc, TRect &boxRect, bool pressed)
Paints a blank button.
void EvNCPaint(HRGN)
Responds to a request to change a title bar or icon.
bool EvNCActivate(bool active)
Responds to a request to change a title bar or icon by calling DoNCActivate.
uint EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &calcSize)
Calculates the size of the command window including the caption and border so that it can fit within ...
static const TUIMetric CyBorder
static const TUIMetric CyCaption
static const TUIMetric CyFixedFrame
static const TUIMetric CxBorder
static const TUIMetric CySizeFrame
static const TUIMetric CxFixedFrame
static const TUIMetric CySmCaption
static const TUIMetric CxSizeFrame
Derived from TDC, TWindowDC is a device context (DC) class that provides access to the entire area ow...
static TPoint GetCursorPos()
static HWND GetActiveWindow()
Retrieves the handle of the active window.
HWND SetCapture()
Sets the mouse capture to the current window.
void EvNCLButtonDown(uint codeHitTest, const TPoint &)
The default message handler for WM_NCLBUTTONDOWN.
void EvLButtonUp(uint modKeys, const TPoint &point)
The default message handler for WM_LBUTTONUP.
TRect GetWindowRect() const
Gets the screen coordinates of the window's rectangle.
long GetWindowLong(int index) const
Retrieves information about the window depending on the value stored in index.
static void ReleaseCapture()
Releases the mouse capture from this window.
bool IsIconic() const
Returns true if window is iconic or minimized.
void ClientToScreen(TPoint &point) const
Converts the client coordinates specified in point to screen coordinates for the new window.
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
LPCTSTR GetCaption() const
Returns the Title member of TWindow.
bool EvNCActivate(bool active)
The default message handler for WM_NCACTIVATE.
uint EvNCHitTest(const TPoint &)
The default message handler for WM_NCHITTEST.
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
void EvSysCommand(uint cmdType, const TPoint &point)
Responds to a user-selected command from the System menu or when the user selects the maximize or min...
virtual TResult EvCommand(uint id, HWND hWndCtl, uint notifyCode)
WindowProc calls EvCommand to handle WM_COMMAND messages.
bool IsZoomed() const
Returns true if window is zoomed or maximized.
HMENU GetSystemMenu(bool revert=false) const
Returns a handle to the system menu so that an application can access the system menu.
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.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
static HWND GetFocus()
Gets a handle to the window that has the focus.
uint EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &)
The default message handler for WM_NCCALCSIZE.
HWND GetHandle() const
Returns the handle of the window.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
#define DEFINE_RESPONSE_TABLE(cls)
Macro to define a response table for a class with no base response tables.
Definition of abstract GDI object class and derived classes.
#define IMPLEMENT_STREAMABLE(cls)
TEventStatus
Mixin window event implementation return status.
@ esPartial
Additional handlers may be invoked.
@ esComplete
No additional handlers are needed.
Object Windows Library (OWLNext Core)
TParam2 MkParam2(const T1 &lo, const T2 &hi)
LRESULT TResult
Result type.
Definition of TUIMetric, a UI metrics provider class.