KCL Design System - TKclDesignManager
|
|
Version 1.00
|
TKclDesignManager is the
component that controls the design behavior of its owner form like Delphi's
Form Designer. It is easy to use. The main property of this component is
Designing (a public property), when set to True, the component will be in
its full function.
Unit
KclDesigner
Hierarchy
TObject - TPersistent - TComponent
- TKclDesignManager
Properties
The most important property of
this component, indicate whether the form is in design state. Set this property
to True to start designing, while set to False to stop designing.
- DesignProxies: TKclDesignWndProcProxyList (ReadOnly)
When designing, DesignManager will
take over all the Windows message handler of each TWinControl in th design
form with a "proxy class"(TKclDesignWndProcProxy). This property points to
the list of these proxies.
Whether the design form has been
modified. When you move a control or change a component's property, Dirty
will be set to True. You have to manually set this property to False.
- DynInsCompClass: TComponentClass (ReadOnly)
The class of the component to be
insert on the design form.
- IsDynInsComp: Boolean (ReadOnly)
Whether the user is inserting components
to the design form through TKclCompPalleteToolBar.
- IsEmbedEditting: Boolean (ReadOnly)
Whether the user is in Embed Edit
mode. Embed edit is an extension style of KCL Design System. You may seldom
use it.
- IsRubbering: Boolean (ReadOnly)
Whether the user is dragging a
"rubber rectangle" on the form to select controls in the rectangle.
- SelectedComps: TComponentList
Current selected components. Set
this property manually control the selected components on the form, such
as:
DesignManager.SelectedComps := AComponentList;
but if you use the following style:
DesignManager.SelectedComps.Add(AComponent);
you must call method
ReselectComps
or
Refresh to activate the changes.
- SelectSizer: TKclSizer (ReadOnly)
The activated sizer user currently
selected. If multi controls is selected, this properties will be the first
sizer of the property Sizers.
TKclSizer is a control that
appear as a rectangle with eight black little bars around it to change the
control's size.
- Sizers: TKclSizerList (ReadOnly)
The activated sizers user currently
selected.
- StageProxy: TKclDesignStageProxy (ReadOnly)
The Window message "proxy" of the
design form.
- StageSizer: TKclStageSizer (ReadOnly)
The sizer of the design form.
The form been designed. It must be the
owner of controls designed. Usually it is a TForm.
This property will be set automaticly to the owner of DesignManager when
you create this component.
- DesignPopupMenu: TPopupMenu
The PopupMenu when you right click
on the DesignStage. Usually this property is setted to TKclCompPopupMenu.
Whether the design (insert/delete/modify)
is permited through DesignManager.
Events
- OnCompsChange: TNotifyEvent
Occurs when components are modified
by user on DesignStage.
- OnControlsMoved: TNotifyEvent
Occurs when selected controls are
moved by user.
- OnStageMouseMove: TMouseMoveEvent
Occurs when user move the mouse
cursor on DesignStage area.
Methods
constructor Create(AOwner:
TComponent); override;
destructor Destroy;
override;
procedure BringSelCtrlsToFront;
Bring selected controls to the
front.
procedure CtrlMoved(AControl:
TControl);
Notify the DesignManager that AControl
is manually moved.
procedure DelSelectedControls;
Delete selected controls.
Select nothing on the DesignStage.
procedure DeselectComponent;
Deselect all selected components
while preserving the selected controls.
procedure DeselectUnsiblingControl(Sender:
TControl; DelComponent: Boolean = True);
Deselect all controls except the
sibling of Sender. If DelComponent is True, selected components will be deselect
too.
procedure FlipChildren(FlipMode:
TFlipChildrenMode = fcSelected);
Flip child controls with FlipMode:
selected controls or all controls.
procedure GetStageBitmap(ABmp:
TBitmap);
Get bitmap snap of DesignStage.
procedure GetStagePicture(APic:
TPicture);
Get snap of DesignStage.
Print the image of the DesignStage.
Refresh the display of the whole
DesignStage.
procedure RefreshSizers;
procedure RepaintSizers;
procedure ScaleControls(ScaleFactor:
Integer; ScaleStyle: TKclDesignScaleStyle);
Scale selected controls with ScaleFactor
(percentage) and ScaleStyle (Selected or All controls).
procedure SelectAllControls;
Select all controls on DesignStage.
procedure SelectControl(AControl:
TControl; OriginPos: TPoint; SelectMode: TControlSelectMode = csmSelect; Broadcast:
Boolean = True; StartDrag: Boolean = True);
Select AControl on DesignStage.
This procedure is used internally. I do not recommend you to call it: too
complex.
procedure SelectControlInRect(ARect:
TRect; SelectMode: TControlSelectMode = csmAdd);
Select controls in ARect area.
The coordinate is based on DesignStage.
procedure SendSelCtrlsToBack;
Send selected controls to back.
procedure SetSelCtrlDesignAligment(AHorizontalDesignAlignment,
AVerticalDesignAlignment: TKclDesignAlignmentStyle);
Set aligment of selected controls.
procedure SetSelCtrlDesignSize(AWidthStyle,
AHeightStyle: TKclDesignSizeStyle; AWidth: Integer = -1; AHeight: Integer
= -1);
Set size of selected controls.
procedure SizersModified;
Notify the DesignManager that Sizers
are manually modified.
Notify the Sizers are manually
moved.
Demos
SimpleDesigner
DfmBuilder
MQY Studio 2002.12