fixed selection of composite component items

git-svn-id: trunk@7495 -
This commit is contained in:
jesus 2005-08-11 19:46:12 +00:00
parent c7c83312ec
commit 9e904d09dd
7 changed files with 10 additions and 1 deletions

View File

@ -2270,6 +2270,7 @@ function TDesigner.ControlClassAtPos(const AClass: TControlClass; const APos: TP
Result := TControl(FLookupRoot.Components[i]); // bit tricky, but we set it to nil anyhow
if not Result.InheritsFrom(AClass) then Continue;
if IgnoreHidden and not ControlIsInDesignerVisible(TControl(Result)) then Continue;
if csNoDesignSelectable in Result.ControlStyle then continue;
Bounds := GetParentFormRelativeBounds(Result);
if PtInRect(Bounds, APos) then Exit;
@ -2292,6 +2293,7 @@ function TDesigner.ControlClassAtPos(const AClass: TControlClass; const APos: TP
Dec(i);
Control := WinControl.Controls[i];
if IgnoreHidden and (csNoDesignVisible in Control.ControlStyle) then Continue;
if csNoDesignSelectable in Control.ControlStyle then continue;
Bounds := GetParentFormRelativeBounds(Control);
if not PtInRect(Bounds, APos) then Continue;

View File

@ -196,7 +196,8 @@ type
csDesignNoSmoothResize, // no WYSIWYG resizing in designer
csDesignFixedBounds, // control can not be moved nor resized in designer
csHasDefaultAction, // control implements useful ExecuteDefaultAction
csHasCancelAction // control implements useful ExecuteCancelAction
csHasCancelAction, // control implements useful ExecuteCancelAction
csNoDesignSelectable // control can not be selected at design time
);
TControlStyle = set of TControlStyleType;

View File

@ -459,6 +459,7 @@ begin
CheckButtonVisible;
FButton.OnClick := @DoButtonClick;
FButton.Cursor := crArrow;
FButton.ControlStyle := FButton.ControlStyle + [csNoDesignSelectable];
ControlStyle := ControlStyle - [csSetCaption];
FDirectInput := True;
end;

View File

@ -85,6 +85,7 @@ begin
AutoSize := False;
Parent := Self;
OnClick :=@Clicked;
include(ControlStyle, csNoDesignSelectable);
end;
FButtonList.Add(CheckBox);
end;

View File

@ -113,6 +113,7 @@ begin
if FEditLabel<>nil then exit;
FEditLabel := TBoundLabel.Create(Self);
Include(FEditLabel.ComponentStyle, csSubComponent);
Include(FEditLabel.ControlStyle, csNoDesignSelectable);
FEditLabel.FreeNotification(Self);
FEditLabel.FocusControl := Self;
end;

View File

@ -248,6 +248,7 @@ begin
CurButton.Visible:=CurButtonType in FVisibleButtons;
CurButton.OnClick:=@ButtonClickHandler;
CurButton.Parent:=Self;
include(CurButton.ControlStyle, csNoDesignSelectable);
if CurButton.Visible then begin
inc(ButtonNumber);
ButtonStartPos:=ButtonEndPos;

View File

@ -120,6 +120,7 @@ begin
Temp.AutoSize := False;
Temp.OnClick := @Clicked;
Temp.OnChange := @Changed;
include(temp.ControlStyle, csNoDesignSelectable);
FButtonList.Add(Temp);
end;
if FHiddenButton=nil then begin
@ -127,6 +128,7 @@ begin
with FHiddenButton do begin
Name:='HiddenRadioButton';
Visible:=false;
include(ControlStyle, csNoDesignSelectable);
end;
end;