WidgetGetX

Syntax

X.d = WidgetGetX(Widget, ReturnLayoutDefined=#False)

Description

Retrieves the current horizontal position (X coordinate) of the specified widget's top-left corner in device-independent pixels (DIPs), relative to its parent layout container's client area (inside padding). Optionally, it can return the initial X value specified during creation (only relevant for Basic layouts).

Parameters

Widget
The handle of the ProGUI widget whose X coordinate is to be retrieved.

ReturnLayoutDefined (optional)
If set to #True, the function returns the initial X value set during CreateWidget() or via WidgetResize(). If #False (default), returns the actual calculated X position determined by the layout engine.

Return Value

Returns the requested X coordinate as a floating-point number (Double) in DIPs. Returns 0.0 or #False if the widget handle is invalid.

Remarks

The actual rendered position (`ReturnLayoutDefined = #False`) is determined by the parent layout engine (Basic, Flexbox, or Grid) based on the widget's properties (margins, size, etc.) and the layout's rules. The layout-defined position (`ReturnLayoutDefined = #True`) is generally only meaningful for widgets within a Basic layout.

See Also

WidgetGetY, WidgetGetWidth, WidgetGetHeight, WidgetResize, CreateWidget

Supported OS

Windows, Linux