Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch bug-29ba539501 Excluding Merge-Ins
This is equivalent to a diff from d27aa50c to d3d27e6c
2024-12-09
| ||
10:24 | Fix [29ba539501]: many PIXEL options don't keep their configured value. check-in: 68ed671a user: jan.nijtmans tags: trunk, main | |
2024-12-08
| ||
22:16 | Rebase to 9.0 Closed-Leaf check-in: d3d27e6c user: jan.nijtmans tags: bug-29ba539501 | |
22:07 | Update changes.md check-in: d27aa50c user: jan.nijtmans tags: trunk, main | |
22:02 | Fix [6bdf1a7ec3]: Bind mechanism vs. GNOME check-in: 4166cb48 user: jan.nijtmans tags: trunk, main | |
18:34 | PanedWindow.width|height done check-in: 828cceea user: jan.nijtmans tags: bug-29ba539501 | |
Changes to generic/tkPanedWindow.c.
︙ | ︙ | |||
85 86 87 88 89 90 91 | Tcl_Obj *padXObj; /* Additional padding requested for pane, in * the x dimension. */ Tcl_Obj *padYObj; /* Additional padding requested for pane, in * the y dimension. */ Tcl_Obj *widthObj, *heightObj; /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ | < < < | | < | < < | < | | | < | < < < | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | Tcl_Obj *padXObj; /* Additional padding requested for pane, in * the x dimension. */ Tcl_Obj *padYObj; /* Additional padding requested for pane, in * the y dimension. */ Tcl_Obj *widthObj, *heightObj; /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ int sticky; /* Sticky string. */ int x, y; /* Coordinates of the widget. */ int paneWidth, paneHeight; /* Pane dimensions (may be different from * pane width/height). */ int sashx, sashy; /* Coordinates of the sash of the right or * bottom of this pane. */ int markx, marky; /* Coordinates of the last mark set for the * sash. */ int handlex, handley; /* Coordinates of the sash handle. */ enum stretch stretch; /* Controls how pane grows/shrinks */ int hide; /* Controls visibility of pane */ struct PanedWindow *containerPtr; /* Paned window managing the window. */ Tk_Window after; /* Placeholder for parsing options. */ Tk_Window before; /* Placeholder for parsing options. */ int width; /* Pane width. Same as widthObj, but updatable */ int height; /* Pane height. Same as heightObj, but updatable */ } Pane; /* * A data structure of the following type is kept for each paned window widget * managed by this file: */ typedef struct PanedWindow { Tk_Window tkwin; /* Window that embodies the paned window. */ Tk_Window proxywin; /* Window for the resizing proxy. */ Display *display; /* X's token for the window's display. */ Tcl_Interp *interp; /* Interpreter associated with widget. */ Tcl_Command widgetCmd; /* Token for square's widget command. */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ Tk_OptionTable paneOpts; /* Token for pane cget table. */ Tk_3DBorder background; /* Background color. */ Tcl_Obj *borderWidthObj; int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */ Tcl_Obj *widthObj; /* Tcl_Obj rep for width. */ Tcl_Obj *heightObj; /* Tcl_Obj rep for height. */ enum orient orient; /* Orientation of the widget. */ Tk_Cursor cursor; /* Current cursor for window, or None. */ int resizeOpaque; /* Boolean indicating whether resize should be * opaque or rubberband style. */ int sashRelief; /* Relief used to draw sash. */ Tcl_Obj *sashWidthObj; /* Tcl_Obj rep for sash width. */ Tcl_Obj *sashPadObj; /* Tcl_Obj rep for sash padding. */ int showHandle; /* Boolean indicating whether sash handles * should be drawn. */ Tcl_Obj *handleSizeObj; /* Size of one side of a sash handle (handles * are square), in pixels. */ Tcl_Obj *handlePadObj; /* Distance from border to draw handle. */ Tk_Cursor sashCursor; /* Cursor used when mouse is above a sash. */ GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ Tk_3DBorder proxyBackground;/* Background color used to draw proxy. If NULL, use background. */ Tcl_Obj *proxyBorderWidthObj; /* Tcl_Obj rep for proxyBorderWidth */ int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */ Pane **panes; /* Pointer to array of Panes. */ int numPanes; /* Number of panes. */ int sizeofPanes; /* Number of elements in the panes array. */ int flags; /* Flags for widget; see below. */ } PanedWindow; /* * Flags used for paned windows: * * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has been * queued to redraw this window. |
︙ | ︙ | |||
281 282 283 284 285 286 287 | DEF_PANEDWINDOW_BG_COLOR, TCL_INDEX_NONE, offsetof(PanedWindow, background), 0, DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", | | | | | | | | | | | | | | | | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | DEF_PANEDWINDOW_BG_COLOR, TCL_INDEX_NONE, offsetof(PanedWindow, background), 0, DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_PANEDWINDOW_BORDERWIDTH, offsetof(PanedWindow, borderWidthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_PANEDWINDOW_CURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", DEF_PANEDWINDOW_HANDLEPAD, offsetof(PanedWindow, handlePadObj), TCL_INDEX_NONE, 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizeObj), TCL_INDEX_NONE, 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", DEF_PANEDWINDOW_OPAQUERESIZE, TCL_INDEX_NONE, offsetof(PanedWindow, resizeOpaque), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_PANEDWINDOW_ORIENT, TCL_INDEX_NONE, offsetof(PanedWindow, orient), TK_OPTION_ENUM_VAR, orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", 0, TCL_INDEX_NONE, offsetof(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, (void *)DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", DEF_PANEDWINDOW_PROXYBORDER, offsetof(PanedWindow, proxyBorderWidthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", 0, TCL_INDEX_NONE, offsetof(PanedWindow, proxyRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_PANEDWINDOW_RELIEF, TCL_INDEX_NONE, offsetof(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", DEF_PANEDWINDOW_SASHCURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, sashCursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-sashpad", "sashPad", "SashPad", DEF_PANEDWINDOW_SASHPAD, offsetof(PanedWindow, sashPadObj), TCL_INDEX_NONE, 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-sashrelief", "sashRelief", "Relief", DEF_PANEDWINDOW_SASHRELIEF, TCL_INDEX_NONE, offsetof(PanedWindow, sashRelief), 0, 0, 0}, {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", DEF_PANEDWINDOW_SASHWIDTH, offsetof(PanedWindow, sashWidthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle", DEF_PANEDWINDOW_SHOWHANDLE, TCL_INDEX_NONE, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec paneOptionSpecs[] = { {TK_OPTION_WINDOW, "-after", NULL, NULL, DEF_PANEDWINDOW_PANE_AFTER, TCL_INDEX_NONE, offsetof(Pane, after), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-before", NULL, NULL, DEF_PANEDWINDOW_PANE_BEFORE, TCL_INDEX_NONE, offsetof(Pane, before), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, DEF_PANEDWINDOW_PANE_HEIGHT, offsetof(Pane, heightObj), offsetof(Pane, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", DEF_PANEDWINDOW_PANE_HIDE, TCL_INDEX_NONE, offsetof(Pane, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, DEF_PANEDWINDOW_PANE_MINSIZE, offsetof(Pane, minSizeObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, DEF_PANEDWINDOW_PANE_PADX, offsetof(Pane, padXObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, DEF_PANEDWINDOW_PANE_PADY, offsetof(Pane, padYObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, DEF_PANEDWINDOW_PANE_STICKY, TCL_INDEX_NONE, offsetof(Pane, sticky), 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", DEF_PANEDWINDOW_PANE_STRETCH, TCL_INDEX_NONE, offsetof(Pane, stretch), TK_OPTION_ENUM_VAR, stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, |
︙ | ︙ | |||
923 924 925 926 927 928 929 930 931 932 | tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[i + 2]), pwPtr->tkwin); found = 0; for (j = 0; j < pwPtr->numPanes; j++) { if (pwPtr->panes[j] != NULL && pwPtr->panes[j]->tkwin == tkwin) { Tk_SetOptions(interp, pwPtr->panes[j], pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, pwPtr->tkwin, NULL, NULL); | > > > | | > | 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 | tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[i + 2]), pwPtr->tkwin); found = 0; for (j = 0; j < pwPtr->numPanes; j++) { if (pwPtr->panes[j] != NULL && pwPtr->panes[j]->tkwin == tkwin) { int minSize; Tk_SetOptions(interp, pwPtr->panes[j], pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, pwPtr->tkwin, NULL, NULL); Tk_GetPixelsFromObj(NULL, tkwin, pwPtr->panes[j]->minSizeObj, &minSize); if (minSize < 0) { Tcl_DecrRefCount(pwPtr->panes[j]->minSizeObj); pwPtr->panes[j]->minSizeObj = Tcl_NewIntObj(0); Tcl_IncrRefCount(pwPtr->panes[j]->minSizeObj); } found = 1; /* * If the pane is supposed to move, add it to the inserts * array now; otherwise, leave it where it is. */ |
︙ | ︙ | |||
967 968 969 970 971 972 973 974 975 976 977 978 979 980 | continue; } /* * Create a new pane structure and initialize it. All panes start * out with their "natural" dimensions. */ panePtr = (Pane *)ckalloc(sizeof(Pane)); memset(panePtr, 0, sizeof(Pane)); Tk_InitOptions(interp, panePtr, pwPtr->paneOpts, pwPtr->tkwin); Tk_SetOptions(interp, panePtr, pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, | > | 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | continue; } /* * Create a new pane structure and initialize it. All panes start * out with their "natural" dimensions. */ int minSize; panePtr = (Pane *)ckalloc(sizeof(Pane)); memset(panePtr, 0, sizeof(Pane)); Tk_InitOptions(interp, panePtr, pwPtr->paneOpts, pwPtr->tkwin); Tk_SetOptions(interp, panePtr, pwPtr->paneOpts, objc - firstOptionArg, objv + firstOptionArg, |
︙ | ︙ | |||
988 989 990 991 992 993 994 | panePtr->paneWidth = Tk_ReqWidth(tkwin) + doubleBw; } if (panePtr->height > 0) { panePtr->paneHeight = panePtr->height; } else { panePtr->paneHeight = Tk_ReqHeight(tkwin) + doubleBw; } | > | > | > | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 | panePtr->paneWidth = Tk_ReqWidth(tkwin) + doubleBw; } if (panePtr->height > 0) { panePtr->paneHeight = panePtr->height; } else { panePtr->paneHeight = Tk_ReqHeight(tkwin) + doubleBw; } Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->minSizeObj, &minSize); if (minSize < 0) { Tcl_DecrRefCount(panePtr->minSizeObj); panePtr->minSizeObj = Tcl_NewIntObj(0); Tcl_IncrRefCount(panePtr->minSizeObj); } /* * Set up the geometry management callbacks for this pane. */ Tk_CreateEventHandler(panePtr->tkwin, StructureNotifyMask, |
︙ | ︙ | |||
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 | static void PanedWindowWorldChanged( void *instanceData) /* Information about the paned window. */ { XGCValues gcValues; GC newGC; PanedWindow *pwPtr = (PanedWindow *)instanceData; /* * Allocated a graphics context for drawing the paned window widget * elements (background, sashes, etc.) and set the window background. */ gcValues.background = Tk_3DBorderColor(pwPtr->background)->pixel; newGC = Tk_GetGC(pwPtr->tkwin, GCBackground, &gcValues); if (pwPtr->gc != NULL) { Tk_FreeGC(pwPtr->display, pwPtr->gc); } pwPtr->gc = newGC; Tk_SetWindowBackground(pwPtr->tkwin, gcValues.background); /* * Issue geometry size requests to Tk. */ | > > | | > > > > > > | | 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 | static void PanedWindowWorldChanged( void *instanceData) /* Information about the paned window. */ { XGCValues gcValues; GC newGC; PanedWindow *pwPtr = (PanedWindow *)instanceData; int borderWidth, width = -1, height = -1; /* * Allocated a graphics context for drawing the paned window widget * elements (background, sashes, etc.) and set the window background. */ gcValues.background = Tk_3DBorderColor(pwPtr->background)->pixel; newGC = Tk_GetGC(pwPtr->tkwin, GCBackground, &gcValues); if (pwPtr->gc != NULL) { Tk_FreeGC(pwPtr->display, pwPtr->gc); } pwPtr->gc = newGC; Tk_SetWindowBackground(pwPtr->tkwin, gcValues.background); /* * Issue geometry size requests to Tk. */ Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->borderWidthObj, &borderWidth); Tk_SetInternalBorder(pwPtr->tkwin, borderWidth); if (pwPtr->widthObj) { Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->widthObj, &width); } if (pwPtr->heightObj) { Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->heightObj, &height); } if (width > 0 && height > 0) { Tk_GeometryRequest(pwPtr->tkwin, width, height); } /* * Arrange for the window to be redrawn, if neccessary. */ if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) { |
︙ | ︙ | |||
1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 | PanedWindow *pwPtr = (PanedWindow *)clientData; Pane *panePtr; Pixmap pixmap; Tk_Window tkwin = pwPtr->tkwin; int i, sashWidth, sashHeight; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); int first, last; pwPtr->flags &= ~REDRAW_PENDING; if ((pwPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } if (pwPtr->flags & REQUESTED_RELAYOUT) { | > | 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 | PanedWindow *pwPtr = (PanedWindow *)clientData; Pane *panePtr; Pixmap pixmap; Tk_Window tkwin = pwPtr->tkwin; int i, sashWidth, sashHeight; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); int first, last; int borderWidth; pwPtr->flags &= ~REDRAW_PENDING; if ((pwPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } if (pwPtr->flags & REQUESTED_RELAYOUT) { |
︙ | ︙ | |||
1476 1477 1478 1479 1480 1481 1482 1483 | pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ /* * Redraw the widget's background and border. */ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, 0, 0, | > | > | < > < > > > | | 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ /* * Redraw the widget's background and border. */ Tk_GetPixelsFromObj(NULL, tkwin, pwPtr->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth, pwPtr->relief); /* * Set up boilerplate geometry values for sashes (width, height, common * coordinates). */ Tk_GetPixelsFromObj(NULL, tkwin, pwPtr->sashWidthObj, &sashWidth); if (horizontal) { sashHeight = Tk_Height(tkwin) - (2 * Tk_InternalBorderLeft(tkwin)); } else { sashHeight = sashWidth; sashWidth = Tk_Width(tkwin) - (2 * Tk_InternalBorderLeft(tkwin)); } /* * Draw the sashes. */ GetFirstLastVisiblePane(pwPtr, &first, &last); for (i = 0; i < pwPtr->numPanes - 1; i++) { panePtr = pwPtr->panes[i]; if (panePtr->hide || i == last) { continue; } if (sashWidth > 0 && sashHeight > 0) { Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, panePtr->sashx, panePtr->sashy, sashWidth, sashHeight, 1, pwPtr->sashRelief); } if (pwPtr->showHandle) { int handleSize; Tk_GetPixelsFromObj(NULL, tkwin, pwPtr->handleSizeObj, &handleSize); Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, panePtr->handlex, panePtr->handley, handleSize, handleSize, 1, TK_RELIEF_RAISED); } } #ifndef TK_NO_DOUBLE_BUFFERING /* * Copy the information from the off-screen pixmap onto the screen, then |
︙ | ︙ | |||
1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 | int sashWidth, sashOffset, sashCount, handleOffset; int sashReserve, sxReserve, syReserve; int internalBW; int paneDynSize, paneDynMinSize, pwHeight, pwWidth, pwSize; int first, last; int stretchReserve, stretchAmount; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); pwPtr->flags &= ~(REQUESTED_RELAYOUT|RESIZE_PENDING); /* * If the parent has no panes anymore, then don't do anything at all: * just leave the parent's size as-is. Otherwise there is no way to * "relinquish" control over the parent so another geometry manager can | > | 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 | int sashWidth, sashOffset, sashCount, handleOffset; int sashReserve, sxReserve, syReserve; int internalBW; int paneDynSize, paneDynMinSize, pwHeight, pwWidth, pwSize; int first, last; int stretchReserve, stretchAmount; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); int handleSize, sashPad, handlePad; pwPtr->flags &= ~(REQUESTED_RELAYOUT|RESIZE_PENDING); /* * If the parent has no panes anymore, then don't do anything at all: * just leave the parent's size as-is. Otherwise there is no way to * "relinquish" control over the parent so another geometry manager can |
︙ | ︙ | |||
1767 1768 1769 1770 1771 1772 1773 | stretchReserve = (horizontal ? pwWidth : pwHeight); /* * Calculate the sash width, including handle and padding, and the sash * and handle offsets. */ | > | > > | < | | < | | > > > > | | > | > > | 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 | stretchReserve = (horizontal ? pwWidth : pwHeight); /* * Calculate the sash width, including handle and padding, and the sash * and handle offsets. */ Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashPadObj, &sashPad); sashOffset = handleOffset = sashPad; Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->handleSizeObj, &handleSize); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashWidthObj, &sashWidth); if (pwPtr->showHandle && handleSize > sashWidth) { sashOffset = ((handleSize - sashWidth) / 2) + sashPad; sashWidth = (2 * sashPad) + handleSize; } else { handleOffset = ((sashWidth - handleSize) / 2) + sashPad; sashWidth = (2 * sashPad) + sashWidth; } for (i = sashCount = 0; i < pwPtr->numPanes; i++) { int padX, padY, minSize; panePtr = pwPtr->panes[i]; if (panePtr->hide) { continue; } /* * Compute the total size needed by all the panes and the left-over, * or shortage of space available. */ Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padYObj, &padY); if (horizontal) { if (panePtr->width > 0) { paneSize = panePtr->width; } else { paneSize = panePtr->paneWidth; } stretchReserve -= paneSize + (2 * padX); } else { if (panePtr->height > 0) { paneSize = panePtr->height; } else { paneSize = panePtr->paneHeight; } stretchReserve -= paneSize + (2 * padY); } Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->minSizeObj, &minSize); if (IsStretchable(panePtr->stretch,i,first,last) && Tk_IsMapped(pwPtr->tkwin)) { paneDynSize += paneSize; paneDynMinSize += minSize; } if (i != last) { stretchReserve -= sashWidth; sashCount++; } } /* * Second pass; adjust/arrange panes. */ for (i = 0; i < pwPtr->numPanes; i++) { int padX, padY; panePtr = pwPtr->panes[i]; if (panePtr->hide) { Tk_UnmaintainGeometry(panePtr->tkwin, pwPtr->tkwin); Tk_UnmapWindow(panePtr->tkwin); continue; } |
︙ | ︙ | |||
1845 1846 1847 1848 1849 1850 1851 | */ doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; newPaneWidth = (panePtr->width > 0 ? panePtr->width : Tk_ReqWidth(panePtr->tkwin) + doubleBw); newPaneHeight = (panePtr->height > 0 ? panePtr->height : Tk_ReqHeight(panePtr->tkwin) + doubleBw); | | | 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 | */ doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; newPaneWidth = (panePtr->width > 0 ? panePtr->width : Tk_ReqWidth(panePtr->tkwin) + doubleBw); newPaneHeight = (panePtr->height > 0 ? panePtr->height : Tk_ReqHeight(panePtr->tkwin) + doubleBw); Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->minSizeObj, &paneMinSize); /* * Calculate pane width and height. */ if (horizontal) { if (panePtr->width > 0) { |
︙ | ︙ | |||
1876 1877 1878 1879 1880 1881 1882 | if (paneDynSize > 0) { frac = (double)paneSize / (double)paneDynSize; } else { frac = (double)paneSize / (double)pwSize; } paneDynSize -= paneSize; | | | 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 | if (paneDynSize > 0) { frac = (double)paneSize / (double)paneDynSize; } else { frac = (double)paneSize / (double)pwSize; } paneDynSize -= paneSize; paneDynMinSize -= paneMinSize; stretchAmount = (int) (frac * stretchReserve); if (paneSize + stretchAmount >= paneMinSize) { stretchReserve -= stretchAmount; paneSize += stretchAmount; } else { stretchReserve += paneSize - paneMinSize; paneSize = paneMinSize; |
︙ | ︙ | |||
1899 1900 1901 1902 1903 1904 1905 1906 1907 | stretchReserve += paneSize - paneMinSize; paneSize = paneMinSize; } else { paneSize += paneDynSize - paneDynMinSize + stretchReserve; stretchReserve = paneDynMinSize - paneDynSize; } } if (horizontal) { paneWidth = paneSize; | > > | | | 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 | stretchReserve += paneSize - paneMinSize; paneSize = paneMinSize; } else { paneSize += paneDynSize - paneDynMinSize + stretchReserve; stretchReserve = paneDynMinSize - paneDynSize; } } Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padYObj, &padY); if (horizontal) { paneWidth = paneSize; paneHeight = pwHeight - (2 * padY); } else { paneWidth = pwWidth - (2 * padX); paneHeight = paneSize; } /* * Adjust for area reserved for sashes. */ |
︙ | ︙ | |||
1946 1947 1948 1949 1950 1951 1952 1953 | panePtr->y = y; /* * Compute the location of the sash at the right or bottom of the * parcel and the location of the next parcel. */ if (horizontal) { | > | | | | | | | 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 | panePtr->y = y; /* * Compute the location of the sash at the right or bottom of the * parcel and the location of the next parcel. */ Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->handlePadObj, &handlePad); if (horizontal) { x += paneWidth + (2 * padX); if (x < internalBW) { x = internalBW; } panePtr->sashx = x + sashOffset; panePtr->sashy = y; panePtr->handlex = x + handleOffset; panePtr->handley = y + handlePad; x += sashWidth; } else { y += paneHeight + (2 * padY); if (y < internalBW) { y = internalBW; } panePtr->sashx = x; panePtr->sashy = y + sashOffset; panePtr->handlex = x + handlePad; panePtr->handley = y + handleOffset; y += sashWidth; } /* * Compute the actual dimensions of the pane in the pane. */ paneX = panePtr->x; paneY = panePtr->y; AdjustForSticky(panePtr->sticky, paneWidth, paneHeight, &paneX, &paneY, &newPaneWidth, &newPaneHeight); paneX += padX; paneY += padY; /* * Now put the window in the proper spot. */ if (newPaneWidth <= 0 || newPaneHeight <= 0 || (horizontal ? paneX - internalBW > pwWidth : |
︙ | ︙ | |||
2196 2197 2198 2199 2200 2201 2202 | static void ComputeGeometry( PanedWindow *pwPtr) /* Pointer to the Paned Window structure. */ { int i, x, y, doubleBw, internalBw; int sashWidth, sashOffset, handleOffset; | | > > > | > > | < | | < | | > > | | | | > > > | | | | | 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 | static void ComputeGeometry( PanedWindow *pwPtr) /* Pointer to the Paned Window structure. */ { int i, x, y, doubleBw, internalBw; int sashWidth, sashOffset, handleOffset; int reqWidth, reqHeight, dim, handleSize; Pane *panePtr; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); int sashPad; int width = -1, height = -1; pwPtr->flags |= REQUESTED_RELAYOUT; x = y = internalBw = Tk_InternalBorderLeft(pwPtr->tkwin); reqWidth = reqHeight = 0; /* * Sashes and handles share space on the display. To simplify processing * below, precompute the x and y offsets of the handles and sashes within * the space occupied by their combination; later, just add those offsets * blindly (avoiding the extra showHandle, etc, checks). */ Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashPadObj, &sashPad); sashOffset = handleOffset = sashPad; Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->handleSizeObj, &handleSize); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashWidthObj, &sashWidth); if (pwPtr->showHandle && handleSize > sashWidth) { sashOffset = ((handleSize - sashWidth) / 2) + sashPad; sashWidth = (2 * sashPad) + handleSize; } else { handleOffset = ((sashWidth - handleSize) / 2) + sashPad; sashWidth = (2 * sashPad) + sashWidth; } for (i = 0; i < pwPtr->numPanes; i++) { int padX, padY, minSize, handlePad; panePtr = pwPtr->panes[i]; if (panePtr->hide) { continue; } /* * First set the coordinates for the top left corner of the pane's * parcel. */ panePtr->x = x; panePtr->y = y; /* * Make sure the pane's paned dimension is at least minsize. This * check may be redundant, since the only way to change a pane's size * is by moving a sash, and that code checks the minsize. */ Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->minSizeObj, &minSize); if (horizontal) { if (panePtr->paneWidth < minSize) { panePtr->paneWidth = minSize; } } else { if (panePtr->paneHeight < minSize) { panePtr->paneHeight = minSize; } } /* * Compute the location of the sash at the right or bottom of the * parcel. */ Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padYObj, &padY); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->handlePadObj, &handlePad); if (horizontal) { x += panePtr->paneWidth + (2 * padX); panePtr->sashx = x + sashOffset; panePtr->sashy = y; panePtr->handlex = x + handleOffset; panePtr->handley = y + handlePad; x += sashWidth; } else { y += panePtr->paneHeight + (2 * padY); panePtr->sashx = x; panePtr->sashy = y + sashOffset; panePtr->handlex = x + handlePad; panePtr->handley = y + handleOffset; y += sashWidth; } /* * Find the maximum height/width of the panes, for computing the * requested height/width of the paned window. |
︙ | ︙ | |||
2292 2293 2294 2295 2296 2297 2298 | if (panePtr->height > 0) { dim = panePtr->height; } else { doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; dim = Tk_ReqHeight(panePtr->tkwin) + doubleBw; } | | | | 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 | if (panePtr->height > 0) { dim = panePtr->height; } else { doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; dim = Tk_ReqHeight(panePtr->tkwin) + doubleBw; } dim += 2 * padY; if (dim > reqHeight) { reqHeight = dim; } } else { /* * If the pane has an explicit width set use that; otherwise, use * the pane's requested width. */ if (panePtr->width > 0) { dim = panePtr->width; } else { doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; dim = Tk_ReqWidth(panePtr->tkwin) + doubleBw; } dim += 2 * padX; if (dim > reqWidth) { reqWidth = dim; } } } /* |
︙ | ︙ | |||
2333 2334 2335 2336 2337 2338 2339 2340 | * panes, plus the width of the border of the top and bottom (or left and * right) of the paned window. * * If the panedwindow has an explicit width/height set use that; * otherwise, use the requested width/height. */ if (horizontal) { | > > > > > > | | | | | | | | | 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 | * panes, plus the width of the border of the top and bottom (or left and * right) of the paned window. * * If the panedwindow has an explicit width/height set use that; * otherwise, use the requested width/height. */ if (pwPtr->widthObj) { Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->widthObj, &width); } if (pwPtr->heightObj) { Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->heightObj, &height); } if (horizontal) { reqWidth = (width > 0 ? width : x - sashWidth + internalBw); reqHeight = (height > 0 ? height : reqHeight + (2 * internalBw)); } else { reqWidth = (width > 0 ? width : reqWidth + (2 * internalBw)); reqHeight = (height > 0 ? height : y - sashWidth + internalBw); } Tk_GeometryRequest(pwPtr->tkwin, reqWidth, reqHeight); if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) { pwPtr->flags |= REDRAW_PENDING; Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); } } |
︙ | ︙ | |||
2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 | { int i; int expandPane, reduceFirst, reduceLast, reduceIncr, paneSize, sashOffset; Pane *panePtr; int stretchReserve = 0; int nextSash = sash + 1; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); if (diff == 0) return; /* * Update the pane sizes with their real sizes. */ | > | > | | > | > > > | | | 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 | { int i; int expandPane, reduceFirst, reduceLast, reduceIncr, paneSize, sashOffset; Pane *panePtr; int stretchReserve = 0; int nextSash = sash + 1; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); int handleSize, sashPad, sashWidth; if (diff == 0) return; /* * Update the pane sizes with their real sizes. */ Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->handleSizeObj, &handleSize); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashPadObj, &sashPad); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashWidthObj, &sashWidth); if (pwPtr->showHandle && handleSize > sashWidth) { sashOffset = ((handleSize - sashWidth) / 2) + sashPad; } else { sashOffset = sashPad; } for (i = 0; i < pwPtr->numPanes; i++) { int padX, padY; panePtr = pwPtr->panes[i]; if (panePtr->hide) { continue; } Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->padYObj, &padY); if (horizontal) { panePtr->paneWidth = panePtr->width = panePtr->sashx - sashOffset - panePtr->x - (2 * padX); } else { panePtr->paneHeight = panePtr->height = panePtr->sashy - sashOffset - panePtr->y - (2 * padY); } } /* * There must be a next sash since it is only possible to enter this * routine when moving an actual sash which implies there exists a visible * pane to either side of the sash. |
︙ | ︙ | |||
2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 | reduceIncr = -1; } /* * Calculate how much room we have to stretch in and adjust diff value * accordingly. */ for (i = reduceFirst; i != reduceLast; i += reduceIncr) { panePtr = pwPtr->panes[i]; if (panePtr->hide) { continue; } if (horizontal) { | > > > | | | 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 | reduceIncr = -1; } /* * Calculate how much room we have to stretch in and adjust diff value * accordingly. */ int minSize; Tk_GetPixelsFromObj(NULL, panePtr->tkwin, panePtr->minSizeObj, &minSize); for (i = reduceFirst; i != reduceLast; i += reduceIncr) { panePtr = pwPtr->panes[i]; if (panePtr->hide) { continue; } if (horizontal) { stretchReserve += panePtr->width - minSize; } else { stretchReserve += panePtr->height - minSize; } } if (stretchReserve <= 0) { return; } if (diff > stretchReserve) { diff = stretchReserve; |
︙ | ︙ | |||
2719 2720 2721 2722 2723 2724 2725 | continue; } if (horizontal) { paneSize = panePtr->width; } else { paneSize = panePtr->height; } | | | | | 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 | continue; } if (horizontal) { paneSize = panePtr->width; } else { paneSize = panePtr->height; } if (diff > (paneSize - minSize)) { diff -= paneSize - minSize; paneSize = minSize; } else { paneSize -= diff; i = reduceLast - reduceIncr; } if (horizontal) { panePtr->paneWidth = panePtr->width = paneSize; } else { |
︙ | ︙ | |||
2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 | static void DisplayProxyWindow( void *clientData) /* Information about window. */ { PanedWindow *pwPtr = (PanedWindow *)clientData; Pixmap pixmap; Tk_Window tkwin = pwPtr->proxywin; pwPtr->flags &= ~PROXY_REDRAW_PENDING; if ((tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } #ifndef TK_NO_DOUBLE_BUFFERING /* * Create a pixmap for double-buffering, if necessary. */ pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); #else pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ /* * Redraw the widget's background and border. */ | > > > | | | 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 | static void DisplayProxyWindow( void *clientData) /* Information about window. */ { PanedWindow *pwPtr = (PanedWindow *)clientData; Pixmap pixmap; Tk_Window tkwin = pwPtr->proxywin; int proxyBorderWidth; pwPtr->flags &= ~PROXY_REDRAW_PENDING; if ((tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } #ifndef TK_NO_DOUBLE_BUFFERING /* * Create a pixmap for double-buffering, if necessary. */ pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); #else pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ /* * Redraw the widget's background and border. */ Tk_GetPixelsFromObj(NULL, tkwin, pwPtr->proxyBorderWidthObj, &proxyBorderWidth); Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), proxyBorderWidth, (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->sashRelief); #ifndef TK_NO_DOUBLE_BUFFERING /* * Copy the pixmap to the display. */ |
︙ | ︙ | |||
2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 | } if (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) { return TCL_ERROR; } internalBW = Tk_InternalBorderLeft(pwPtr->tkwin); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); if (x > pwWidth) { x = pwWidth; } y = Tk_InternalBorderLeft(pwPtr->tkwin); | > < | | 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 | } if (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) { return TCL_ERROR; } internalBW = Tk_InternalBorderLeft(pwPtr->tkwin); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashWidthObj, &sashWidth); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); if (x > pwWidth) { x = pwWidth; } y = Tk_InternalBorderLeft(pwPtr->tkwin); sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderLeft(pwPtr->tkwin)); } else { if (y < 0) { y = 0; } pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); if (y > pwHeight) { y = pwHeight; } x = Tk_InternalBorderLeft(pwPtr->tkwin); sashHeight = sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - (2 * Tk_InternalBorderLeft(pwPtr->tkwin)); } if (sashWidth < 1) { sashWidth = 1; } |
︙ | ︙ | |||
3061 3062 3063 3064 3065 3066 3067 | PanedWindowIdentifyCoords( PanedWindow *pwPtr, /* Information about the widget. */ Tcl_Interp *interp, /* Interpreter in which to store result. */ int x, int y) /* Coordinates of the point to identify. */ { int i, sashHeight, sashWidth, thisx, thisy; int found, isHandle, lpad, rpad, tpad, bpad; | | > > > | < | | | | > < | | | | | | | | | | 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 | PanedWindowIdentifyCoords( PanedWindow *pwPtr, /* Information about the widget. */ Tcl_Interp *interp, /* Interpreter in which to store result. */ int x, int y) /* Coordinates of the point to identify. */ { int i, sashHeight, sashWidth, thisx, thisy; int found, isHandle, lpad, rpad, tpad, bpad; int first, last, handleSize, sashPad; Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->handleSizeObj, &handleSize); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashPadObj, &sashPad); Tk_GetPixelsFromObj(NULL, pwPtr->tkwin, pwPtr->sashWidthObj, &sashWidth); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (Tk_IsMapped(pwPtr->tkwin)) { sashHeight = Tk_Height(pwPtr->tkwin); } else { sashHeight = Tk_ReqHeight(pwPtr->tkwin); } sashHeight -= 2 * Tk_InternalBorderLeft(pwPtr->tkwin); if (pwPtr->showHandle && handleSize > sashWidth) { lpad = (handleSize - sashWidth) / 2; rpad = handleSize - lpad; lpad += sashPad; rpad += sashPad; sashWidth = handleSize; } else { lpad = rpad = sashPad; } tpad = bpad = 0; } else { if (pwPtr->showHandle && handleSize > sashWidth) { sashHeight = handleSize; tpad = (handleSize - sashWidth) / 2; bpad = handleSize - tpad; tpad += sashPad; bpad += sashPad; } else { sashHeight = sashWidth; tpad = bpad = sashPad; } if (Tk_IsMapped(pwPtr->tkwin)) { sashWidth = Tk_Width(pwPtr->tkwin); } else { sashWidth = Tk_ReqWidth(pwPtr->tkwin); } sashWidth -= 2 * Tk_InternalBorderLeft(pwPtr->tkwin); |
︙ | ︙ | |||
3123 3124 3125 3126 3127 3128 3129 | * Determine if the point is over the handle or the sash. */ if (pwPtr->showHandle) { thisx = pwPtr->panes[i]->handlex; thisy = pwPtr->panes[i]->handley; if (pwPtr->orient == ORIENT_HORIZONTAL) { | | | | 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 | * Determine if the point is over the handle or the sash. */ if (pwPtr->showHandle) { thisx = pwPtr->panes[i]->handlex; thisy = pwPtr->panes[i]->handley; if (pwPtr->orient == ORIENT_HORIZONTAL) { if (thisy <= y && y <= (thisy + handleSize)) { isHandle = 1; } } else { if (thisx <= x && x <= (thisx + handleSize)) { isHandle = 1; } } } break; } } |
︙ | ︙ |