Designer: formatting

git-svn-id: trunk@39089 -
This commit is contained in:
juha 2012-10-15 10:42:04 +00:00
parent 3570c3b2ff
commit 22c9f39a9c
3 changed files with 26 additions and 30 deletions

View File

@ -2069,8 +2069,7 @@ begin
DoChange;
end;
function TControlSelection.Equals(const ASelection: TPersistentSelectionList
): boolean;
function TControlSelection.Equals(const ASelection: TPersistentSelectionList): boolean;
var
i: Integer;
Instance: TPersistent;

View File

@ -1776,36 +1776,35 @@ begin
CompIndex:=ControlSelection.IndexOf(MouseDownComponent);
if ssCtrl in Shift then begin
// child selection
end else begin
if (ssShift in Shift) then begin
// shift key pressed (multiselection)
end
else if (ssShift in Shift) then begin
// shift key pressed (multiselection)
if CompIndex<0 then begin
// not selected
// add component to selection
if (ControlSelection.SelectionForm<>nil)
and (ControlSelection.SelectionForm<>Form)
then begin
MessageDlg(lisInvalidMultiselection,
fdInvalidMultiselectionText,
mtInformation,[mbOk],0);
end else begin
ControlSelection.Add(MouseDownComponent);
end;
if CompIndex<0 then begin
// not selected
// add component to selection
if (ControlSelection.SelectionForm<>nil)
and (ControlSelection.SelectionForm<>Form)
then begin
MessageDlg(lisInvalidMultiselection,
fdInvalidMultiselectionText,
mtInformation,[mbOk],0);
end else begin
// remove from multiselection
ControlSelection.Delete(CompIndex);
ControlSelection.Add(MouseDownComponent);
end;
end else begin
// no shift key (single selection or keeping multiselection)
if (CompIndex<0) then begin
// select only this component
ControlSelection.AssignPersistent(MouseDownComponent);
end else
// sync with the interface
ControlSelection.UpdateBounds;
// remove from multiselection
ControlSelection.Delete(CompIndex);
end;
end else begin
// no shift key (single selection or keeping multiselection)
if (CompIndex<0) then begin
// select only this component
ControlSelection.AssignPersistent(MouseDownComponent);
end else
// sync with the interface
ControlSelection.UpdateBounds;
end;
end else begin
// mouse down on grabber -> begin sizing

View File

@ -9721,14 +9721,12 @@ begin
UpdateIDEComponentPalette;
end;
procedure TMainIDE.OnGetDesignerSelection(
const ASelection: TPersistentSelectionList);
procedure TMainIDE.OnGetDesignerSelection(const ASelection: TPersistentSelectionList);
begin
if TheControlSelection=nil then exit;
TheControlSelection.GetSelection(ASelection);
end;
// -----------------------------------------------------------------------------
procedure TMainIDE.UnitDependenciesViewAccessingSources(Sender: TObject);