mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 09:40:31 +01:00
HElp selector: double cick to select from Darius
git-svn-id: trunk@9557 -
This commit is contained in:
parent
d61a9821fb
commit
194e54100f
@ -121,6 +121,7 @@ type
|
|||||||
NodesListBox: TListBox;
|
NodesListBox: TListBox;
|
||||||
procedure HelpSelectorDialogClose(Sender: TObject;
|
procedure HelpSelectorDialogClose(Sender: TObject;
|
||||||
var CloseAction: TCloseAction);
|
var CloseAction: TCloseAction);
|
||||||
|
procedure NodesListBoxDblClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
FNodes: THelpNodeQueryList;
|
FNodes: THelpNodeQueryList;
|
||||||
procedure SetNodes(const AValue: THelpNodeQueryList);
|
procedure SetNodes(const AValue: THelpNodeQueryList);
|
||||||
@ -154,6 +155,11 @@ begin
|
|||||||
IDEDialogLayoutList.SaveLayout(Self);
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure THelpSelectorDialog.NodesListBoxDblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ModalResult := mrOK;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure THelpSelectorDialog.SetNodes(const AValue: THelpNodeQueryList);
|
procedure THelpSelectorDialog.SetNodes(const AValue: THelpNodeQueryList);
|
||||||
begin
|
begin
|
||||||
if FNodes=AValue then exit;
|
if FNodes=AValue then exit;
|
||||||
@ -183,6 +189,7 @@ begin
|
|||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
IDEDialogLayoutList.ApplyLayout(Self,500,300);
|
IDEDialogLayoutList.ApplyLayout(Self,500,300);
|
||||||
|
|
||||||
|
Caption := lisHelpSelectorDialog;
|
||||||
NodesGroupBox.Caption:=lisSelectAHelpItem;
|
NodesGroupBox.Caption:=lisSelectAHelpItem;
|
||||||
OkButton.Caption:=lisLazBuildOk;
|
OkButton.Caption:=lisLazBuildOk;
|
||||||
CancelButton.Caption:=dlgCancel;
|
CancelButton.Caption:=dlgCancel;
|
||||||
|
|||||||
@ -32,8 +32,6 @@ interface
|
|||||||
{$ASSERTIONS ON}
|
{$ASSERTIONS ON}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{off $Define Critical_Sections_Support}
|
|
||||||
|
|
||||||
uses
|
uses
|
||||||
// rtl+ftl
|
// rtl+ftl
|
||||||
Types, Classes, SysUtils, Math, FPCAdds,
|
Types, Classes, SysUtils, Math, FPCAdds,
|
||||||
|
|||||||
@ -147,9 +147,9 @@ type
|
|||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function FindDockerByName(const ADockerName: string;
|
function FindDockerByName(const ADockerName: string;
|
||||||
Ignore: TCustomLazControlDocker): TCustomLazControlDocker;
|
Ignore: TCustomLazControlDocker = nil): TCustomLazControlDocker;
|
||||||
function FindDockerByControl(AControl: TControl;
|
function FindDockerByControl(AControl: TControl;
|
||||||
Ignore: TCustomLazControlDocker): TCustomLazControlDocker;
|
Ignore: TCustomLazControlDocker = nil): TCustomLazControlDocker;
|
||||||
function CreateUniqueName(const AName: string;
|
function CreateUniqueName(const AName: string;
|
||||||
Ignore: TCustomLazControlDocker): string;
|
Ignore: TCustomLazControlDocker): string;
|
||||||
function GetControlConfigName(AControl: TControl): string;
|
function GetControlConfigName(AControl: TControl): string;
|
||||||
@ -740,6 +740,34 @@ procedure TCustomLazControlDocker.RestoreLayout;
|
|||||||
var
|
var
|
||||||
Layout: TLazDockerConfig;
|
Layout: TLazDockerConfig;
|
||||||
SelfNode: TLazDockConfigNode;
|
SelfNode: TLazDockConfigNode;
|
||||||
|
|
||||||
|
{ function FindControl(Node: TLazDockConfigNode): TControl;
|
||||||
|
begin
|
||||||
|
if Node.TheType=ldcntControl then
|
||||||
|
Result:=Manager.FindDockerByName(Node.Name)
|
||||||
|
else
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure FindSibling(Node: TLazDockConfigNode; Side: TAnchorKind;
|
||||||
|
out Sibling: TControl; out SiblingNode: TLazDockConfigNode;
|
||||||
|
out Distance: integer);
|
||||||
|
var
|
||||||
|
SiblingName: string;
|
||||||
|
begin
|
||||||
|
Sibling:=nil;
|
||||||
|
SiblingNode:=nil;
|
||||||
|
Distance:=10000;
|
||||||
|
if Node=nil then exit;
|
||||||
|
SiblingName:=Node.Sides[Side];
|
||||||
|
if SiblingName<>'' then begin
|
||||||
|
SiblingNode:=Layout.Root.FindByName(SiblingName,true,true);
|
||||||
|
Sibling:=FindControl(SiblingNode);
|
||||||
|
// TODO
|
||||||
|
end;
|
||||||
|
end;}
|
||||||
|
|
||||||
|
var
|
||||||
NewBounds: TRect;
|
NewBounds: TRect;
|
||||||
begin
|
begin
|
||||||
DebugLn(['TCustomLazControlDocker.RestoreLayout A ',DockerName]);
|
DebugLn(['TCustomLazControlDocker.RestoreLayout A ',DockerName]);
|
||||||
@ -748,7 +776,18 @@ begin
|
|||||||
if (Layout=nil) or (Layout.Root=nil) then exit;
|
if (Layout=nil) or (Layout.Root=nil) then exit;
|
||||||
SelfNode:=Layout.Root.FindByName(DockerName,true);
|
SelfNode:=Layout.Root.FindByName(DockerName,true);
|
||||||
DebugLn(['TCustomLazControlDocker.RestoreLayout ',SelfNode<>nil,' DockerName=',DockerName,' ',Manager.Configs[0].DockerName]);
|
DebugLn(['TCustomLazControlDocker.RestoreLayout ',SelfNode<>nil,' DockerName=',DockerName,' ',Manager.Configs[0].DockerName]);
|
||||||
if SelfNode=nil then exit;
|
if (SelfNode=nil) or (SelfNode.TheType<>ldcntControl) then exit;
|
||||||
|
|
||||||
|
if SelfNode.Parent<>nil then begin
|
||||||
|
// this control was docked
|
||||||
|
if SelfNode.Parent.TheType=ldcntPage then begin
|
||||||
|
// this control was docked as child of a page
|
||||||
|
DebugLn(['TCustomLazControlDocker.RestoreLayout TODO restore page']);
|
||||||
|
end else begin
|
||||||
|
// this control was docked on a form as child
|
||||||
|
//FindSibling(SelfNode,akLeft,LeftSibling,LeftSiblingDistance);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
// default: do not dock, just move
|
// default: do not dock, just move
|
||||||
DebugLn(['TCustomLazControlDocker.RestoreLayout ',DockerName,' not docking, just moving ...']);
|
DebugLn(['TCustomLazControlDocker.RestoreLayout ',DockerName,' not docking, just moving ...']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user