/* SashLayout -- * Place the sash sublayout after the specified pane, * in preparation for drawing. */ static Ttk_Layout SashLayout(Paned *pw, int index) { Pane *pane = Ttk_SlaveData(pw->paned.mgr, index); int thickness = pw->paned.sashThickness, height = Tk_Height(pw->core.tkwin), width = Tk_Width(pw->core.tkwin), sashPos = pane->sashPos; Ttk_PlaceLayout( pw->paned.sashLayout, pw->core.state, pw->paned.orient == TTK_ORIENT_HORIZONTAL ? Ttk_MakeBox(sashPos, 0, thickness, height) : Ttk_MakeBox(0, sashPos, width, thickness)); return pw->paned.sashLayout; }
static void ImageElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { ImageData *imageData = clientData; Tk_Image image = 0; int imgWidth, imgHeight; Ttk_Box src, dst; #if TILE_07_COMPAT if (imageData->imageMap) { Tcl_Obj *imageObj = Ttk_StateMapLookup(NULL,imageData->imageMap,state); if (imageObj) { image = Ttk_UseImage(imageData->cache, tkwin, imageObj); } } if (!image) { image = TtkSelectImage(imageData->imageSpec, state); } #else image = TtkSelectImage(imageData->imageSpec, state); #endif if (!image) { return; } Tk_SizeOfImage(image, &imgWidth, &imgHeight); src = Ttk_MakeBox(0, 0, imgWidth, imgHeight); dst = Ttk_StickBox(b, imgWidth, imgHeight, imageData->sticky); Ttk_Tile(tkwin, d, image, src, dst, imageData->border); }
static Ttk_Box packRight(Ttk_Box *cavity, int width) { width = MIN(width, cavity->width); cavity->width -= width; return Ttk_MakeBox(cavity->x + cavity->width, cavity->y, width, cavity->height); }
static Ttk_Box packBottom(Ttk_Box *cavity, int height) { height = MIN(height, cavity->height); cavity->height -= height; return Ttk_MakeBox( cavity->x, cavity->y + cavity->height, cavity->width, height); }
static Ttk_Box packLeft(Ttk_Box *cavity, int width) { Ttk_Box parcel; width = MIN(width, cavity->width); parcel = Ttk_MakeBox(cavity->x, cavity->y, width,cavity->height); cavity->x += width; cavity->width -= width; return parcel; }
static Ttk_Box packTop(Ttk_Box *cavity, int height) { Ttk_Box parcel; height = MIN(height, cavity->height); parcel = Ttk_MakeBox(cavity->x, cavity->y, cavity->width, height); cavity->y += height; cavity->height -= height; return parcel; }
/* LabelframeInitialize -- * Initialization hook. */ static void LabelframeInitialize(Tcl_Interp *interp, void *recordPtr) { Labelframe *lframe = recordPtr; lframe->label.mgr = Ttk_CreateManager( &LabelframeManagerSpec, lframe, lframe->core.tkwin); lframe->label.labelWidget = 0; lframe->label.labelLayout = 0; lframe->label.labelParcel = Ttk_MakeBox(-1,-1,-1,-1); }
static Ttk_Box BPadding(Ttk_Box b, Ttk_Padding p) { return Ttk_MakeBox(b.x, b.y+b.height-p.bottom, b.width, p.bottom); }
static Ttk_Box MPadding(Ttk_Box b, Ttk_Padding p) { return Ttk_MakeBox(b.x, b.y+p.top, b.width, b.height-p.top-p.bottom); }
/* TPadding, MPadding, BPadding -- * Split a box+padding pair into top, middle, and bottom parts. */ static Ttk_Box TPadding(Ttk_Box b, Ttk_Padding p) { return Ttk_MakeBox(b.x, b.y, b.width, p.top); }
static Ttk_Box RPadding(Ttk_Box b, Ttk_Padding p) { return Ttk_MakeBox(b.x+b.width-p.right, b.y, p.right, b.height); }
static Ttk_Box CPadding(Ttk_Box b, Ttk_Padding p) { return Ttk_MakeBox(b.x+p.left, b.y, b.width-p.left-p.right, b.height); }
/* LPadding, CPadding, RPadding -- * Split a box+padding pair into left, center, and right boxes. */ static Ttk_Box LPadding(Ttk_Box b, Ttk_Padding p) { return Ttk_MakeBox(b.x, b.y, p.left, b.height); }