mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:19:18 +02:00
IDEIntf: added IDE window creator procedure
git-svn-id: trunk@26104 -
This commit is contained in:
parent
6697f885f6
commit
48a402b0f5
@ -2002,7 +2002,7 @@ begin
|
|||||||
|
|
||||||
for DlgType:=Low(TDebugDialogType) to High(TDebugDialogType) do
|
for DlgType:=Low(TDebugDialogType) to High(TDebugDialogType) do
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[DebugDlgIDEWindow[DlgType]],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[DebugDlgIDEWindow[DlgType]],
|
||||||
@CreateDebugDialog,'','','','');
|
nil,@CreateDebugDialog,'','','','');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebugManager.ConnectSourceNotebookEvents;
|
procedure TDebugManager.ConnectSourceNotebookEvents;
|
||||||
|
@ -622,6 +622,7 @@ procedure TSimpleWindowLayoutList.Clear;
|
|||||||
var i: integer;
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
for i:=0 to Count-1 do Items[i].Free;
|
for i:=0 to Count-1 do Items[i].Free;
|
||||||
|
inherited Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSimpleWindowLayoutList.Delete(Index: Integer);
|
procedure TSimpleWindowLayoutList.Delete(Index: Integer);
|
||||||
|
30
ide/main.pp
30
ide/main.pp
@ -1945,8 +1945,8 @@ begin
|
|||||||
ObjectInspector1.OnDestroy:=@OIOnDestroy;
|
ObjectInspector1.OnDestroy:=@OIOnDestroy;
|
||||||
ObjectInspector1.OnAutoShow:=@OIOnAutoShow;
|
ObjectInspector1.OnAutoShow:=@OIOnAutoShow;
|
||||||
ObjectInspector1.PropertyEditorHook:=GlobalDesignHook;
|
ObjectInspector1.PropertyEditorHook:=GlobalDesignHook;
|
||||||
IDEWindowCreators.Add(ObjectInspector1.Name,nil,'0','150','230','50%',
|
IDEWindowCreators.Add(ObjectInspector1.Name,nil,@CreateIDEWindow,
|
||||||
NonModalIDEWindowNames[nmiwSourceNoteBookName],alLeft);
|
'0','150','230','50%',NonModalIDEWindowNames[nmiwSourceNoteBookName],alLeft);
|
||||||
|
|
||||||
EnvironmentOptions.ObjectInspectorOptions.AssignTo(ObjectInspector1);
|
EnvironmentOptions.ObjectInspectorOptions.AssignTo(ObjectInspector1);
|
||||||
|
|
||||||
@ -2195,34 +2195,34 @@ end;
|
|||||||
procedure TMainIDE.SetupIDEWindowsLayout;
|
procedure TMainIDE.SetupIDEWindowsLayout;
|
||||||
begin
|
begin
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwCodeExplorerName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwCodeExplorerName],
|
||||||
@CreateIDEWindow,
|
nil,@CreateIDEWindow,
|
||||||
'72%','130','170','60%',NonModalIDEWindowNames[nmiwSourceNoteBookName],alRight);
|
'72%','130','170','60%',NonModalIDEWindowNames[nmiwSourceNoteBookName],alRight);
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwMessagesViewName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwMessagesViewName],
|
||||||
@CreateIDEWindow,
|
nil,@CreateIDEWindow,
|
||||||
'230','75%','70%','100',NonModalIDEWindowNames[nmiwSourceNoteBookName],alBottom);
|
'230','75%','70%','100',NonModalIDEWindowNames[nmiwSourceNoteBookName],alBottom);
|
||||||
|
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwUnitDependenciesName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwUnitDependenciesName],
|
||||||
@CreateIDEWindow,'200','200','','');
|
nil,@CreateIDEWindow,'200','200','','');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwFPDocEditorName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwFPDocEditorName],
|
||||||
@CreateIDEWindow,'250','75%','60%','120');
|
nil,@CreateIDEWindow,'250','75%','60%','120');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwClipbrdHistoryName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwClipbrdHistoryName],
|
||||||
@CreateIDEWindow,'250','200','','');
|
nil,@CreateIDEWindow,'250','200','','');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwProjectInspector],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwProjectInspector],
|
||||||
@CreateIDEWindow,'200','150','300','400');
|
nil,@CreateIDEWindow,'200','150','300','400');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwSearchResultsViewName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwSearchResultsViewName],
|
||||||
@CreateIDEWindow,'250','250','60%','300');
|
nil,@CreateIDEWindow,'250','250','60%','300');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwAnchorEditor],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwAnchorEditor],
|
||||||
@CreateIDEWindow,'250','250','','');
|
nil,@CreateIDEWindow,'250','250','','');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwCodeBrowser],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwCodeBrowser],
|
||||||
@CreateIDEWindow,'200','200','650','500');
|
nil,@CreateIDEWindow,'200','200','650','500');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwIssueBrowser],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwIssueBrowser],
|
||||||
@CreateIDEWindow,'250','250','','');
|
nil,@CreateIDEWindow,'250','250','','');
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwJumpHistory],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwJumpHistory],
|
||||||
@CreateIDEWindow,'250','250','','');
|
nil,@CreateIDEWindow,'250','250','','');
|
||||||
IDEWindowCreators.Add(ComponentListFormName,
|
IDEWindowCreators.Add(ComponentListFormName,
|
||||||
@CreateIDEWindow,'250','250','','');
|
nil,@CreateIDEWindow,'250','250','','');
|
||||||
IDEWindowCreators.Add(ToDoWindowName,
|
IDEWindowCreators.Add(ToDoWindowName,
|
||||||
@CreateIDEWindow,'250','250','','');
|
nil,@CreateIDEWindow,'250','250','','');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.RestoreIDEWindows;
|
procedure TMainIDE.RestoreIDEWindows;
|
||||||
|
@ -1137,6 +1137,7 @@ function SourceNotebook: TSourceNotebook;
|
|||||||
|
|
||||||
function SourceEditorManager: TSourceEditorManager;
|
function SourceEditorManager: TSourceEditorManager;
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -9089,7 +9090,7 @@ begin
|
|||||||
|
|
||||||
// layout
|
// layout
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwSourceNoteBookName],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwSourceNoteBookName],
|
||||||
@CreateSourceWindow,'250','100','70%','70%',
|
nil,@CreateSourceWindow,'250','100','70%','70%',
|
||||||
NonModalIDEWindowNames[nmiwMainIDEName],alBottom,
|
NonModalIDEWindowNames[nmiwMainIDEName],alBottom,
|
||||||
true,@GetDefaultLayout);
|
true,@GetDefaultLayout);
|
||||||
end;
|
end;
|
||||||
|
@ -112,18 +112,22 @@ type
|
|||||||
iwcsDocked
|
iwcsDocked
|
||||||
);
|
);
|
||||||
|
|
||||||
TCreateIDEWindowEvent = procedure(Sender: TObject; aFormName: string;
|
TCreateIDEWindowMethod = procedure(Sender: TObject; aFormName: string;
|
||||||
var AForm: TCustomForm; DoDisableAutoSizing: boolean) of object;
|
var AForm: TCustomForm; DoDisableAutoSizing: boolean) of object;
|
||||||
|
TCreateIDEWindowProc = procedure(Sender: TObject; aFormName: string;
|
||||||
|
var AForm: TCustomForm; DoDisableAutoSizing: boolean);
|
||||||
TGetDefaultIDEWindowLayoutEvent = procedure(Sender: TObject; aFormName: string;
|
TGetDefaultIDEWindowLayoutEvent = procedure(Sender: TObject; aFormName: string;
|
||||||
out aBounds: TRect; out DockSibling: string; out DockAlign: TAlign) of object;
|
out aBounds: TRect; out DockSibling: string; out DockAlign: TAlign) of object;
|
||||||
TShowIDEWindowEvent = procedure(Sender: TObject; AForm: TCustomForm;
|
TShowIDEWindowEvent = procedure(Sender: TObject; AForm: TCustomForm;
|
||||||
BringToFront: boolean) of object;
|
BringToFront: boolean) of object;
|
||||||
|
|
||||||
{ TIDEWindowCreator }
|
{ TIDEWindowCreator
|
||||||
|
Every dockable window of the IDE needs a TIDEWindowCreator. }
|
||||||
|
|
||||||
TIDEWindowCreator = class
|
TIDEWindowCreator = class
|
||||||
private
|
private
|
||||||
FCreateForm: TCreateIDEWindowEvent;
|
FCreateFormMethod: TCreateIDEWindowMethod;
|
||||||
|
FCreateFormProc: TCreateIDEWindowProc;
|
||||||
FDockAlign: TAlign;
|
FDockAlign: TAlign;
|
||||||
FDockSibling: string;
|
FDockSibling: string;
|
||||||
FFormName: string;
|
FFormName: string;
|
||||||
@ -141,7 +145,8 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(aFormName: string); overload;
|
constructor Create(aFormName: string); overload;
|
||||||
constructor Create(aFormName: string;
|
constructor Create(aFormName: string;
|
||||||
CreateFormEvent: TCreateIDEWindowEvent;
|
CreateFormProc: TCreateIDEWindowProc;
|
||||||
|
CreateFormMethod: TCreateIDEWindowMethod;
|
||||||
aLeft, aTop, aWidth, aHeight: string;
|
aLeft, aTop, aWidth, aHeight: string;
|
||||||
aDockSibling : string = '';
|
aDockSibling : string = '';
|
||||||
aDockAlign: TAlign = alNone;
|
aDockAlign: TAlign = alNone;
|
||||||
@ -156,7 +161,8 @@ type
|
|||||||
property Height: string read FHeight write SetHeight; // '12' for 12 pixel, '10%' for 10 percent of screen.height
|
property Height: string read FHeight write SetHeight; // '12' for 12 pixel, '10%' for 10 percent of screen.height
|
||||||
property DockSibling: string read FDockSibling write FDockSibling; // another form name
|
property DockSibling: string read FDockSibling write FDockSibling; // another form name
|
||||||
property DockAlign: TAlign read FDockAlign write FDockAlign;
|
property DockAlign: TAlign read FDockAlign write FDockAlign;
|
||||||
property OnCreateForm: TCreateIDEWindowEvent read FCreateForm write FCreateForm;
|
property OnCreateFormMethod: TCreateIDEWindowMethod read FCreateFormMethod write FCreateFormMethod;
|
||||||
|
property OnCreateFormProc: TCreateIDEWindowProc read FCreateFormProc write FCreateFormProc;
|
||||||
property OnGetLayout: TGetDefaultIDEWindowLayoutEvent read FOnGetLayout
|
property OnGetLayout: TGetDefaultIDEWindowLayoutEvent read FOnGetLayout
|
||||||
write FOnGetLayout;
|
write FOnGetLayout;
|
||||||
procedure CheckBoundValue(s: string);
|
procedure CheckBoundValue(s: string);
|
||||||
@ -180,7 +186,8 @@ type
|
|||||||
function Add(aLayout: TIDEWindowCreator): integer; overload;
|
function Add(aLayout: TIDEWindowCreator): integer; overload;
|
||||||
function Add(aFormName: string): TIDEWindowCreator; overload;
|
function Add(aFormName: string): TIDEWindowCreator; overload;
|
||||||
function Add(aFormName: string;
|
function Add(aFormName: string;
|
||||||
CreateFormEvent: TCreateIDEWindowEvent;
|
CreateFormProc: TCreateIDEWindowProc;
|
||||||
|
CreateFormMethod: TCreateIDEWindowMethod;
|
||||||
aLeft, aTop, aWidth, aHeight: string;
|
aLeft, aTop, aWidth, aHeight: string;
|
||||||
aDockSibling : string = '';
|
aDockSibling : string = '';
|
||||||
aDockAlign: TAlign = alNone;
|
aDockAlign: TAlign = alNone;
|
||||||
@ -578,9 +585,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TIDEWindowCreator.Create(aFormName: string;
|
constructor TIDEWindowCreator.Create(aFormName: string;
|
||||||
CreateFormEvent: TCreateIDEWindowEvent; aLeft, aTop, aWidth, aHeight: string;
|
CreateFormProc: TCreateIDEWindowProc;
|
||||||
aDockSibling: string; aDockAlign: TAlign;
|
CreateFormMethod: TCreateIDEWindowMethod; aLeft, aTop, aWidth,
|
||||||
aMulti: boolean; GetLayoutEvent: TGetDefaultIDEWindowLayoutEvent);
|
aHeight: string; aDockSibling: string; aDockAlign: TAlign; aMulti: boolean;
|
||||||
|
GetLayoutEvent: TGetDefaultIDEWindowLayoutEvent);
|
||||||
begin
|
begin
|
||||||
Create(aFormName);
|
Create(aFormName);
|
||||||
FMulti:=aMulti;
|
FMulti:=aMulti;
|
||||||
@ -590,7 +598,8 @@ begin
|
|||||||
Height:=aHeight;
|
Height:=aHeight;
|
||||||
DockSibling:=aDockSibling;
|
DockSibling:=aDockSibling;
|
||||||
DockAlign:=aDockAlign;
|
DockAlign:=aDockAlign;
|
||||||
OnCreateForm:=CreateFormEvent;
|
OnCreateFormMethod:=CreateFormMethod;
|
||||||
|
OnCreateFormProc:=CreateFormProc;
|
||||||
OnGetLayout:=GetLayoutEvent;
|
OnGetLayout:=GetLayoutEvent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -649,13 +658,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDEWindowCreatorList.Add(aFormName: string;
|
function TIDEWindowCreatorList.Add(aFormName: string;
|
||||||
CreateFormEvent: TCreateIDEWindowEvent; aLeft, aTop, aWidth, aHeight: string;
|
CreateFormProc: TCreateIDEWindowProc;
|
||||||
aDockSibling: string; aDockAlign: TAlign;
|
CreateFormMethod: TCreateIDEWindowMethod; aLeft, aTop, aWidth,
|
||||||
aMulti: boolean;
|
aHeight: string; aDockSibling: string; aDockAlign: TAlign; aMulti: boolean;
|
||||||
GetLayoutEvent: TGetDefaultIDEWindowLayoutEvent): TIDEWindowCreator;
|
GetLayoutEvent: TGetDefaultIDEWindowLayoutEvent): TIDEWindowCreator;
|
||||||
begin
|
begin
|
||||||
ErrorIfFormExists(aFormName);
|
ErrorIfFormExists(aFormName);
|
||||||
Result:=TIDEWindowCreator.Create(aFormName,CreateFormEvent,
|
Result:=TIDEWindowCreator.Create(aFormName,CreateFormProc,CreateFormMethod,
|
||||||
aLeft,aTop,aWidth,aHeight,aDockSibling,aDockAlign,aMulti,GetLayoutEvent);
|
aLeft,aTop,aWidth,aHeight,aDockSibling,aDockAlign,aMulti,GetLayoutEvent);
|
||||||
Add(Result);
|
Add(Result);
|
||||||
end;
|
end;
|
||||||
@ -709,11 +718,14 @@ begin
|
|||||||
debugln(['TIDEWindowCreatorList.GetForm no creator for ',aFormName]);
|
debugln(['TIDEWindowCreatorList.GetForm no creator for ',aFormName]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if Item.OnCreateForm=nil then begin
|
if Assigned(Item.OnCreateFormProc) then begin
|
||||||
|
Item.OnCreateFormProc(Self,aFormName,Result,DisableAutoSizing);
|
||||||
|
end else if Assigned(Item.OnCreateFormMethod) then begin
|
||||||
|
Item.OnCreateFormMethod(Self,aFormName,Result,DisableAutoSizing);
|
||||||
|
end else begin
|
||||||
debugln(['TIDEWindowCreatorList.GetForm no OnCreateForm for ',aFormName]);
|
debugln(['TIDEWindowCreatorList.GetForm no OnCreateForm for ',aFormName]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Item.OnCreateForm(Self,aFormName,Result,DisableAutoSizing);
|
|
||||||
if Result=nil then begin
|
if Result=nil then begin
|
||||||
debugln(['TIDEWindowCreatorList.GetForm create failed for ',aFormName]);
|
debugln(['TIDEWindowCreatorList.GetForm create failed for ',aFormName]);
|
||||||
exit;
|
exit;
|
||||||
|
@ -1881,7 +1881,7 @@ begin
|
|||||||
SetRecentPackagesMenu;
|
SetRecentPackagesMenu;
|
||||||
|
|
||||||
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwPkgGraphExplorer],
|
IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwPkgGraphExplorer],
|
||||||
@CreateIDEWindow,'250','200','400','300');
|
nil,@CreateIDEWindow,'250','200','400','300');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPkgManager.ConnectSourceNotebookEvents;
|
procedure TPkgManager.ConnectSourceNotebookEvents;
|
||||||
|
Loading…
Reference in New Issue
Block a user