Blitz3D+ Command Reference

SetGadgetShape gadget,x,y,width,height

Parameters

gadget - gadget to move and resize

x,y - new position of the top-left corner

width,height - new size

Description

Moves and resizes a gadget in one call.

Coordinates are 96-DPI logical pixels, relative to the client area of the gadget's group - the window's interior for a top-level gadget, or the inside of its panel, group box, splitter pane or tabber page. For a window, x and y are desktop coordinates instead. The GUI itself handles per-monitor DPI scaling, so the same numbers look right everywhere.

Use it for manual layout moments the automatic rules cannot express - positioning a preview swatch from spin box values, or arranging children after reading ClientWidth/ClientHeight. Moving a gadget this way also re-baselines its SetGadgetLayout rules to the new shape, so shape first, layout second.

Read the current geometry back with GadgetX, GadgetY, GadgetWidth and GadgetHeight.

For combo boxes, height describes the closed control including its border, with a minimum that fits the font and icons. It does not set the popup list height.

See it working in the native input controls sample.

Requires Extended mode.

See also: SetGadgetLayout, GadgetX, GadgetY, GadgetWidth, GadgetHeight, ClientWidth.

Index