HElp selector: double cick to select from Darius

git-svn-id: trunk@9557 -
This commit is contained in:
mattias 2006-07-04 18:59:57 +00:00
parent d61a9821fb
commit 194e54100f
3 changed files with 49 additions and 5 deletions

View File

@ -121,6 +121,7 @@ type
NodesListBox: TListBox;
procedure HelpSelectorDialogClose(Sender: TObject;
var CloseAction: TCloseAction);
procedure NodesListBoxDblClick(Sender: TObject);
private
FNodes: THelpNodeQueryList;
procedure SetNodes(const AValue: THelpNodeQueryList);
@ -154,6 +155,11 @@ begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure THelpSelectorDialog.NodesListBoxDblClick(Sender: TObject);
begin
ModalResult := mrOK;
end;
procedure THelpSelectorDialog.SetNodes(const AValue: THelpNodeQueryList);
begin
if FNodes=AValue then exit;
@ -183,6 +189,7 @@ begin
inherited Create(TheOwner);
IDEDialogLayoutList.ApplyLayout(Self,500,300);
Caption := lisHelpSelectorDialog;
NodesGroupBox.Caption:=lisSelectAHelpItem;
OkButton.Caption:=lisLazBuildOk;
CancelButton.Caption:=dlgCancel;

View File

@ -32,8 +32,6 @@ interface
{$ASSERTIONS ON}
{$endif}
{off $Define Critical_Sections_Support}
uses
// rtl+ftl
Types, Classes, SysUtils, Math, FPCAdds,

View File

@ -147,9 +147,9 @@ type
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
function FindDockerByName(const ADockerName: string;
Ignore: TCustomLazControlDocker): TCustomLazControlDocker;
Ignore: TCustomLazControlDocker = nil): TCustomLazControlDocker;
function FindDockerByControl(AControl: TControl;
Ignore: TCustomLazControlDocker): TCustomLazControlDocker;
Ignore: TCustomLazControlDocker = nil): TCustomLazControlDocker;
function CreateUniqueName(const AName: string;
Ignore: TCustomLazControlDocker): string;
function GetControlConfigName(AControl: TControl): string;
@ -740,6 +740,34 @@ procedure TCustomLazControlDocker.RestoreLayout;
var
Layout: TLazDockerConfig;
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;
begin
DebugLn(['TCustomLazControlDocker.RestoreLayout A ',DockerName]);
@ -748,7 +776,18 @@ begin
if (Layout=nil) or (Layout.Root=nil) then exit;
SelfNode:=Layout.Root.FindByName(DockerName,true);
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
DebugLn(['TCustomLazControlDocker.RestoreLayout ',DockerName,' not docking, just moving ...']);