GraphFrame
GraphEdit grouping frame with a title and automatic enclosing-size settings.
GraphFrame and its grouped GraphElement objects remain direct children of the same GraphEdit. Link them with GraphEdit.AttachGraphElementToFrame using element/frame Name values; unlink with DetachGraphElementFromFrame. This is a graph relationship rather than Reparent or memory ownership. Merely placing elements inside the rectangle does not establish membership.
Title is the visible caption, separate from Entity.Name used by relationships. Do not use the displayed title as a key. Update your model and links when renaming identifiers; change only Title for a new caption.
AutoshrinkEnabled defaults to true: GraphEdit computes an enclosing frame around attached elements using AutoshrinkMargin. This does not fit the frame around tree children. For manual sizing, disable AutoshrinkEnabled and enable inherited Resizable; content constraints and GraphEdit snapping may still restrict size.
Installed SDK 1.0.0 has an AutoshrinkChanged mismatch: the C# event declares no arguments, but the native signal carries a Vector2 size. Ordinary += subscription causes an argument-count error. If the application needs this notification, use Connect(GraphFrame.SignalName.AutoshrinkChanged, Callable.From<Vector2>(handler)), with a Vector2 handler. Retain the same Callable for Disconnect. This works around the SDK limitation rather than fixing the engine.
GetTitlebarHBox returns the frame-owned internal container. You can add your button to it, but must not free or reparent the container itself. TintColorEnabled enables the custom body tint; assigning TintColor alone does not enable it. DragMargin sets the edge grab region width, separate from the outer AutoshrinkMargin. The whole frame interior is not a grab button.
Freeing the frame does not mean deleting grouped elements: they belong to GraphEdit. When removing a group, decide whether its model elements survive, remove links, and explicitly free the required objects.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
GraphFrameConstructor
public GraphFrame();Creates a frame: AutoshrinkEnabled = true, AutoshrinkMargin = 40, DragMargin = 16, TintColorEnabled = false. The built-in titlebar belongs to the frame.
Properties6
AutoshrinkEnabledProperty
public bool AutoshrinkEnabled { get; set; }Allows GraphEdit to enclose attached elements automatically, default true. Disable for manual sizing; this neither reparents nor automatically deletes elements.
AutoshrinkMarginProperty
public int AutoshrinkMargin { get; set; }Margin around attached elements in graph coordinates, default 40. Use a nonnegative value. A change emits native AutoshrinkChanged.
DragMarginProperty
public int DragMargin { get; set; }Edge grab region width in frame-local units, default 16. Neither the outer enclosing margin nor child-container padding.
TintColorProperty
public Color TintColor { get; set; }Stored custom body tint. Assignment neither enables TintColorEnabled nor modifies the shared theme resource; drawing depends on the StyleBox.
TintColorEnabledProperty
public bool TintColorEnabled { get; set; }Enables the custom frame-body tint, default false. Does not change selection or set the title text color.
TitleProperty
public string Title { get; set; }Visible frame caption, independent of Entity.Name and GraphEdit membership keys.
Methods13
GetAutoshrinkMarginint
public int GetAutoshrinkMargin();Margin around attached elements in graph coordinates, default 40. Use a nonnegative value. A change emits native AutoshrinkChanged.
intMargin around attached elements in graph coordinates, default 40. Use a nonnegative value. A change emits native AutoshrinkChanged.
GetDragMarginint
public int GetDragMargin();Edge grab region width in frame-local units, default 16. Neither the outer enclosing margin nor child-container padding.
intEdge grab region width in frame-local units, default 16. Neither the outer enclosing margin nor child-container padding.
GetTintColorColor
public Color GetTintColor();Stored custom body tint. Assignment neither enables TintColorEnabled nor modifies the shared theme resource; drawing depends on the StyleBox.
ColorStored custom body tint. Assignment neither enables TintColorEnabled nor modifies the shared theme resource; drawing depends on the StyleBox.
GetTitlestring
public string GetTitle();Visible frame caption, independent of Entity.Name and GraphEdit membership keys.
stringVisible frame caption, independent of Entity.Name and GraphEdit membership keys.
GetTitlebarHBoxHBoxContainer
public HBoxContainer GetTitlebarHBox();Returns the frame-owned internal HBoxContainer. Add your controls, but do not free or reparent the container itself.
HBoxContainerReturns the frame-owned internal HBoxContainer. Add your controls, but do not free or reparent the container itself.
IsAutoshrinkEnabledbool
public bool IsAutoshrinkEnabled();Allows GraphEdit to enclose attached elements automatically, default true. Disable for manual sizing; this neither reparents nor automatically deletes elements.
boolAllows GraphEdit to enclose attached elements automatically, default true. Disable for manual sizing; this neither reparents nor automatically deletes elements.
IsTintColorEnabledbool
public bool IsTintColorEnabled();Enables the custom frame-body tint, default false. Does not change selection or set the title text color.
boolEnables the custom frame-body tint, default false. Does not change selection or set the title text color.
SetAutoshrinkEnabledvoid
public void SetAutoshrinkEnabled(bool shrink);Allows GraphEdit to enclose attached elements automatically, default true. Disable for manual sizing; this neither reparents nor automatically deletes elements.
| Name | Type | Default |
|---|---|---|
shrink | bool | — |
shrinkAllows GraphEdit to enclose attached elements automatically, default true. Disable for manual sizing; this neither reparents nor automatically deletes elements.
SetAutoshrinkMarginvoid
public void SetAutoshrinkMargin(int autoshrinkMargin);Margin around attached elements in graph coordinates, default 40. Use a nonnegative value. A change emits native AutoshrinkChanged.
| Name | Type | Default |
|---|---|---|
autoshrinkMargin | int | — |
autoshrinkMarginMargin around attached elements in graph coordinates, default 40. Use a nonnegative value. A change emits native AutoshrinkChanged.
SetDragMarginvoid
public void SetDragMargin(int dragMargin);Edge grab region width in frame-local units, default 16. Neither the outer enclosing margin nor child-container padding.
| Name | Type | Default |
|---|---|---|
dragMargin | int | — |
dragMarginEdge grab region width in frame-local units, default 16. Neither the outer enclosing margin nor child-container padding.
SetTintColorvoid
public void SetTintColor(Color color);Stored custom body tint. Assignment neither enables TintColorEnabled nor modifies the shared theme resource; drawing depends on the StyleBox.
| Name | Type | Default |
|---|---|---|
color | Color | — |
colorStored custom body tint. Assignment neither enables TintColorEnabled nor modifies the shared theme resource; drawing depends on the StyleBox.
SetTintColorEnabledvoid
public void SetTintColorEnabled(bool enable);Enables the custom frame-body tint, default false. Does not change selection or set the title text color.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableEnables the custom frame-body tint, default false. Does not change selection or set the title text color.
SetTitlevoid
public void SetTitle(string title);Visible frame caption, independent of Entity.Name and GraphEdit membership keys.
| Name | Type | Default |
|---|---|---|
title | string | — |
titleVisible frame caption, independent of Entity.Name and GraphEdit membership keys.
Signals and events1
AutoshrinkChangedEvent
public event Action AutoshrinkChanged;Installed SDK 1.0.0 limitation: the C# event has no arguments, while the native signal carries Vector2. Ordinary += subscription causes an argument-count error. Use Connect with Callable.From<Vector2>(handler) and GraphFrame.SignalName.AutoshrinkChanged; reread the frame settings.
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
resizer_colorColor | The color modulation applied to the resizer icon. Default:Color(0.875, 0.875, 0.875, 1) |
panelStyleBox | The default |
panel_selectedStyleBox | The |
titlebarStyleBox | The |
titlebar_selectedStyleBox | The |