LayoutGetType

Syntax

LayoutType = LayoutGetType(Layout)

Description

Retrieves the current layout engine type used by the specified layout container.

Parameters

Layout
The handle of the layout object whose type is to be retrieved. If #Null, it attempts to use the current layout (see LayoutGetCurrent()).

Return Value

Returns one of the layout type constants if successful:

#PG_Layout_Type_Basic
#PG_Layout_Type_Flex
#PG_Layout_Type_Grid

Returns #False if the layout handle is invalid.

Remarks

This function allows you to check the current layout algorithm being used by a container, which can be useful before applying layout-specific commands (e.g., checking if a layout is Flex before calling LayoutFlexSetDirection()).

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyWindow = CreateWindow(0, 0, 400, 300, "Get Layout Type")

If MyWindow
  RootLayout = WindowGetLayout(MyWindow)
  InitialType = LayoutGetType(RootLayout)
  Debug "Initial Root Layout Type: " + InitialType

  LayoutSetType(RootLayout, #PG_Layout_Type_Grid)
  NewType = LayoutGetType(RootLayout)
  Debug "New Root Layout Type: " + NewType

  WindowShow(MyWindow, #True, #PG_Window_ScreenCentered)

  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

StopProGUI()

See Also

CreateLayout, LayoutSetType

Supported OS

Windows, Linux