Unit 'MUIClass.Base' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#MUIClass]

TMUIWithParent.Parent

Parent of the Object

Declaration

Source position: MUIClass.Base.pas line 293

public property TMUIWithParent.Parent : TMUINotify
  read FParent
  write SetParent;

Description

if the parent MUI object gets destroyed, this one also gets destroyed. If the parent Object is destroyed this object is also destroyed. Unlink the Parent by setting it to nil. An Object without Parent you have to destroy yourself at the end of the program.

Example:

constructor TMyWindow.Create;
var
  Grp: TMUIGroup;
begin
  inherited;
  Grp := TMUIGroup.Create; // create a group
  Grp.Horizontal := True;  // make it horizontal
  Grp.Parent := Self;      // put the Group into the Window
  //
  or := 1 to 3 do      // Create some Buttons
  begin
    with TMUIButton.Create do
    begin
      Contents := 'Button ' + IntToStr(i); // proper names
      Parent := Grp;       // put into the Group, therefore next to each other
    end;
  end;
  //
  with TMUIText.Create do        // Put a text under the Buttons
  begin
    Contents := 'Example Text'; // just some text
    Parent := Self;             // put into the Window (the window is by default a vertical group)
  end;
end;

Documentation generated on: 2024-03-29