48 bool shrinkToClient,
int captionHeight,
49 bool popupPalette,
TModule* module)
51 TFrameWindow(owner, title, client, shrinkToClient, module),
54 DragFrame(popupPalette)
56 Init(captionHeight, popupPalette);
71 :
TFrameWindow(owner, title, client, shrinkToClient, module),
74 DragFrame(popupPalette)
76 Init(captionHeight, popupPalette);
82 Attr.Style = WS_POPUP | WS_BORDER | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
122 TRACEX(OwlCmd, 1,
"TFloatingFrame::GetCommandTarget - returns "
177 if ((cmdType & 0xFFF0) == SC_SIZE || (cmdType & 0xFFF0) == SC_MOVE)
228 int mx = Margin.cx * Border.cx;
229 int my = Margin.cy * Border.cy;
232 dc.
TextRect(wr.left, wr.top, wr.left+mx, wr.bottom);
233 dc.
TextRect(wr.left+mx, wr.top, wr.right-mx, wr.top+my);
234 dc.
TextRect(wr.right-mx, wr.top, wr.right, wr.bottom);
235 dc.
TextRect(wr.left+mx, wr.bottom-my, wr.right-mx, wr.bottom);
262 if (DragFrame && TCEnabled) {
290 return MA_NOACTIVATE;
319 AppearActive = active;
328#if OWL_PERSISTENT_STREAMS
347TFloatingFrame::Streamer::Write(opstream& os)
const
349 TFloatingFrame* o = GetObject();
#define TRACEX(group, level, message)
TFrameWindow * GetMainWindow()
Return the current main window.
static const TColor SysInactiveCaption
The symbolic system color value for the caption background of every inactive window.
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,...
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.
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
Derived from TFrameWindow and TTinyCaption, TFloatingFrame implements a floating frame that can be po...
void EvActivateApp(bool active, DWORD taskId)
void Init(int captionHeight, bool popupPalette)
void EvNCPaint(HRGN)
Handles WM_NCPAINT to paint the non-client areas of this window.
void EvCommandEnable(TCommandEnabler &) override
void EvSysCommand(uint cmdType, const TPoint &p)
This is an example of a mix-in that does partial event handling.
uint EvNCHitTest(const TPoint &screenPt)
Returns where in the non-client area the mouse is.
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
Resolves ambiguous mixin reference by passing EvCommand first to the tiny caption and then to the fra...
TEventStatus DoNCHitTest(const TPoint &screenPt, uint &evRes)
Event handler helper.
uint EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &calcSize)
Handles WM_NCCALCSIZE to possibly add in the drag frame margins.
bool EvNCActivate(bool active)
TFloatingFrame(TWindow *parent, LPCTSTR title=0, TWindow *clientWnd=0, bool shrinkToClient=false, int captionHeight=DefaultCaptionHeight, bool popupPalette=false, TModule *module=0)
Constructs a TFloatingFrame object attached to the specified parent window.
uint EvMouseActivate(HWND hTopLevel, uint hitCode, TMsgId)
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.
TFrameWindow(TWindow *parent, LPCTSTR title=nullptr, TWindow *clientWnd=nullptr, bool shrinkToClient=false, TModule *module=nullptr)
Constructs a window object with the parent window supplied in parent, which is zero if this is the ma...
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
Handle WM_COMMAND to provide extra processing for commands: Extra processing for commands: starts wit...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
const TPoint & TopLeft() const
Returns the upperleft point.
Derived from TWindow, TTinyCaption is a mix-in class that handles a set of non-client events to produ...
void PaintCaption(bool active)
Calls dc.SelectObject() to select the given rectangle and dc.PatBlt() to paint the tiny caption bar u...
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 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 ...
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.
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_SYSCOMM...
TEventStatus DoNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &calcSize, uint &evRes)
Return the size of our client area, leaving room for caption bar.
static const TUIMetric CyBorder
static const TUIMetric CxBorder
Derived from TDC, TWindowDC is a device context (DC) class that provides access to the entire area ow...
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
static HWND GetActiveWindow()
Retrieves the handle of the active window.
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
virtual void EvCommandEnable(TCommandEnabler &ce)
Called by WindowProc to handle WM_COMMAND_ENABLE messages, EvCommandEnable calls the CmXxxx command-h...
virtual TResult DefWindowProc(TMsgId, TParam1, TParam2)
Virtual function provides final default processing for an incoming message Calls original window proc...
TWindow * GetParentO() const
Return the OWL's parent for 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.
HWND SetActiveWindow()
Activates a top-level window.
void GetWindowRect(TRect &rect) const
Gets the screen coordinates of the window's rectangle and copies them into rect.
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.
uint EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &)
The default message handler for WM_NCCALCSIZE.
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 THandle
TWindow encapsulates an HWND.
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_TABLE2(cls, base1, base2)
Macro to define a response table for a class with two bases.
Definition of class TFloatingFrame.
void ReadBaseObject(Base *base, ipstream &in)
void WriteBaseObject(Base *base, opstream &out)
TEventStatus
Mixin window event implementation return status.
@ esPartial
Additional handlers may be invoked.
@ esComplete
No additional handlers are needed.
Object Windows Library (OWLNext Core).
UINT TMsgId
Message ID type.
IMPLEMENT_STREAMABLE2(TEditView, TEditSearch, TView)
LRESULT TResult
Result type.
DIAG_DECLARE_GROUP(OwlThread)
Definition of TUIMetric, a UI metrics provider class.