Download Now
Forums

    Reference TSimpleWidgetScene

    Declared in Codebot.Render.Scenes.Widgets.pas on line 66

    TSimpleWidgetScene is a widget scene which needs no Render method. It clears the scene and draws the widgets each frame, and the first time it renders it places the widgets added to Widget in the middle of the scene. They are placed once, so a window can still be dragged from there. Widgets with a Sector are left where their sector puts them.
    CloseEvent can be given to the OnClick of a button or the OnClose of a window to end the program.
      TSimpleWidgetScene = class(TWidgetScene)
      protected
        { Place the widgets added to Widget in the middle of the scene }
        procedure CenterWidgets;
      public
        procedure Render; override;
        { An event handler which closes the window of the host }
        procedure CloseHandler(Sender: TObject);
      end;

    See also