mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-24 00:10:10 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
43 lines
697 B
C#
43 lines
697 B
C#
using System;
|
|
|
|
namespace Editor
|
|
{
|
|
/// <summary>
|
|
/// Like a widget - but is drawn
|
|
/// </summary>
|
|
public class Frame : Widget
|
|
{
|
|
internal Native.QFrame _frame;
|
|
internal Frame() : base( false )
|
|
{
|
|
|
|
}
|
|
|
|
internal Frame( IntPtr widget ) : base( false )
|
|
{
|
|
NativeInit( widget );
|
|
}
|
|
|
|
public Frame( Widget parent ) : base( false )
|
|
{
|
|
Sandbox.InteropSystem.Alloc( this );
|
|
var widget = CFrame.CreateFrame( parent?._widget ?? default, this );
|
|
NativeInit( widget );
|
|
}
|
|
|
|
internal override void NativeInit( IntPtr ptr )
|
|
{
|
|
_frame = ptr;
|
|
|
|
base.NativeInit( ptr );
|
|
}
|
|
|
|
internal override void NativeShutdown()
|
|
{
|
|
_frame = default;
|
|
|
|
base.NativeShutdown();
|
|
}
|
|
}
|
|
}
|