mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:19:18 +02:00
IDEIntf: improve set active page in designer on OI selection change.
git-svn-id: trunk@52344 -
This commit is contained in:
parent
d22c7ed37a
commit
bd2fb1f4bc
@ -308,13 +308,7 @@ begin
|
|||||||
if NewSelection.IsEqual(FComponentList.Selection) then
|
if NewSelection.IsEqual(FComponentList.Selection) then
|
||||||
Exit;
|
Exit;
|
||||||
FComponentList.Selection.Assign(NewSelection);
|
FComponentList.Selection.Assign(NewSelection);
|
||||||
if (NewSelection.Count=1) and
|
|
||||||
(NewSelection[0] is TCustomPage) and
|
|
||||||
(TCustomPage(NewSelection[0]).Parent is TCustomTabControl) then
|
|
||||||
begin
|
|
||||||
TCustomTabControl(TCustomPage(NewSelection[0]).Parent).PageIndex :=
|
|
||||||
TCustomPage(NewSelection[0]).PageIndex;
|
|
||||||
end;
|
|
||||||
inherited DoSelectionChanged;
|
inherited DoSelectionChanged;
|
||||||
finally
|
finally
|
||||||
NewSelection.Free;
|
NewSelection.Free;
|
||||||
|
@ -742,6 +742,7 @@ type
|
|||||||
FRefreshingSelectionCount: integer;
|
FRefreshingSelectionCount: integer;
|
||||||
FOnAutoShow: TNotifyEvent;
|
FOnAutoShow: TNotifyEvent;
|
||||||
FLastActiveRowName: String;
|
FLastActiveRowName: String;
|
||||||
|
procedure DefSelectionVisibleInDesigner;
|
||||||
function GetComponentPanelHeight: integer;
|
function GetComponentPanelHeight: integer;
|
||||||
function GetInfoBoxHeight: integer;
|
function GetInfoBoxHeight: integer;
|
||||||
procedure SetEnableHookGetSelection(AValue: boolean);
|
procedure SetEnableHookGetSelection(AValue: boolean);
|
||||||
@ -4818,6 +4819,7 @@ begin
|
|||||||
if FSelection.IsEqual(ComponentTree.Selection) then exit;
|
if FSelection.IsEqual(ComponentTree.Selection) then exit;
|
||||||
FSelection.Assign(ComponentTree.Selection);
|
FSelection.Assign(ComponentTree.Selection);
|
||||||
RefreshSelection;
|
RefreshSelection;
|
||||||
|
DefSelectionVisibleInDesigner;
|
||||||
if Assigned(FOnSelectPersistentsInOI) then
|
if Assigned(FOnSelectPersistentsInOI) then
|
||||||
FOnSelectPersistentsInOI(Self);
|
FOnSelectPersistentsInOI(Self);
|
||||||
end;
|
end;
|
||||||
@ -5221,6 +5223,36 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TObjectInspectorDlg.DefSelectionVisibleInDesigner;
|
||||||
|
procedure ShowPage(const aPage: TTabSheet);
|
||||||
|
begin
|
||||||
|
if aPage.Parent is TPageControl then
|
||||||
|
TPageControl(aPage.Parent).PageIndex := aPage.PageIndex;
|
||||||
|
end;
|
||||||
|
procedure ShowPage(const aPage: TPage);
|
||||||
|
begin
|
||||||
|
if aPage.Parent is TNotebook then
|
||||||
|
TNotebook(aPage.Parent).PageIndex := aPage.PageIndex;
|
||||||
|
end;
|
||||||
|
var
|
||||||
|
Cnt: TControl;
|
||||||
|
begin
|
||||||
|
if (Selection.Count = 0) or (Selection[0] = nil) or not(Selection[0] is TControl) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
Cnt := TControl(Selection[0]);
|
||||||
|
while Cnt<>nil do
|
||||||
|
begin
|
||||||
|
if Cnt is TTabSheet then
|
||||||
|
ShowPage(TTabSheet(Cnt))
|
||||||
|
else
|
||||||
|
if Cnt is TPage then
|
||||||
|
ShowPage(TPage(Cnt));
|
||||||
|
|
||||||
|
Cnt := Cnt.Parent;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TObjectInspectorDlg.CreateBottomSplitter;
|
procedure TObjectInspectorDlg.CreateBottomSplitter;
|
||||||
// vertical splitter between notebook and info panel
|
// vertical splitter between notebook and info panel
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user