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; DoChange;
end; end;
function TControlSelection.Equals(const ASelection: TPersistentSelectionList function TControlSelection.Equals(const ASelection: TPersistentSelectionList): boolean;
): boolean;
var var
i: Integer; i: Integer;
Instance: TPersistent; Instance: TPersistent;

View File

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

View File

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