17#if defined(BI_MULTI_THREAD_RTL)
21#if defined(__TRACE) || defined(__WARN)
35#if !defined(WM_SIZING)
36# define WM_SIZING 0x0214
38#if !defined(DS_SETFOREGROUND)
39# define DS_SETFOREGROUND 0x200L
227 if (
dim &&
dim->cx == 0 &&
dim->cy != 0) {
242 int prevW = RowWidth;
261 int prevW = RowWidth;
264 if (RowWidth > 1000) {
354 return !
g->IsVisible();
356 return !
g->GetEnabled();
395 bool hideSlip = Attr.W == 0 || Attr.H == 0;
429 return slip->GetHarbor();
458 if (
w &&
w->GetHandle()) {
582 AdjustWindowRectEx(
winRect, Attr.Style,
false, Attr.ExStyle);
817 info.ptMinTrackSize.x =
sz.cx;
818 info.ptMinTrackSize.y =
sz.cy;
975 TWindow(&parent,
_T(
"EdgeSlip"), module),
979#if defined(__TRACE) || defined(__WARN)
999struct TEachDecoration {
1005 TEachDecoration(
int Top,
int Bottom,
TWindow*
w);
1008 {
return Top <
other.Top;}
1018 TRect
rect =
w->GetWindowRect();
1021 Bottom =
rect.bottom;
1025 Bottom =
rect.right;
1032TEachDecoration::TEachDecoration(
int top,
int bottom, TWindow*
w)
1043template <
class TDecoration>
1047 for (TWindow*
w = s.GetFirstChild();
w;
w = (
w == s.GetLastChild()) ?
nullptr :
w->Next())
1049 sort(
v.begin(),
v.end());
1123 decoItem.Window->SetWindowPos(
nullptr,
pt.x,
pt.y, 0, 0,
1162 TRACEX(
OwlCmd, 1,
"TEdgeSlip::EvCommand - id(" <<
id <<
"), ctl(" <<\
1181 if (
cw &&
cw->GetParentO() ==
this) {
1221 if (Location !=
alTop)
1253 if (Location !=
alTop){
1254 TRect tr(0,height-2,9999,height);
1288class TDecorationSpan {
1309 TRect
rect =
w->GetWindowRect();
1317 Bottom =
rect.bottom;
1322 Right =
rect.bottom;
1323 Bottom =
rect.right;
1375 if (GridType ==
YCoord) {
1383 decoItem.Window->SetWindowPos(
nullptr,
pt.x,
pt.y, 0, 0,
1456 if (GridType ==
YCoord) {
1464 decoItem.Window->SetWindowPos(
nullptr,
pt.x,
pt.y, 0, 0,
1501 df->GetChildLayoutMetrics(*
this,
metrics);
1502 df->SetChildLayoutMetrics(*
this,
metrics);
1753 w->SetWindowPos(
nullptr,
pt.x,
pt.y, 0, 0,
1797 w->SetWindowPos(
nullptr,
pt.x,
pt.y, 0, 0,
1836 return (
other.DockedWindow == DockedWindow) &&
1837 (
other.LeftSide == LeftSide);
1952 w->SetWindowPos(0,
rect.left,
rect.top, 0, 0,
1960 w->SetWindowPos(0,
rect.left,
rect.top, 0, 0,
1988 rect |=
w->GetWindowRect();
1999 if (Location !=
alTop)
2025 if (GridType ==
YCoord) {
2027 h = std::max(
h,
r.Height());
2032 h = std::max(
h,
r.Width());
2073 SlipBottom =
nullptr;
2074 SlipRight =
nullptr;
2077 DragDockable =
nullptr;
2137 slip->SetHarbor(
this);
2195 THatch8x8Brush Brush;
2197#if defined(BI_MULTI_THREAD_RTL)
2205static TDitherBrush& GetDitherBrush()
2207#if defined(BI_MULTI_THREAD_RTL)
2219static int fastWindowFrame(TDC& dc,
const TRect&
r,
bool thick,
uint32 rop)
2230 dc.SelectObject(GetDitherBrush().Brush);
2482 slip->SetHarbor(
this);
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
#define DIAG_DEFINE_GROUP_INIT(f, g, e, l)
Class wrapper for management of color values.
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,...
TCursor, derived from TGdiBase, represents the GDI cursor object class.
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
TLocation
Enumeration describing the possible locations of a Gadgetwindow [Used mainly for location of Toolbar ...
virtual void Insert(TWindow &decoration, TLocation location=Top)
Insert a decoration window into position at one of the four edges.
A control bar class that is dockable.
TDockableControlBar(TWindow *parent=0, TTileDirection direction=Horizontal, TFont *font=0, TModule *module=0)
Constructs a dockable control bar.
void EvOwlWindowDocked(uint pos, const TDockingSlip &slip)
A version of TGadgetWindow which is dockable.
void Layout(TAbsLocation, TSize *=nullptr) override
Causes this dockable to lay itself out vertically, horizontally, or rectangularly.
virtual TTileDirection GetDirectionForLocation(TAbsLocation loc)
Returns the layout direction to use when placed in a slip This can be overridden to provide different...
auto GetWindow() -> TWindow *override
Returns the TWindow part of this dockable object.
void EvOwlWindowDocked(uint pos, const TDockingSlip &slip)
Inserts/deletes FlatBar Grip.
void EvLButtonDown(uint modKeys, const TPoint &point)
Forwards event to slip to allow movement of gadget within the slip.
auto ShouldBeginDrag(TPoint &) -> bool override
Returns true if the mouse click point is in a spot that should move this dockable around.
~TDockableGadgetWindow() override
virtual TGadget * GetGripGadget()
void GetRect(TRect &) override
Gets this dockable's screen rectangle.
auto ComputeSize(TAbsLocation, TSize *) -> TSize override
Finds out how big this dockable would be in a given location, and with a given optional size hint.
void LayoutSession() override
If the gadget window changes size when laying out a dockable gadget window, this function tells the d...
auto GetHarbor() -> THarbor *override
Returns the harbor containing the dockable object.
TDockableGadgetWindow(TWindow *parent=0, TTileDirection direction=Horizontal, TFont *font=0, TModule *module=0)
This constructor creates a dockable gadget window and sets the appropriate styles for the window.
bool EvSetCursor(HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)
TDockable is an abstract base class for fixed or floating docking windows that want to be dockable in...
virtual TWindow * GetWindow()=0
Gets dockable's window and hides it, in case we have to toss it around a bit.
virtual TSize ComputeSize(TAbsLocation loc, TSize *dim)=0
Returns the rectangle of the dockable window in the given location.
virtual void GetRect(TRect &rect)=0
Return the rectangle of the dockable window in the given location.
TDockingSlip is an abstract base class for windows which accepts and holds dockable windows.
virtual void DockableMove(TDockable &dockable, const TPoint *topLeft=0, TRelPosition position=rpNone, TDockable *relDockable=0)=0
TEdgeSlip is the class of windows used by THarbor as the actual docking slips along the decorated fra...
TWindow * MoveDraggedWindow(TWindow *draggedWindow)
All terminology in this function is referenced to the following two windows Drag and LeftEdge.
void DockableInsert(TDockable &dockable, const TPoint *topLeft, TRelPosition position, TDockable *relDockable) override
This function overrides TDockingSlip::DockableInsert to insert a new dockable object into this TEdgeS...
void EvParentNotify(const TParentNotify &)
Makes sure that the slip size is updated when a child changes size.
uint EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &calcSize)
Returns the size of the client area, leaving room for the etched separators.
TEdgeSlip(TDecoratedFrame &parent, TAbsLocation location, TModule *module=0)
Constructs an edge slip, and sets the approriate styles for the window.
void EvLButtonDown(uint modKeys, const TPoint &point)
Forwards the left button down message to the dockable object.
bool EvWindowPosChanging(WINDOWPOS &windowPos)
When the slip shrinks, this function adjusts dockables where needed.
void DockableRemoved(const TRect &orgRect) override
Overriden TDockingSlip virtual.
void SetupWindow() override
Ensures that all decorations in the docking window are abutted against each other (both horizontally ...
void CompressGridLines()
Compresses or expands dockables perpendicular to the grid line.
void DockableMove(TDockable &dockable, const TPoint *topLeft, TRelPosition position, TDockable *relDockable) override
Overriden TDockingSlip virtual.
auto EvCommand(uint id, THandle hWndCtl, uint notifyCode) -> TResult override
Forward command messages to the parent.
int GridSize(int baseCoord)
Returns the perpendicular size of the grid line with the given base coordinates.
void EvLButtonDblClk(uint modKeys, const TPoint &point)
Handles WM_LBUTONDBLCLICK to tell the frame to edit a toolbar.
void EvCommandEnable(TCommandEnabler &commandEnabler) override
Changes the reciever to be the framewindow, not the docking window.
void CompressParallel(int width)
Compresses empty space along grid line if any dockables hang out past the end.
auto GetLocation() const -> TAbsLocation override
Retrieves the location of the slip.
void EvNCPaint(HRGN)
Erases the background and draws in etched 'borders' within the client area.
TSize ComputeDockingArea()
Computes the docking area size based on the dockables inside (total height if top/bottom docking area...
void MoveAllOthers(TWindow *draggedWindow, TWindow *movedWindow)
Builds a list (sorted by left coordinate) of windows on the same horizontal (top/bottom docking) or v...
void ReLayout(bool forcedLayout)
Called by Harbor when creating this docking window on a drop.
bool EvEraseBkgnd(HDC)
Erases the background and draws in etched 'borders' within the client area.
A gadget that is used on the far right of a status bar to provide re-sizing grip for the host window.
Derived from TFrameWindow and TTinyCaption, TFloatingFrame implements a floating frame that can be po...
TFloatingSlip is a floating frame which can hold a dockable window.
bool EvWindowPosChanging(WINDOWPOS &windowPos)
Handles WM_WINDOWPOSCHANGING to make sure that the frame is properly constrained by the dimensions of...
auto ComputeSize(TAbsLocation, TSize *) -> TSize override
Forward the first four TDockable virtuals to the client dockable.
void EvSettingChange(uint, LPCTSTR)
Event handler for the .INI file changed message.
void EvNCLButtonDown(uint hitTest, const TPoint &point)
Handles lbutton down bubbled up from the client to begin a dockable drag operation.
auto GetHarbor() -> THarbor *override
Returns the associated harbor.
auto ShouldBeginDrag(TPoint &) -> bool override
A given mouse down should never begin a drag for this dockable.
void DockableInsert(TDockable &, const TPoint *topLeft, TRelPosition, TDockable *relDockable) override
Overriden TDockingSlip virtual.
void EvWindowPosChanged(const WINDOWPOS &windowPos)
Handles WM_WINDOWPOSCHANGED to make sure that the dockable client gets a chance to do final layout.
void GetRect(TRect &) override
Gets this dockable's screen rect.
void EvGetMinMaxInfo(MINMAXINFO &info)
void Layout(TAbsLocation, TSize *=nullptr) override
Forwards the layout message over to the dockable object.
void DockableMove(TDockable &, const TPoint *topLeft, TRelPosition, TDockable *relDockable) override
Overriden TDockingSlip virtual.
void EvClose()
When closing the floating slip, removes any dockable first so that it is not destroyed.
bool EvSizing(uint side, TRect &rect)
Handles the Windows 4.0 message for the best resize user feedback.
void DockableRemoved(const TRect &) override
Overriden TDockingSlip virtual.
void EvLButtonDown(uint hitTest, const TPoint &point)
Handles lbutton down bubbled up from the client to begin a dockable drag operation.
auto GetWindow() -> TWindow *override
Returns the TWindow part of this dockable object.
auto GetLocation() const -> TAbsLocation override
Returns the location of the object.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
virtual TWindow * GetClientWindow()
Returns a pointer to the client window.
virtual TWindow * SetClientWindow(TWindow *clientWnd)
Sets the client window to the specified window.
TGadget is the base class for the following derived gadget classes:
TGadget * GadgetFromPoint(const TPoint &point) const
Returns the gadget that a given window-relative point is in, or 0 if none is found.
TGadget * GadgetWithId(int id) const
Returns the gadget with a given ID, or 0 if none is found.
TGadget * FirstGadget() const
Returns the first gadget of the list.
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
void Insert(TGadget &, TPlacement=After, TGadget *sibling=nullptr) override
Inserts a gadget before or after a sibling gadget (TPlacement).
static uint GetFlatStyle()
Returns the flat style.
@ FlatStandard
Flat style IE 3.0 - base style.
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)...
virtual void GetDesiredSize(TSize &size)
Get the desired size for this gadget window by performing a trial layout of the gadgets without touch...
auto GetTooltip() const -> TTooltip *override
Returns Tooltip.
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.
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.
TTileDirection GetDirection() const
Returns the direction of tiling for this gadget window.
THarbor is the object that holds all the docking slips.
void Remove(TDockable &dockable)
Remove a dockable from the harbor.
TRelPosition GetSlipPosition(TAbsLocation location)
Returns the default docking relative position for a given slip location.
void EvLButtonDblClk(uint modKeys, const TPoint &point)
Handles the left button double click and forwards the message to the dockable window.
TDockingSlip * Insert(TDockable &dockable, TAbsLocation location, const TPoint *where=0, TRelPosition position=rpNone, TDockable *relativeTo=0)
Dockable window insertion.
TSize DragNSize
Size of dockable when a natural shape.
TDecoratedFrame & DecFrame
void Move(TDockable &dockable, TAbsLocation location, const TPoint *where=0, TRelPosition position=rpNone, TDockable *relativeTo=0)
Move a dockable from one slip to another, programatically.
void EvLButtonUp(uint modKeys, const TPoint &point)
Handles mouse up to drop a dockable window being dragged.
TSize DragVSize
Size of dockable when vertical.
void EvMouseMove(uint modKeys, const TPoint &point)
Handles MouseMove to perform dockable dragging if a drag is in progress.
TSize DragHSize
Size of dockable when horizontal.
virtual TEdgeSlip * ConstructEdgeSlip(TDecoratedFrame &df, TAbsLocation location)
Creates an edge slip at a location.
virtual TFloatingSlip * ConstructFloatingSlip(TDecoratedFrame &df, int x, int y, TWindow *dockableWindow)
Constructs a floating slip with a particular window at a location.
TDockingSlip * DragNotificatee
Slip notified on drag operations.
~THarbor() override
Destructor.
void SetEdgeSlip(TAbsLocation location, TEdgeSlip *slip)
Sets a new edge slip for a given location.
TAbsLocation DragOrgSlipLoc
Original slip location on mouseDown.
bool DockDraggingBegin(TDockable &dockable, const TPoint &pt, TAbsLocation location, TDockingSlip *dockingNotify=0)
Called by docking slips.
TEdgeSlip * GetEdgeSlip(TAbsLocation location)
Returns the slip at the location.
Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome, configurable hatch brush.
When specifying the layout metrics for a window, four layout constraints are needed.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
An instance of TProfile encapsulates a setting within a system file, often referred to as a profile o...
TRect is a mathematical class derived from tagRect.
void Set(int _left, int _top, int _right, int _bottom)
Repositions and resizes this rectangle to the given values.
const TPoint & TopLeft() const
Returns the upperleft point.
TRect & MoveTo(int x, int y)
Moves the upper left corner of the rectangle to a new location and maintains the current dimension.
Derived from TWindowDC, TScreenDC is a DC class that provides direct access to the screen bitmap.
The tagSIZE struct is defined as.
Assists in drawing borders of many styles.
@ EdgeEtched
Outer sunken, inner raised.
void Paint(TDC &dc) const
Paints this UIBorder object onto a given device context.
static const TUIMetric CyFixedFrame
static const TUIMetric CxBorder
static const TUIMetric CySizeFrame
static const TUIMetric CxFixedFrame
static const TUIMetric CxSizeFrame
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...
bool EvEraseBkgnd(HDC)
Handler for WM_ERASEBKGND.
static TPoint GetCursorPos()
static void AdjustWindowRectEx(TRect &rect, uint32 style, bool menu, uint32 exStyle)
Calculates the size of a window rectangle that has an extended style.
bool SetCursor(TModule *module, TResId resId)
Sets the mouse cursor for the window, loading the given resId from the given module.
HWND SetCapture()
Sets the mouse capture to the current window.
HWND ChildWindowFromPoint(const TPoint &point) const
Determines which of the child windows contains the point specified in TPoint.
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.
static HWND GetCapture()
Returns the handle of the window that has captured the mouse.
bool EvWindowPosChanging(WINDOWPOS &)
The default message handler for WM_WINDOWPOSCHANGING.
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
TWindow * GetLastChild()
Returns a pointer to the last child window in the interface object's child list.
void EvClose()
The default response to a WM_CLOSE message is to call CloseWindow() and then have the window deleted ...
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...
TWindow * GetParent() const
Retrieves the OWL object of the parent window. If none exists, returns 0.
TWindow * GetWindowPtr(HWND hWnd) const
Calls TApplication:GetWindowPtr on the application associated with this window.
TRect GetWindowRect() const
Gets the screen coordinates of the window's rectangle.
TPoint MapClientToScreen(const TPoint &p) const
Function-style version of ClientToScreen.
void SetFlag(uint mask)
Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
TWindow * GetParentO() const
Return the OWL's parent for this window.
static void ReleaseCapture()
Releases the mouse capture from this window.
void MapWindowPoints(HWND hWndTo, TPoint *pts, int count) const
Maps a set of points in one window to a relative set of points in another window.
bool IsIconic() const
Returns true if window is iconic or minimized.
void GetWindowRect(TRect &rect) const
Gets the screen coordinates of the window's rectangle and copies them into rect.
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.
void EvWindowPosChanged(const WINDOWPOS &windowPos)
The default message handler for WM_WINDOWPOSCHANGED.
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
TRect GetClientRect() const
Gets the coordinates of the window's client area (the area in a window you can use for drawing).
virtual TResult EvCommand(uint id, HWND hWndCtl, uint notifyCode)
WindowProc calls EvCommand to handle WM_COMMAND messages.
void ClearFlag(uint mask)
Clears the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
void ScreenToClient(TPoint &point) const
Uses the screen coordinates specified in point to calculate the client window's coordinates and then ...
void EvMouseMove(uint modKeys, const TPoint &point)
The default message handler for WM_MOUSEMOVE.
virtual bool ShowWindow(int cmdShow)
Displays this TWindow in a given state.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
void EvLButtonDblClk(uint modKeys, const TPoint &point)
The default message handler for WM_LBUTTONDBLCLK.
bool IsFlagSet(uint mask)
Returns the state of the bit flag in Attr.Flags whose mask is supplied.
uint EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS &)
The default message handler for WM_NCCALCSIZE.
bool EvSetCursor(HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)
Response method for an incoming WM_SETCURSOR message.
void GetClientRect(TRect &rect) const
Gets the coordinates of the window's client area and then copies them into the object referred to by ...
TWindow * GetFirstChild()
Returns a pointer to the first child window, which is the first window created in the interface objec...
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
Definition of class TControlBar.
#define WM_OWLWINDOWDOCKED
Notify window it was [un]docked/reparented.
#define WM_OWLSLIPDBLCLK
Notify parent of user dblclick of edge slip.
TDockable classes: TDockableGadgetWindow & TDockableControlBar TDockingSlip classes: TFloatingSlip & ...
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
#define IDG_FLATHANDLE
The ID for a flat bar handle.
TRelPosition
General use 2-D rectangular relative position enum.
@ rpNone
No location specified.
@ rpAbove
Refers to top edge of frame.
@ rpBelow
Refers to bottom edge of frame.
@ rpRightOf
Refers to left edge of frame.
@ rpLeftOf
Refers to right edge of frame.
@ XCoord
Left & right edge have X coords parallel vertically.
@ YCoord
Grid type corresponds with Location:
TAbsLocation
General use absolute 2-D rectangular location enum.
@ alTop
Refers to top edge of frame.
@ alRight
Refers to right edge of frame.
@ alBottom
Refers to bottom edge of frame.
@ alLeft
Refers to left edge of frame.
@ alNone
No location specified.
@ wfShrinkToClient
Shrink a frame window to its client's size.
Object Windows Library (OWLNext Core)
UINT TMsgId
Message ID type.
uint32 MkUint32(uint16 lo, uint16 hi)
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
TDispatch< WM_PARENTNOTIFY >::TArgs TParentNotify
Alias for convenience.
TParam2 MkParam2(const T1 &lo, const T2 &hi)
LRESULT TResult
Result type.
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of TProfile class.
Definition of container classes used and made available by OWL.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of TUIMetric, a UI metrics provider class.