diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-26 10:13:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-26 10:13:04 (GMT) |
commit | 4d4bf9a051a30dad87a2b518e2641851b702dd3c (patch) | |
tree | 1566ff74caf52d519b52c4e823f7ab28ca15b54e /generic/ttk/ttkPanedwindow.c | |
parent | 632866365dc6bc82d38d23624c3ca69966bd8aaa (diff) | |
parent | 22438af8abfb0b3cc6f608bd906d804bae7cc4de (diff) | |
download | tk-4d4bf9a051a30dad87a2b518e2641851b702dd3c.zip tk-4d4bf9a051a30dad87a2b518e2641851b702dd3c.tar.gz tk-4d4bf9a051a30dad87a2b518e2641851b702dd3c.tar.bz2 |
Merge trunk
Diffstat (limited to 'generic/ttk/ttkPanedwindow.c')
-rw-r--r-- | generic/ttk/ttkPanedwindow.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 77e5b4e..105f823 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -206,7 +206,7 @@ static int ShoveUp(Paned *pw, int i, int pos) * Same as ShoveUp, but going in the opposite direction * and stopping at the sentinel sash. */ -static int ShoveDown(Paned *pw, int i, int pos) +static int ShoveDown(Paned *pw, TkSizeT i, int pos) { Pane *pane = (Pane *)Ttk_SlaveData(pw->paned.mgr,i); int sashThickness = pw->paned.sashThickness; @@ -275,7 +275,7 @@ static void AdjustPanes(Paned *pw) { int sashThickness = pw->paned.sashThickness; int pos = 0; - int index; + TkSizeT index; for (index = 0; index < Ttk_NumberSlaves(pw->paned.mgr); ++index) { Pane *pane = (Pane *)Ttk_SlaveData(pw->paned.mgr, index); @@ -372,7 +372,7 @@ static void PlacePanes(Paned *pw) int width = Tk_Width(pw->core.tkwin), height = Tk_Height(pw->core.tkwin); int sashThickness = pw->paned.sashThickness; int pos = 0; - int index; + TkSizeT index; for (index = 0; index < Ttk_NumberSlaves(pw->paned.mgr); ++index) { Pane *pane = (Pane *)Ttk_SlaveData(pw->paned.mgr, index); @@ -403,7 +403,7 @@ static void PanedPlaceSlaves(void *managerData) PlacePanes(pw); } -static void PaneRemoved(void *managerData, int index) +static void PaneRemoved(void *managerData, TkSizeT index) { Paned *pw = (Paned *)managerData; Pane *pane = (Pane *)Ttk_SlaveData(pw->paned.mgr, index); @@ -419,7 +419,7 @@ static int AddPane( if (!Ttk_Maintainable(interp, slaveWindow, pw->core.tkwin)) { return TCL_ERROR; } - if (Ttk_SlaveIndex(pw->paned.mgr, slaveWindow) >= 0) { + if (Ttk_SlaveIndex(pw->paned.mgr, slaveWindow) != TCL_INDEX_NONE) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s already added", Tk_PathName(slaveWindow))); Tcl_SetErrorCode(interp, "TTK", "PANE", "PRESENT", NULL); @@ -445,7 +445,7 @@ static int AddPane( * in order to avoid unexpected pane resizes (esp. while the * user is dragging a sash [#1325286]). */ -static int PaneRequest(void *managerData, int index, int width, int height) +static int PaneRequest(void *managerData, TkSizeT index, int width, int height) { Paned *pw = (Paned *)managerData; Pane *pane = (Pane *)Ttk_SlaveData(pw->paned.mgr, index); @@ -604,11 +604,11 @@ static void DrawSash(Paned *pw, int index, Drawable d) static void PanedDisplay(void *recordPtr, Drawable d) { Paned *pw = (Paned *)recordPtr; - int i, nSashes = Ttk_NumberSlaves(pw->paned.mgr) - 1; + TkSizeT i, nSlaves = Ttk_NumberSlaves(pw->paned.mgr); TtkWidgetDisplay(recordPtr, d); - for (i = 0; i < nSashes; ++i) { - DrawSash(pw, i, d); + for (i = 1; i < nSlaves; ++i) { + DrawSash(pw, i - 1, d); } } @@ -744,7 +744,7 @@ static int PanedIdentifyCommand( /* Found it. */ switch (what) { case IDENTIFY_SASH: - Tcl_SetObjResult(interp, Tcl_NewIntObj(index)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index)); return TCL_OK; case IDENTIFY_ELEMENT: { @@ -809,7 +809,7 @@ static int PanedPanesCommand( Paned *pw = (Paned *)recordPtr; Ttk_Manager *mgr = pw->paned.mgr; Tcl_Obj *panes; - int i; + TkSizeT i; if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, ""); @@ -844,7 +844,7 @@ static int PanedSashposCommand( if (Tcl_GetIntFromObj(interp, objv[2], &sashIndex) != TCL_OK) { return TCL_ERROR; } - if (sashIndex < 0 || sashIndex >= Ttk_NumberSlaves(pw->paned.mgr) - 1) { + if (sashIndex < 0 || (TkSizeT)(sashIndex + 1) >= Ttk_NumberSlaves(pw->paned.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "sash index %d out of range", sashIndex)); Tcl_SetErrorCode(interp, "TTK", "PANE", "SASH_INDEX", NULL); @@ -854,7 +854,7 @@ static int PanedSashposCommand( pane = (Pane *)Ttk_SlaveData(pw->paned.mgr, sashIndex); if (objc == 3) { - Tcl_SetObjResult(interp, Tcl_NewIntObj(pane->sashPos)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(pane->sashPos)); return TCL_OK; } /* else -- set new sash position */ @@ -872,7 +872,7 @@ static int PanedSashposCommand( AdjustPanes(pw); Ttk_ManagerLayoutChanged(pw->paned.mgr); - Tcl_SetObjResult(interp, Tcl_NewIntObj(pane->sashPos)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(pane->sashPos)); return TCL_OK; } |