17#if defined(BI_MULTI_THREAD_RTL)
21#if defined(__TRACE) || defined(__WARN)
27#include <unordered_map>
36#if !defined(WM_SIZING)
37# define WM_SIZING 0x0214
39#if !defined(DS_SETFOREGROUND)
40# define DS_SETFOREGROUND 0x200L
68 Attr.Style |= WS_BORDER;
70 Attr.Style &= ~WS_BORDER;
72 Attr.Style |= WS_CLIPSIBLINGS;
163 boundsRect.right = boundsRect.left+8;
167 boundsRect.bottom = boundsRect.top+7;
191 int oldWidth = RowWidth;
207 int topM, leftM, bottomM, rightM;
209 delta.cy -= std::min(yt, bottomM);
215 TRect winRect(0, 0, 0, 0);
217 WS_POPUPWINDOW|WS_VISIBLE|WS_CAPTION|WS_THICKFRAME|WS_DLGFRAME,
219 delta = winRect.
Size();
228 if (dim && dim->cx == 0 && dim->cy != 0) {
230 int seekCy = dim->cy - delta.cy;
239 if (testSz.cy < seekCy) {
243 int prevW = RowWidth;
247 RowWidth = testSz.cx;
252 if (seekCy < testSz.cy) {
258 else if (testSz.cy > seekCy) {
262 int prevW = RowWidth;
265 if (RowWidth > 1000) {
266 RowWidth = testSz.cx;
271 if (seekCy > testSz.cy) {
285 RowWidth = dim->cx - delta.cx;
396 bool hideSlip = Attr.W == 0 || Attr.H == 0;
404 SetWindowPos(
nullptr, 0, 0, Attr.W, Attr.H, SWP_NOACTIVATE | SWP_NOMOVE);
412 SetWindowPos(
nullptr, 0, 0, Attr.W, Attr.H, SWP_NOACTIVATE | SWP_NOMOVE);
480 msg.message = WM_LBUTTONUP;
481 msg.wParam = modKeys;
564 captionHeight, popupPalette, module)
569 Attr.Style &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPSIBLINGS | WS_SYSMENU);
570 Attr.Style &= ~(WS_VISIBLE);
571 Attr.Style |= WS_CLIPCHILDREN;
572 Attr.Style |= WS_BORDER | WS_THICKFRAME;
582 TRect winRect(x, y, x+clientWnd->GetWindowAttr().W, y+clientWnd->GetWindowAttr().H);
589 Attr.X = winRect.left;
590 Attr.
Y = winRect.top;
592 Attr.W = winRect.
Width();
593 Attr.H = winRect.
Height();
603 if (hitTest == HTCAPTION) {
681 rect.left = rect.left + (rect.
Width() - dsz.cx)/2;
685 rect.top = rect.top + (rect.
Height() - dsz.cy)/2;
694 rect.top = rect.bottom - dsz.cy;
695 rect.right = rect.left + dsz.cx;
698 rect.left = rect.right - dsz.cx;
699 rect.top = rect.bottom - dsz.cy;
701 case WMSZ_BOTTOMLEFT:
703 rect.left = rect.right - dsz.cx;
704 rect.bottom = rect.top + dsz.cy;
707 case WMSZ_BOTTOMRIGHT:
709 rect.right = rect.left + dsz.cx;
710 rect.bottom = rect.top + dsz.cy;
730 if (!(windowPos.flags&SWP_NOSIZE)) {
739 TSize ts(windowPos.cx, 0);
744 if (!(windowPos.flags&SWP_NOMOVE)) {
746 windowPos.y = windowPos.y + (windowPos.cy - dsz.cy)/2;
750 windowPos.cx = dsz.cx;
751 windowPos.cy = dsz.cy;
755 windowPos.flags |= SWP_NOACTIVATE;
768 if (!(windowPos.flags&SWP_NOSIZE)) {
775 TSize ts(windowPos.cx, 0);
803 SetWindowPos(
nullptr, newWinRect, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
818 info.ptMinTrackSize.x = sz.cx;
819 info.ptMinTrackSize.y = sz.cy;
838 CHECK(dockableWindow);
861 SetWindowPos(
nullptr, topLeft->x, topLeft->y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE);
917 dockable->
Layout(loc, dim);
976 TWindow(&parent,
_T(
"EdgeSlip"), module),
980#if defined(__TRACE) || defined(__WARN)
985 bool useDiagColor = iniFile.
GetInt(
_T(
"DiagToolbarBorders")) != 0;
994 Attr.Style = (WS_VISIBLE|WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS);
1000struct TEachDecoration {
1006 TEachDecoration(
int Top,
int Bottom,
TWindow* w);
1008 bool operator <(
const TEachDecoration& other)
const
1009 {
return Top < other.Top;}
1019 TRect rect = w->GetWindowRect();
1020 if (gridType ==
YCoord) {
1022 Bottom = rect.bottom;
1026 Bottom = rect.right;
1033TEachDecoration::TEachDecoration(
int top,
int bottom,
TWindow* w)
1044template <
class TDecoration>
1047 vector<TDecoration> v;
1049 v.push_back(TDecoration(w, g));
1050 sort(v.begin(), v.end());
1065 vector<TEachDecoration> decoList = MakeDecorationList_<TEachDecoration>(*
this, GridType);
1075 int startWindowChange = -1;
1077 for (
size_t i = 1; i < decoList.size(); ++i) {
1080 if (decoList[i-1].Top != decoList[i].Top) {
1083 if (decoList[i-1].Bottom+diff != decoList[i].Top+diff) {
1088 if (startWindowChange == -1)
1089 startWindowChange =
static_cast<int>(i);
1093 diff += decoList[i-1].Top + rowHeight - decoList[i].Top;
1095 rowHeight = decoList[i].Bottom - decoList[i].Top;
1098 rowHeight = std::max(rowHeight, decoList[i].Bottom - decoList[i].Top);
1101 TEachDecoration& decoItem = decoList[i];
1102 decoItem.Top += diff;
1103 decoItem.Bottom += diff;
1109 if (startWindowChange != -1) {
1110 for (
size_t i = startWindowChange; i < decoList.size(); ++i) {
1111 TEachDecoration& decoItem = decoList[i];
1115 TPoint pt(r.left, r.top);
1117 pt.y = decoItem.Top;
1119 pt.x = decoItem.Top;
1124 decoItem.Window->
SetWindowPos(
nullptr, pt.x, pt.y, 0, 0,
1125 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
1163 TRACEX(OwlCmd, 1,
"TEdgeSlip::EvCommand - id(" <<
id <<
"), ctl(" <<\
1164 static_cast<void*
>(hWndCtl) <<
"), code(" << notifyCode <<
")");
1218 if (calcSize.rgrc[0].bottom - calcSize.rgrc[0].top > 0) {
1219 if (!(Attr.Style & WS_BORDER)) {
1221 calcSize.rgrc[0].top += 2;
1222 if (Location !=
alTop)
1223 calcSize.rgrc[0].bottom -= 2;
1237 if (Attr.Style & WS_BORDER) {
1251 TRect tr(0,0,9999,2);
1254 if (Location !=
alTop){
1255 TRect tr(0,height-2,9999,height);
1280 if (n.
Event == WM_SIZE)
1289class TDecorationSpan {
1300 bool operator <(
const TDecorationSpan& other)
const
1301 {
return Top < other.Top || (Top == other.Top && Left < other.Left);}
1310 TRect rect = w->GetWindowRect();
1311 ::MapWindowPoints(
nullptr, w->GetParentH(),
reinterpret_cast<TPoint*
>(&rect), 2);
1314 if (gridType ==
YCoord) {
1318 Bottom = rect.bottom;
1323 Right = rect.bottom;
1324 Bottom = rect.right;
1334 if (!(windowPos.flags & SWP_NOSIZE)) {
1346 vector<TDecorationSpan> decoList = MakeDecorationList_<TDecorationSpan>(*
this, GridType);
1350 if (!decoList.empty()) {
1351 int gridLine = decoList[0].Top;
1352 int lastTop = gridLine - 1;
1354 for (
size_t i = 0; i < decoList.size(); ++i) {
1355 decoList[i].Moved =
false;
1356 int t = decoList[i].Top;
1363 decoList[i].Top += delta;
1364 decoList[i].Bottom += delta;
1365 decoList[i].Moved =
true;
1367 gridLine = std::max(gridLine,decoList[i].Bottom);
1372 for (
size_t j = 0; j < decoList.size(); ++j) {
1374 TDecorationSpan& decoItem = decoList[j];
1375 if (decoItem.Moved) {
1376 if (GridType ==
YCoord) {
1377 pt.x = decoItem.Left;
1378 pt.y = decoItem.Top;
1381 pt.x = decoItem.Top;
1382 pt.y = decoItem.Left;
1384 decoItem.Window->
SetWindowPos(
nullptr, pt.x, pt.y, 0, 0,
1385 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1403 vector<TDecorationSpan> decoList = MakeDecorationList_<TDecorationSpan>(*
this, GridType);
1404 size_t firstOnRow = 0;
1405 size_t lastOnRow = 0;
1406 while (firstOnRow < decoList.size()) {
1407 int spaceOnRow = decoList[firstOnRow].Left;
1408 int rowTop = decoList[firstOnRow].Top;
1409 while (lastOnRow + 1 < decoList.size() && decoList[lastOnRow + 1].Top == rowTop) {
1410 spaceOnRow += decoList[lastOnRow+1].Left-(decoList[lastOnRow].Right+1);
1414 int delta = decoList[lastOnRow].Right - width;
1415 if (delta > 0 && spaceOnRow > 0) {
1416 if (spaceOnRow > delta) {
1420 size_t i = lastOnRow;
1421 while (i >= firstOnRow && (decoList[i].Right+1) > r) {
1422 int dx = (decoList[i].Right+1) - r;
1423 decoList[i].Left -= dx;
1424 decoList[i].Right -= dx;
1425 decoList[i].Moved =
true;
1426 r = decoList[i].Left;
1435 for (
size_t i = firstOnRow; i <= lastOnRow; ++i) {
1436 if (decoList[i].Left > r) {
1437 int dx = decoList[i].Left - r;
1438 decoList[i].Left -= dx;
1439 decoList[i].Right -= dx;
1440 decoList[i].Moved =
true;
1441 r = decoList[i].Right+1;
1448 firstOnRow = lastOnRow+1;
1453 for (
size_t i = 0; i < decoList.size(); ++i) {
1455 TDecorationSpan& decoItem = decoList[i];
1456 if (decoItem.Moved) {
1457 if (GridType ==
YCoord) {
1458 pt.x = decoItem.Left;
1459 pt.y = decoItem.Top;
1462 pt.x = decoItem.Top;
1463 pt.y = decoItem.Left;
1465 decoItem.Window->
SetWindowPos(
nullptr, pt.x, pt.y, 0, 0,
1466 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
1485 sizeChanged = Attr.H != area.cy;
1489 sizeChanged = Attr.W != area.cx;
1495 if (sizeChanged || forcedLayout) {
1522 CHECK(dockableWindow);
1539 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
1547 DockableMove(dockable, topLeft, position, relDockable);
1571 if (position ==
rpNone)
switch (Location) {
1601 TRect relWindowRect(0,0,0,0);
1605 ::MapWindowPoints(
nullptr, *
this,
reinterpret_cast<TPoint*
>(&relWindowRect), 2);
1612 dockPos =
TPoint(relWindowRect.left, relWindowRect.top-dockableSize.cy);
1615 dockPos =
TPoint(relWindowRect.left, relWindowRect.bottom);
1618 dockPos =
TPoint(relWindowRect.left-dockableSize.cx, relWindowRect.top);
1621 dockPos =
TPoint(relWindowRect.right, relWindowRect.top);
1631 vector<TEachDecoration> GridList = MakeDecorationList_<TEachDecoration>(*
this, GridType);
1632 CHECK(!GridList.empty());
1633 int bottomEdge = GridList[0].Top;
1635 dockableEdge = dockPos.y;
1637 dockableEdge = dockPos.x;
1639 for (
size_t i = 0; i < GridList.size(); ++i) {
1640 if (dockableEdge <= (GridList[i].Top+GridList[i].Bottom)/2)
1642 if (GridList[i].Window != dockableWindow)
1643 bottomEdge = std::max(bottomEdge,GridList[i].Bottom);
1650 newPos.y = bottomEdge;
1653 newPos.x = bottomEdge;
1666 dockableWindow->
SetWindowPos(
nullptr, newPos.x, newPos.y, 0, 0,
1667 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1723 if (w != draggedWindow) {
1728 if (draggedRect.left >= currRect.left && draggedRect.left <= currRect.right &&
1729 currRect.top == draggedRect.top) {
1731 int midPt = (currRect.right - currRect.left) / 2;
1738 if (currRect.left + midPt > draggedRect.left) {
1742 pt.x = currRect.left;
1743 pt.y = draggedRect.top;
1746 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1751 pt.x = draggedRect.right;
1752 pt.y = currRect.top;
1755 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1761 pt.x = currRect.right;
1762 pt.y = draggedRect.top;
1765 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1766 return draggedWindow;
1773 if (draggedRect.top >= currRect.top && draggedRect.top <= currRect.bottom &&
1774 currRect.left == draggedRect.left) {
1776 int midPt = (currRect.bottom - currRect.top) / 2;
1783 if (currRect.top+midPt > draggedRect.top) {
1786 pt.x = currRect.left;
1787 pt.y = draggedRect.top;
1790 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1795 pt.x = draggedRect.right;
1796 pt.y = currRect.top;
1799 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1805 pt.x = currRect.right;
1806 pt.y = draggedRect.top;
1809 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1810 return draggedWindow;
1817 }
while (w != first);
1820 return draggedWindow;
1830 TWindowItem(
TWindow* dockedW = 0,
int left = 0) : DockedWindow(dockedW),
1836 bool operator == (
const TWindowItem& other) {
1837 return (other.DockedWindow == DockedWindow) &&
1838 (other.LeftSide == LeftSide);
1864 if (w != draggedWindow) {
1871 if (currRect.top == draggedRect.top && currRect.left >= draggedRect.left) {
1874 while (i < windowList.
Size()) {
1875 if (currRect.left <= windowList[i].LeftSide)
1880 TWindowItem wItem(w, currRect.left);
1881 windowList.
AddAt(wItem, i);
1886 }
while (w != first);
1893 if(windowList.
Size()) {
1898 while (i < windowList.
Size()) {
1899 if (windowList[i].LeftSide >= draggedRect.left &&
1900 windowList[i].LeftSide < draggedRect.right)
1908 if (i == 0 || i != windowList.
Size()) {
1912 while (i < windowList.
Size()) {
1913 int offset = w1->
GetWindowRect().right - windowList[i].LeftSide;
1915 pt.x = windowList[i].LeftSide + offset;
1916 pt.y = windowList[i].DockedWindow->GetWindowRect().top;
1918 windowList[i].DockedWindow->SetWindowPos(
nullptr, pt.x, pt.y, 0, 0,
1919 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1920 w1 = windowList[i++].DockedWindow;
1942TEdgeSlip::Collapse(
int topCoord,
int delta)
1950 if (rect.top > topCoord) {
1954 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1958 if (rect.left > topCoord) {
1962 SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
1966 }
while (w != first);
1980 TRect rect(0, 0, 0, 0);
1991 }
while (w != first);
1996 if (rect.bottom > rect.top && rect.right > rect.left) {
1997 if (!(Attr.Style & WS_BORDER)) {
2000 if (Location !=
alTop)
2026 if (GridType ==
YCoord) {
2027 if (baseCoord == r.top) {
2028 h = std::max(h, r.
Height());
2032 if (baseCoord == r.left){
2033 h = std::max(h, r.
Width());
2038 }
while (w != first);
2070 Attr.Style = WS_CHILD;
2190const TCHAR DragGuideClassName[] =
_T(
"OWLNext.DragGuideWindow.1");
2191const COLORREF DragGuideColor = RGB(100, 100, 100);
2192const BYTE DragGuideAlpha = 128;
2194static ATOM RegisterDragGuideClass()
2196 static HBRUSH brush = ::CreateSolidBrush(DragGuideColor);
2198 wc.cbSize =
sizeof(wc);
2199 wc.lpfnWndProc = ::DefWindowProc;
2200 wc.hInstance = ::GetModuleHandle(
nullptr);
2201 wc.hbrBackground = brush;
2202 wc.lpszClassName = DragGuideClassName;
2203 return ::RegisterClassEx(&wc);
2208static void SetDragGuideRegion(HWND hwnd,
int cx,
int cy,
int thickness)
2210 HRGN outer = ::CreateRectRgn(0, 0, cx, cy);
2211 HRGN inner = ::CreateRectRgn(thickness, thickness, cx - thickness, cy - thickness);
2212 ::CombineRgn(outer, outer, inner, RGN_DIFF);
2213 ::DeleteObject(inner);
2214 ::SetWindowRgn(hwnd, outer, FALSE);
2219static HWND CreateDragGuide(
const TRect& r,
bool thick)
2221 static ATOM cls = RegisterDragGuideClass();
2223 const int cx = r.Width();
2224 const int cy = r.Height();
2225 HWND hwnd = ::CreateWindowEx(
2226 WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_NOACTIVATE,
2227 reinterpret_cast<LPCTSTR
>(cls),
2230 r.left, r.top, cx, cy,
2231 nullptr,
nullptr, ::GetModuleHandle(
nullptr),
nullptr);
2232 ::SetLayeredWindowAttributes(hwnd, 0, DragGuideAlpha, LWA_ALPHA);
2233 SetDragGuideRegion(hwnd, cx, cy, thickness);
2234 ::ShowWindow(hwnd, SW_SHOWNA);
2240static void MoveDragGuide(HWND hwnd,
const TRect& r,
bool thick)
2243 const int cx = r.Width();
2244 const int cy = r.Height();
2245 ::SetWindowPos(hwnd,
nullptr, r.left, r.top, cx, cy,
2246 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2247 SetDragGuideRegion(hwnd, cx, cy, thickness);
2252static void DestroyDragGuide(HWND hwnd)
2254 ::DestroyWindow(hwnd);
2259static std::unordered_map<THarbor*, HWND> s_dragGuideHwnds;
2300 SlipTR.
Set(frameR.left, frameR.top, frameR.right, frameR.top);
2305 SlipBR.
Set(frameR.left, frameR.bottom, frameR.right, frameR.bottom);
2310 SlipLR.
Set(frameR.left, frameR.top, frameR.left, frameR.bottom);
2315 SlipRR.
Set(frameR.right, frameR.top, frameR.right, frameR.bottom);
2404 DestroyDragGuide(s_dragGuideHwnds[
this]);
2405 s_dragGuideHwnds.erase(
this);
2477 if (location ==
alNone) {
2483 floatWhere = *where;
2488 floatWhere =
TPoint(CW_USEDEFAULT, CW_USEDEFAULT);
2494 floatWhere.x, floatWhere.y,
2555 if (dockableWindow) {
2562 if (previousSlip && previousSlip->
GetLocation() == location) {
2570 dockable.
GetRect(previousRect);
2578 Insert(dockable, location, where, position, relDockable);
2592 if (dockableWindow) {
2594 dockable.
GetRect(previousRect);
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
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,...
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.
TCursor(HCURSOR handle, TAutoDelete autoDelete=NoAutoDelete)
Creates a TCursor object and sets the Handle data member to the given borrowed handle.
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...
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.
virtual void Layout(TAbsLocation loc, TSize *dim=0)=0
Changes the window to be equal to the size returned from ComputeNNNNN.
virtual bool ShouldBeginDrag(TPoint &pt)=0
This is overriden for any window that wants to be docked.
virtual THarbor * GetHarbor()=0
Returns the harbor containing the dockable object.
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
void SetHarbor(THarbor *harbor)
Set the back pointer to the harbor.
THarbor * GetHarbor() const
Retrieve the associated harbor.
virtual TAbsLocation GetLocation() const =0
virtual void DockableRemoved(const TRect &orgRect)=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.
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.
TResult DispatchMsg(TMsgId, uint id, TParam1, TParam2)
Search for the event given the message and it and dispatch to the event handler if found.
TFlatHandleGadget(int id=IDG_FLATHANDLE)
Derived from TFrameWindow and TTinyCaption, TFloatingFrame implements a floating frame that can be po...
void SetDragFrame(bool dragFrame)
Sets the flag for additional dragging area.
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.
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 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.
TFloatingSlip(TWindow *parent, int x, int y, TWindow *clientWnd=0, bool shrinkToClient=true, int captionHeight=DefaultCaptionHeight, bool popupPalette=true, TModule *module=0)
Constructs a floating slip and sets the appropriate style for the window.
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.
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:
bool IsVisible() const
Returns true if the gadget is visible.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
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.
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...
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.
THarbor(TDecoratedFrame &df)
Creates the harbor. The harbor is where the slips can go dock.
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.
When specifying the layout metrics for a window, four layout constraints are needed.
virtual void Layout()
Causes the window to resize and position its children according to the specified metrics.
bool GetChildLayoutMetrics(const TWindow &child, TLayoutMetrics &metrics)
Gets the layout metrics of the child window.
void SetChildLayoutMetrics(TWindow &child, const TLayoutMetrics &metrics)
Sets the metrics for the window and removes any existing ones.
void AddAt(const T &t, uint index)
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
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.
int Height() const
Returns the height of this rectangle (bottom - top).
void Set(int _left, int _top, int _right, int _bottom)
Repositions and resizes this rectangle to the given values.
TRect & Offset(int dx, int dy)
Changes this rectangle so its corners are offset by the given delta values.
TRect & Inflate(int dx, int dy)
Inflates 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).
bool Touches(const TRect &other) const
Returns true if the other rectangle shares any interior points with this rectangle; otherwise,...
bool Contains(const TPoint &point) const
Returns true if the given point lies within this rectangle; otherwise, it returns false.
TRect & MoveTo(int x, int y)
Moves the upper left corner of the rectangle to a new location and maintains the current dimension.
int Y() const
Returns the top value.
TSize Size() const
Returns the size of rectangle.
Derived from TWindowDC, TScreenDC is a DC class that provides direct access to the screen bitmap.
The tagSIZE struct is defined as.
TSize()
Default constructor that does nothing.
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 ...
@ EdgeEtched
Outer sunken, inner raised.
TUIBorder(const TRect &frame, TStyle style, uint flags=0)
Constructs a UIBorder object given a frame and a high-level style type.
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...
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.
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.
virtual void SetParent(TWindow *newParent)
Sets the parent for the specified window by setting Parent to the specified new Parent window object.
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 ...
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 Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
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.
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.
TWindowAttr & GetWindowAttr()
Returns the TWindowAttr structure, which contains the window's creation attributes.
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.
bool IsWindow() const
Returns true if an HWND is being used.
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.
LPCTSTR GetCaption() const
Returns the Title member of TWindow.
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
void UpdateWindow()
Updates the client area of the specified window by immediately sending a WM_PAINT message.
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 ...
TWindow * Next()
Returns a pointer to the next sibling window in the window's sibling list.
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.
DIAG_DEFINE_GROUP_INIT(OWL_INI, OwlApp, 1, 0)
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of TProfile class.
uint32 Style
Contains the values that define the style, shape, and size of your window.
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.