Class TInsertPanelWizard (unit PanelWiz)

Inherits from

TEtkModule

Insert a panel as the parent of the selected components. The size of the new panel is set to fit around the selected components. If the selection is a single control with an Align property, set the Align property to alClient, so it always fills the new panel. Copyright © 1998 Tempest Software, Inc.

Constructors



Functions

procedure EditInsertPanelClick(Sender: TObject);

The user selected the Insert Panel menu item.

procedure ChangeParent(Control, Parent: TIComponentInterface);

so a smart user can change the control type } { Change the Parent property of a control.

function GetBounds(Control: TIComponentInterface; var Rect: TRect): Boolean;

Get the bounds of a control and store them in Rect.

function GetInteger(Component: TIComponentInterface; const PropName: string; var Value: Integer): Boolean;

Get an integer property.

function GetParent(Form: TIFormInterface; Control: TIComponentInterface): TIComponentInterface;

TIComponentInterface.

procedure InsertParent(Form: TIFormInterface);

Insert a TPanel as the parent control of the current selection.

procedure Reposition(Control, Parent: TIComponentInterface);

Change the Left and Top properties of Control so they are relative to the positon of Parent.

function SelectionIsForm(Form: TIFormInterface; Selection: TIComponentInterface): Boolean;

Return True if Selection is the form component, which means the user has not selected any real components.

procedure SetAlign(Selection: TIComponentInterface);

Set the Align property of the old selection to alClient, so it completely fills the new panel.

Properties

Events

Variables

EditInsertPanel : TEtkMenuItem;



Constructors


Functions


procedure EditInsertPanelClick(Sender: TObject);

The user selected the Insert Panel menu item. Create a new panel as the parent of the selected components. As a special case, fi the user selected a single panel, change the old panel's Align property to alClient.


procedure ChangeParent(Control, Parent: TIComponentInterface);

so a smart user can change the control type } { Change the Parent property of a control. Because the Parent property is not published, a DLL expert cannot do this using the Open Tools API. Instead, cast the control's handle to TControl, which requires that this expert reside in a package.


function GetBounds(Control: TIComponentInterface; var Rect: TRect): Boolean;

Get the bounds of a control and store them in Rect. Return True if successful, False if the control does not publish Left, Top, Height, and Width properties. Also make sure no one created a perverse control that has non-integer types for these properties.


function GetInteger(Component: TIComponentInterface; const PropName: string; var Value: Integer): Boolean;

Get an integer property. Return True for success, False if the property is not published or does not have an integer type. Store the integer property value in the Value variable, but only if the function returns True.


function GetParent(Form: TIFormInterface; Control: TIComponentInterface): TIComponentInterface;

TIComponentInterface.GetParent always returns nil. The GetParent function laboriously searches the form for the real parent. The caller must free the parent interface.


procedure InsertParent(Form: TIFormInterface);

Insert a TPanel as the parent control of the current selection. Start by determining the bounding box for the selected controls, and make the new panel that size. Then change the parent of each selected control to be the panel. If the controls all have a common parent, make the panel a child of that parent. Otherwise, the new panel is a child of the form. Note that if the controls do not have a common parent, the bounding box will be nonsensical because the Left and Top properties are relative to a control's parent. This function does not try to normalize the positions with respect to the form. This means that controls will appear to move on the form. If you don't like it, you can fix it.


procedure Reposition(Control, Parent: TIComponentInterface);

Change the Left and Top properties of Control so they are relative to the positon of Parent.


function SelectionIsForm(Form: TIFormInterface; Selection: TIComponentInterface): Boolean;

Return True if Selection is the form component, which means the user has not selected any real components. Obviously, you cannot insert a panel as the parent of the form. Return False if the selection is nil or is otherwise not the form component.


procedure SetAlign(Selection: TIComponentInterface);

Set the Align property of the old selection to alClient, so it completely fills the new panel. If the control does not have an Align property whose type is an enumeration, do nothing.


Properties


Events


Variables


EditInsertPanel : TEtkMenuItem;