Blitz3D+ Command Reference

CreatePanel ( x,y,width,height,group[,style] )

Parameters

x,y - position of the panel's top-left corner within the group's client area

width,height - size of the panel

group - window or gadget group that owns the panel

style (optional) - 0: plain (default); bit 1: sunken client edge border

Description

Creates a plain panel gadget that can hold other gadgets, and returns its handle.

Requires Extended language mode.

A panel is the unframed building block of tool layouts: a true group you pass as the group parameter of other Create commands. The world editor shell builds its whole scene-hierarchy sidebar this way - a panel holding a label and a tree view, laid out relative to the panel's client area.

Give it a background colour with SetPanelColor or an image with SetPanelImage. Because a coloured panel is just a rectangle, panels also make handy visual stand-ins - the native input controls sample moves and resizes one with SetGadgetShape as its preview object.

Like any group, freeing a panel with FreeGadget frees every gadget inside it, and SetGadgetLayout lets the panel (and therefore its contents) follow window resizes. Use CreateGroupBox instead when you want a caption and frame around the cluster.

See it working in the world editor shell sample and the native input controls sample.

See also: SetPanelColor, SetPanelImage, CreateGroupBox, SetGadgetShape, ClientWidth, FreeGadget.

Index