Syntax
Success = LayoutGridSetColumnDefault(Layout, Size.d, isPercent.b=#False)Description
Sets the default template size used for grid columns that are not explicitly defined using LayoutGridSetColumn().
Parameters
Layout
The handle of the Grid layout object. If #Null, it targets
the current layout.
Size.d
The default size for columns. Can be:
- A specific value (DIPs).
#PG_Grid_Auto: Default size is determined by the largest content (min or max) within the column. (Initial Default)#PG_Grid_MaxContent: Default size is determined by the largest intrinsic max-content size of items in the column.
isPercent.b (optional)
If #True and Size is a numeric value, the size
is treated as a percentage of the layout container's width. Default is
#False.
Return Value
Returns #True if the default column size was
successfully set, or #False if the layout handle or size
was invalid.
Remarks
This property only applies to layouts whose type is
#PG_Layout_Type_Grid. It provides a fallback size for
columns beyond the explicitly defined grid template or for items placed
in columns without an explicit template definition.
Example
IncludeFile "ProGUI_PB.pbi"
StartProGUI()
MyWindow = CreateWindow(0, 0, 500, 300, "Grid Columns", #PG_Window_Default | #PG_Window_LayoutGrid) ; Create with a grid layout
If MyWindow
LayoutSetPadding(#Null, 10) ; Set the current layout padding
LayoutGridSetGapSize(#Null, 10) ; Add gaps
LayoutGridSetColumnDefault(#Null, 50) ; Set the default column size
; Add widgets to the grid
Widget1 = CreateWidget(0, 0, 0, 50)
Widget2 = CreateWidget(0, 0, 0, 50) : WidgetSetColumnStart(Widget1, 2)
Widget3 = CreateWidget(0, 0, 0, 50) : WidgetSetColumnStart(Widget1, 3)
WindowShow(MyWindow, #True, #PG_WindowShow_ScreenCentered)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
StopProGUI()See Also
LayoutSetType, LayoutGridGetColumnDefault, LayoutGridSetColumn, LayoutGridSetColumnMinDefault, LayoutGridSetColumnMaxDefault, LayoutGridSetRowDefault
Supported OS
Windows, Linux