diff options
Diffstat (limited to 'generic/tkPanedWindow.c')
-rw-r--r-- | generic/tkPanedWindow.c | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index d7f2d45..b244c9a 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -86,7 +86,7 @@ typedef struct Pane { * the x dimension. */ int pady; /* Additional padding requested for pane, in * the y dimension. */ - Tcl_Obj *widthPtr, *heightPtr; + Tcl_Obj *widthObj, *heightObj; /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ int width; /* Pane width. */ @@ -125,8 +125,8 @@ typedef struct PanedWindow { Tk_3DBorder background; /* Background color. */ int borderWidth; /* Value of -borderwidth option. */ int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */ - Tcl_Obj *widthPtr; /* Tcl_Obj rep for width. */ - Tcl_Obj *heightPtr; /* Tcl_Obj rep for height. */ + Tcl_Obj *widthObj; /* Tcl_Obj rep for width. */ + Tcl_Obj *heightObj; /* Tcl_Obj rep for height. */ int width, height; /* Width and height of the widget. */ enum orient orient; /* Orientation of the widget. */ Tk_Cursor cursor; /* Current cursor for window, or None. */ @@ -291,7 +291,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), offsetof(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightPtr), + DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightObj), offsetof(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", DEF_PANEDWINDOW_OPAQUERESIZE, TCL_INDEX_NONE, @@ -326,7 +326,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_SHOWHANDLE, TCL_INDEX_NONE, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthPtr), + DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthObj), offsetof(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -339,7 +339,7 @@ static const Tk_OptionSpec paneOptionSpecs[] = { 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, heightPtr), + 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}, @@ -356,7 +356,7 @@ static const Tk_OptionSpec paneOptionSpecs[] = { DEF_PANEDWINDOW_PANE_STRETCH, TCL_INDEX_NONE, offsetof(Pane, stretch), TK_OPTION_ENUM_VAR, stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, - DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Pane, widthPtr), + DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Pane, widthObj), offsetof(Pane, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -674,7 +674,7 @@ PanedWindowWidgetObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "not managed by this window", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", - NULL); + (char *)NULL); } result = TCL_ERROR; } else { @@ -693,15 +693,15 @@ PanedWindowWidgetObjCmd( if (objc <= 4) { tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), pwPtr->tkwin); - if (tkwin == NULL) { - /* - * Just a plain old bad window; Tk_NameToWindow filled in an - * error message for us. - */ - - result = TCL_ERROR; - break; - } + if (tkwin == NULL) { + /* + * Just a plain old bad window; Tk_NameToWindow filled in an + * error message for us. + */ + + result = TCL_ERROR; + break; + } for (i = 0; i < pwPtr->numPanes; i++) { if (pwPtr->panes[i]->tkwin == tkwin) { resultObj = Tk_GetOptionInfo(interp, @@ -799,7 +799,7 @@ ConfigurePanes( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add %s to itself", arg)); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } else if (Tk_IsTopLevel(tkwin)) { /* @@ -809,7 +809,7 @@ ConfigurePanes( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add toplevel %s to %s", arg, Tk_PathName(pwPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } else { /* @@ -827,7 +827,7 @@ ConfigurePanes( "can't add %s to %s", arg, Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", - "HIERARCHY", NULL); + "HIERARCHY", (char *)NULL); return TCL_ERROR; } } @@ -887,7 +887,7 @@ ConfigurePanes( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" is not managed by %s", Tk_PathName(tkwin), Tk_PathName(pwPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", NULL); + Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", (char *)NULL); Tk_FreeConfigOptions(&options, pwPtr->paneOpts, pwPtr->tkwin); return TCL_ERROR; @@ -1127,7 +1127,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } panePtr = pwPtr->panes[sash]; @@ -1150,7 +1150,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } @@ -1186,7 +1186,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } @@ -1369,17 +1369,17 @@ PanedWindowEventProc( } else if (eventPtr->type == DestroyNotify) { DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { - for (i = 0; i < pwPtr->numPanes; i++) { - if (!pwPtr->panes[i]->hide) { - Tk_UnmapWindow(pwPtr->panes[i]->tkwin); - } - } + for (i = 0; i < pwPtr->numPanes; i++) { + if (!pwPtr->panes[i]->hide) { + Tk_UnmapWindow(pwPtr->panes[i]->tkwin); + } + } } else if (eventPtr->type == MapNotify) { - for (i = 0; i < pwPtr->numPanes; i++) { - if (!pwPtr->panes[i]->hide) { - Tk_MapWindow(pwPtr->panes[i]->tkwin); - } - } + for (i = 0; i < pwPtr->numPanes; i++) { + if (!pwPtr->panes[i]->hide) { + Tk_MapWindow(pwPtr->panes[i]->tkwin); + } + } } } @@ -1789,18 +1789,18 @@ ArrangePanes( */ if (horizontal) { - if (panePtr->width > 0) { - paneSize = panePtr->width; - } else { - paneSize = panePtr->paneWidth; - } + if (panePtr->width > 0) { + paneSize = panePtr->width; + } else { + paneSize = panePtr->paneWidth; + } stretchReserve -= paneSize + (2 * panePtr->padx); } else { - if (panePtr->height > 0) { - paneSize = panePtr->height; - } else { - paneSize = panePtr->paneHeight; - } + if (panePtr->height > 0) { + paneSize = panePtr->height; + } else { + paneSize = panePtr->paneHeight; + } stretchReserve -= paneSize + (2 * panePtr->pady); } if (IsStretchable(panePtr->stretch,i,first,last) @@ -1850,18 +1850,18 @@ ArrangePanes( */ if (horizontal) { - if (panePtr->width > 0) { - paneSize = panePtr->width; - } else { - paneSize = panePtr->paneWidth; - } + if (panePtr->width > 0) { + paneSize = panePtr->width; + } else { + paneSize = panePtr->paneWidth; + } pwSize = pwWidth; } else { - if (panePtr->height > 0) { - paneSize = panePtr->height; - } else { - paneSize = panePtr->paneHeight; - } + if (panePtr->height > 0) { + paneSize = panePtr->height; + } else { + paneSize = panePtr->paneHeight; + } pwSize = pwHeight; } if (IsStretchable(panePtr->stretch, i, first, last)) { @@ -2491,7 +2491,7 @@ SetSticky( "bad stickyness value \"%s\": must be a string" " containing zero or more of n, e, s, and w", Tcl_GetString(*value))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", (char *)NULL); return TCL_ERROR; } } @@ -2907,16 +2907,16 @@ PanedWindowProxyCommand( return TCL_ERROR; } - internalBW = Tk_InternalBorderLeft(pwPtr->tkwin); + 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); + pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); + if (x > pwWidth) { + x = pwWidth; + } + y = Tk_InternalBorderLeft(pwPtr->tkwin); sashWidth = pwPtr->sashWidth; sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderLeft(pwPtr->tkwin)); @@ -2924,10 +2924,10 @@ PanedWindowProxyCommand( if (y < 0) { y = 0; } - pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); - if (y > pwHeight) { - y = pwHeight; - } + pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); + if (y > pwHeight) { + y = pwHeight; + } x = Tk_InternalBorderLeft(pwPtr->tkwin); sashHeight = pwPtr->sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - |