mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 08:36:04 +02:00
SourceEditor/IDE Layout: more multi-window changes
git-svn-id: trunk@24194 -
This commit is contained in:
parent
e1d960ff51
commit
3e92d4df61
@ -809,6 +809,8 @@ var XMLConfig: TXMLConfig;
|
|||||||
OldDebuggerType: TDebuggerType;
|
OldDebuggerType: TDebuggerType;
|
||||||
Path: String;
|
Path: String;
|
||||||
CurPath: String;
|
CurPath: String;
|
||||||
|
i: Integer;
|
||||||
|
name: String;
|
||||||
|
|
||||||
procedure LoadBackupInfo(var BackupInfo: TBackupInfo; const Path:string);
|
procedure LoadBackupInfo(var BackupInfo: TBackupInfo; const Path:string);
|
||||||
var i:integer;
|
var i:integer;
|
||||||
@ -878,6 +880,14 @@ begin
|
|||||||
Path+'ShowCompileDialog/Value',false);
|
Path+'ShowCompileDialog/Value',false);
|
||||||
|
|
||||||
// windows
|
// windows
|
||||||
|
i := XMLConfig.GetValue(Path+'Desktop/FormIdCount', 0);
|
||||||
|
while i > 0 do begin
|
||||||
|
name := XMLConfig.GetValue(Path+'Desktop/FormIdList/a'+IntToStr(i), '');
|
||||||
|
if (name <> '') and (IDEWindowLayoutList.ItemByFormID(name) = nil) then
|
||||||
|
CreateWindowLayout(name);
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
|
||||||
FIDEWindowLayoutList.LoadFromXMLConfig(XMLConfig,
|
FIDEWindowLayoutList.LoadFromXMLConfig(XMLConfig,
|
||||||
Path+'Desktop/');
|
Path+'Desktop/');
|
||||||
FIDEDialogLayoutList.LoadFromConfig(FConfigStore,
|
FIDEDialogLayoutList.LoadFromConfig(FConfigStore,
|
||||||
|
@ -91,6 +91,7 @@ end;
|
|||||||
procedure TWindowOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
procedure TWindowOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||||
var
|
var
|
||||||
Window: TNonModalIDEWindow;
|
Window: TNonModalIDEWindow;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
// windows
|
// windows
|
||||||
MinimizeAllOnMinimizeMainCheckBox.Caption := dlgMinimizeAllOnMinimizeMain;
|
MinimizeAllOnMinimizeMainCheckBox.Caption := dlgMinimizeAllOnMinimizeMain;
|
||||||
@ -108,6 +109,11 @@ begin
|
|||||||
for Window := Succ(Low(TNonModalIDEWindow)) to High(TNonModalIDEWindow) do
|
for Window := Succ(Low(TNonModalIDEWindow)) to High(TNonModalIDEWindow) do
|
||||||
Add(GetCaptionFor(Window));
|
Add(GetCaptionFor(Window));
|
||||||
Add(dlgObjInsp);
|
Add(dlgObjInsp);
|
||||||
|
for i := 0 to EnvironmentOptions.IDEWindowLayoutList.Count - 1 do
|
||||||
|
if (EnvironmentOptions.IDEWindowLayoutList[i].FormID <> DefaultObjectInspectorName) and
|
||||||
|
(NonModalIDEFormIDToEnum(EnvironmentOptions.IDEWindowLayoutList[i].FormID) = nmiwNone)
|
||||||
|
then
|
||||||
|
Add(EnvironmentOptions.IDEWindowLayoutList[i].FormCaption);
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -253,6 +259,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
case Index - Ord(High(TNonModalIDEWindow)) of
|
case Index - Ord(High(TNonModalIDEWindow)) of
|
||||||
0: Layout := FLayouts.ItemByFormID(DefaultObjectInspectorName);
|
0: Layout := FLayouts.ItemByFormID(DefaultObjectInspectorName);
|
||||||
|
else
|
||||||
|
Layout := FLayouts.ItemByFormCaption(WindowPositionsListBox.Items[Index]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -172,6 +172,7 @@ type
|
|||||||
|
|
||||||
TIDEWindowLayout = class
|
TIDEWindowLayout = class
|
||||||
private
|
private
|
||||||
|
FFormCaption: string;
|
||||||
FVisible: boolean;
|
FVisible: boolean;
|
||||||
fWindowPlacement: TIDEWindowPlacement;
|
fWindowPlacement: TIDEWindowPlacement;
|
||||||
fWindowPlacementsAllowed: TIDEWindowPlacements;
|
fWindowPlacementsAllowed: TIDEWindowPlacements;
|
||||||
@ -222,6 +223,8 @@ type
|
|||||||
procedure CloseForm;
|
procedure CloseForm;
|
||||||
public
|
public
|
||||||
property FormID: string read GetFormID write SetFormID;
|
property FormID: string read GetFormID write SetFormID;
|
||||||
|
function FormBaseID(out SubIndex: Integer): String;
|
||||||
|
property FormCaption: string read FFormCaption;
|
||||||
property WindowPlacement: TIDEWindowPlacement
|
property WindowPlacement: TIDEWindowPlacement
|
||||||
read fWindowPlacement write SetWindowPlacement;
|
read fWindowPlacement write SetWindowPlacement;
|
||||||
property WindowPlacementsAllowed: TIDEWindowPlacements
|
property WindowPlacementsAllowed: TIDEWindowPlacements
|
||||||
@ -265,6 +268,7 @@ type
|
|||||||
function IndexOf(const FormID: string): integer;
|
function IndexOf(const FormID: string): integer;
|
||||||
function ItemByForm(AForm: TCustomForm): TIDEWindowLayout;
|
function ItemByForm(AForm: TCustomForm): TIDEWindowLayout;
|
||||||
function ItemByFormID(const FormID: string): TIDEWindowLayout;
|
function ItemByFormID(const FormID: string): TIDEWindowLayout;
|
||||||
|
function ItemByFormCaption(const aFormCaption: string): TIDEWindowLayout;
|
||||||
function ItemByEnum(ID: TNonModalIDEWindow): TIDEWindowLayout;
|
function ItemByEnum(ID: TNonModalIDEWindow): TIDEWindowLayout;
|
||||||
procedure CloseForm(AForm: TCustomForm);
|
procedure CloseForm(AForm: TCustomForm);
|
||||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
@ -433,6 +437,7 @@ begin
|
|||||||
P:=GetXMLFormID;
|
P:=GetXMLFormID;
|
||||||
if P='' then exit;
|
if P='' then exit;
|
||||||
P:=Path+P+'/';
|
P:=Path+P+'/';
|
||||||
|
FFormCaption := XMLConfig.GetValue(P+'Caption/Value', fFormID);
|
||||||
// placement
|
// placement
|
||||||
fWindowPlacement:=StrToIDEWindowPlacement(XMLConfig.GetValue(
|
fWindowPlacement:=StrToIDEWindowPlacement(XMLConfig.GetValue(
|
||||||
P+'WindowPlacement/Value',IDEWindowPlacementNames[fWindowPlacement]));
|
P+'WindowPlacement/Value',IDEWindowPlacementNames[fWindowPlacement]));
|
||||||
@ -468,6 +473,7 @@ begin
|
|||||||
P:=GetXMLFormID;
|
P:=GetXMLFormID;
|
||||||
if P='' then exit;
|
if P='' then exit;
|
||||||
P:=Path+P+'/';
|
P:=Path+P+'/';
|
||||||
|
XMLConfig.SetDeleteValue(P+'Caption/Value',FFormCaption,'');
|
||||||
// placement
|
// placement
|
||||||
XMLConfig.SetDeleteValue(P+'WindowPlacement/Value',
|
XMLConfig.SetDeleteValue(P+'WindowPlacement/Value',
|
||||||
IDEWindowPlacementNames[fWindowPlacement],
|
IDEWindowPlacementNames[fWindowPlacement],
|
||||||
@ -527,14 +533,33 @@ end;
|
|||||||
|
|
||||||
procedure TIDEWindowLayout.CloseForm;
|
procedure TIDEWindowLayout.CloseForm;
|
||||||
begin
|
begin
|
||||||
|
GetCurrentPosition;
|
||||||
Form:=nil;
|
Form:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TIDEWindowLayout.FormBaseID(out SubIndex: Integer): String;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result := FormID;
|
||||||
|
SubIndex := -1;
|
||||||
|
i := length(Result);
|
||||||
|
while (i > 0) and (Result[i] in ['0'..'9']) do
|
||||||
|
dec(i);
|
||||||
|
if (i < 1) or (i = length(Result)) then
|
||||||
|
exit;
|
||||||
|
SubIndex := StrToInt(copy(Result, i+1, length(Result)));
|
||||||
|
Result := copy(Result, 1, i);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TIDEWindowLayout.SetForm(const AValue: TCustomForm);
|
procedure TIDEWindowLayout.SetForm(const AValue: TCustomForm);
|
||||||
begin
|
begin
|
||||||
if fForm=AValue then exit;
|
if fForm=AValue then exit;
|
||||||
fForm:=AValue;
|
fForm:=AValue;
|
||||||
if (Form<>nil) then fFormID:=FForm.Name;
|
if (Form<>nil) then begin
|
||||||
|
fFormID := FForm.Name;
|
||||||
|
FFormCaption := fForm.Caption;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDEWindowLayout.GetFormID: string;
|
function TIDEWindowLayout.GetFormID: string;
|
||||||
@ -551,7 +576,9 @@ var
|
|||||||
begin
|
begin
|
||||||
Result:=GetFormID;
|
Result:=GetFormID;
|
||||||
for i:=1 to length(Result) do
|
for i:=1 to length(Result) do
|
||||||
if not (Result[i] in ['A'..'Z','a'..'z','_']) then
|
if not ( (Result[i] in ['A'..'Z','a'..'z','_'])
|
||||||
|
or ( (i > 1) and (Result[i] in ['0'..'9'])) )
|
||||||
|
then
|
||||||
Result[i]:='_';
|
Result[i]:='_';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -632,11 +659,6 @@ begin
|
|||||||
Top:=Form.RestoredTop;
|
Top:=Form.RestoredTop;
|
||||||
Width:=Form.RestoredWidth;
|
Width:=Form.RestoredWidth;
|
||||||
Height:=Form.RestoredHeight;
|
Height:=Form.RestoredHeight;
|
||||||
end else begin
|
|
||||||
Left:=0;
|
|
||||||
Top:=0;
|
|
||||||
Width:=0;
|
|
||||||
Height:=0;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -731,8 +753,11 @@ procedure TIDEWindowLayoutList.SaveToXMLConfig(XMLConfig: TXMLConfig;
|
|||||||
const Path: string);
|
const Path: string);
|
||||||
var i: integer;
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
for i:=0 to Count-1 do
|
XMLConfig.SetDeleteValue(Path+'FormIdCount',Count,0);
|
||||||
|
for i:=0 to Count-1 do Begin
|
||||||
|
XMLConfig.SetDeleteValue(Path+'FormIdList/a'+IntToStr(i), Items[i].FormID, '');
|
||||||
Items[i].SaveToXMLConfig(XMLConfig,Path);
|
Items[i].SaveToXMLConfig(XMLConfig,Path);
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDEWindowLayoutList.ItemByForm(AForm: TCustomForm): TIDEWindowLayout;
|
function TIDEWindowLayoutList.ItemByForm(AForm: TCustomForm): TIDEWindowLayout;
|
||||||
@ -758,6 +783,20 @@ begin
|
|||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TIDEWindowLayoutList.ItemByFormCaption(const aFormCaption: string
|
||||||
|
): TIDEWindowLayout;
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
i := Count - 1;
|
||||||
|
while i >= 0 do begin
|
||||||
|
Result := Items[i];
|
||||||
|
if Result.FormCaption = aFormCaption then
|
||||||
|
exit;
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TIDEWindowLayoutList.ItemByEnum(ID: TNonModalIDEWindow
|
function TIDEWindowLayoutList.ItemByEnum(ID: TNonModalIDEWindow
|
||||||
): TIDEWindowLayout;
|
): TIDEWindowLayout;
|
||||||
begin
|
begin
|
||||||
|
28
ide/main.pp
28
ide/main.pp
@ -7580,12 +7580,13 @@ var NewSrcEdit: TSourceEditor;
|
|||||||
SrcNotebook: TSourceNotebook;
|
SrcNotebook: TSourceNotebook;
|
||||||
begin
|
begin
|
||||||
AFilename:=AnUnitInfo.Filename;
|
AFilename:=AnUnitInfo.Filename;
|
||||||
{$note Todo:remap window index in all unit infos}
|
|
||||||
{$note Todo:remap layout for each windows }
|
|
||||||
if (WindowIndex < 0) then
|
if (WindowIndex < 0) then
|
||||||
SrcNotebook := SourceEditorManager.ActiveOrNewSourceWindow
|
SrcNotebook := SourceEditorManager.ActiveOrNewSourceWindow
|
||||||
else if (WindowIndex >= SourceEditorManager.SourceWindowCount) then
|
else
|
||||||
SrcNotebook := SourceEditorManager.NewSourceWindow
|
if (WindowIndex >= SourceEditorManager.SourceWindowCount) then begin
|
||||||
|
SrcNotebook := SourceEditorManager.NewSourceWindow;
|
||||||
|
Project1.MoveUnitWindowIndex(WindowIndex, SourceEditorManager.ActiveSourceWindowIndex);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
SrcNotebook := SourceEditorManager.SourceWindows[WindowIndex];
|
SrcNotebook := SourceEditorManager.SourceWindows[WindowIndex];
|
||||||
|
|
||||||
@ -16367,12 +16368,13 @@ end;
|
|||||||
|
|
||||||
procedure TMainIDE.OnApplyWindowLayout(ALayout: TIDEWindowLayout);
|
procedure TMainIDE.OnApplyWindowLayout(ALayout: TIDEWindowLayout);
|
||||||
var
|
var
|
||||||
l: TNonModalIDEWindow;
|
WindowType: TNonModalIDEWindow;
|
||||||
BarBottom: Integer;
|
BarBottom: Integer;
|
||||||
DockingAllowed: Boolean;
|
DockingAllowed: Boolean;
|
||||||
NewHeight: Integer;
|
NewHeight: Integer;
|
||||||
NewBounds: TRect;
|
NewBounds: TRect;
|
||||||
SrcNoteBook: TSourceNotebook;
|
SrcNoteBook: TSourceNotebook;
|
||||||
|
SubIndex: Integer;
|
||||||
begin
|
begin
|
||||||
if (ALayout=nil) or (ALayout.Form=nil) then exit;
|
if (ALayout=nil) or (ALayout.Form=nil) then exit;
|
||||||
// debugln('TMainIDE.OnApplyWindowLayout ',ALayout.Form.Name,' ',ALayout.Form.Classname,' ',IDEWindowPlacementNames[ALayout.WindowPlacement],' ',ALayout.CustomCoordinatesAreValid,' ',ALayout.Left,' ',ALayout.Top,' ',ALayout.Width,' ',ALayout.Height);
|
// debugln('TMainIDE.OnApplyWindowLayout ',ALayout.Form.Name,' ',ALayout.Form.Classname,' ',IDEWindowPlacementNames[ALayout.WindowPlacement],' ',ALayout.CustomCoordinatesAreValid,' ',ALayout.Left,' ',ALayout.Top,' ',ALayout.Width,' ',ALayout.Height);
|
||||||
@ -16381,9 +16383,13 @@ begin
|
|||||||
ALayout.Form.Constraints.MaxHeight:=0;
|
ALayout.Form.Constraints.MaxHeight:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
l:=NonModalIDEFormIDToEnum(ALayout.FormID);
|
WindowType:=NonModalIDEFormIDToEnum(ALayout.FormID);
|
||||||
|
SubIndex := -1;
|
||||||
|
if WindowType = nmiwNone then begin
|
||||||
|
WindowType:=NonModalIDEFormIDToEnum(ALayout.FormBaseID(SubIndex));
|
||||||
|
end;
|
||||||
if DockingAllowed then begin
|
if DockingAllowed then begin
|
||||||
if l in [nmiwSourceNoteBookName] then
|
if WindowType in [nmiwSourceNoteBookName] then
|
||||||
ALayout.WindowPlacement:=iwpDocked;
|
ALayout.WindowPlacement:=iwpDocked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -16432,7 +16438,7 @@ begin
|
|||||||
// no layout found => use default
|
// no layout found => use default
|
||||||
BarBottom:=MainIDEBar.Top+MainIDEBar.Height;
|
BarBottom:=MainIDEBar.Top+MainIDEBar.Height;
|
||||||
// default window positions
|
// default window positions
|
||||||
case l of
|
case WindowType of
|
||||||
nmiwMainIDEName:
|
nmiwMainIDEName:
|
||||||
begin
|
begin
|
||||||
NewHeight:=95;
|
NewHeight:=95;
|
||||||
@ -16447,8 +16453,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
nmiwSourceNoteBookName:
|
nmiwSourceNoteBookName:
|
||||||
begin
|
begin
|
||||||
ALayout.Form.SetBounds(250,BarBottom+30,Max(50,Screen.Width-300),
|
if SubIndex < 0 then SubIndex := 0;
|
||||||
Max(50,Screen.Height-200-BarBottom));
|
SubIndex := SubIndex * 30;
|
||||||
|
ALayout.Form.SetBounds(250 + SubIndex, BarBottom + 30 + SubIndex,
|
||||||
|
Max(50,Screen.Width-300-SubIndex), Max(50,Screen.Height-200-BarBottom-SubIndex));
|
||||||
if DockingAllowed then begin
|
if DockingAllowed then begin
|
||||||
debugln('TMainIDE.OnApplyWindowLayout ',dbgsName(ALayout.Form));
|
debugln('TMainIDE.OnApplyWindowLayout ',dbgsName(ALayout.Form));
|
||||||
ALayout.Form.ManualDock(MainIDEBar,nil,alBottom,false);
|
ALayout.Form.ManualDock(MainIDEBar,nil,alBottom,false);
|
||||||
|
@ -209,6 +209,7 @@ begin
|
|||||||
while (i>=0) do begin
|
while (i>=0) do begin
|
||||||
if Screen.CustomForms[i].Caption=(Sender as TIDEMenuCommand).Caption then
|
if Screen.CustomForms[i].Caption=(Sender as TIDEMenuCommand).Caption then
|
||||||
begin
|
begin
|
||||||
|
Screen.CustomForms[i].Show;
|
||||||
Screen.CustomForms[i].BringToFront;
|
Screen.CustomForms[i].BringToFront;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
@ -740,6 +740,7 @@ type
|
|||||||
procedure RemoveNonExistingFiles(RemoveFromUsesSection: boolean = true);
|
procedure RemoveNonExistingFiles(RemoveFromUsesSection: boolean = true);
|
||||||
function CreateProjectFile(const Filename: string): TLazProjectFile; override;
|
function CreateProjectFile(const Filename: string): TLazProjectFile; override;
|
||||||
procedure UpdateVisibleUnit(AnEditor: TSourceEditorInterface; AWindowIndex: Integer);
|
procedure UpdateVisibleUnit(AnEditor: TSourceEditorInterface; AWindowIndex: Integer);
|
||||||
|
procedure MoveUnitWindowIndex(OldIndex, NewIndex: Integer);
|
||||||
// search
|
// search
|
||||||
function IndexOf(AUnitInfo: TUnitInfo): integer;
|
function IndexOf(AUnitInfo: TUnitInfo): integer;
|
||||||
function IndexOfUnitWithName(const AnUnitName: string;
|
function IndexOfUnitWithName(const AnUnitName: string;
|
||||||
@ -2885,6 +2886,36 @@ begin
|
|||||||
Units[i].IsVisibleTab := Units[i].EditorComponent = AnEditor;
|
Units[i].IsVisibleTab := Units[i].EditorComponent = AnEditor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TProject.MoveUnitWindowIndex(OldIndex, NewIndex: Integer);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
AnUnitInfo: TUnitInfo;
|
||||||
|
begin
|
||||||
|
i:=UnitCount-1;
|
||||||
|
while (i>=0) do begin
|
||||||
|
AnUnitInfo:=Units[i];
|
||||||
|
|
||||||
|
if (OldIndex < 0) then begin
|
||||||
|
// index inserted
|
||||||
|
if (AnUnitInfo.WindowIndex >= NewIndex) then
|
||||||
|
AnUnitInfo.WindowIndex := AnUnitInfo.WindowIndex + 1;
|
||||||
|
end
|
||||||
|
else if AnUnitInfo.WindowIndex = OldIndex then begin
|
||||||
|
AnUnitInfo.WindowIndex := NewIndex;
|
||||||
|
end
|
||||||
|
else if (OldIndex > NewIndex) then begin
|
||||||
|
if (AnUnitInfo.WindowIndex >= NewIndex) and (AnUnitInfo.WindowIndex < OldIndex) then
|
||||||
|
AnUnitInfo.WindowIndex := AnUnitInfo.WindowIndex + 1;
|
||||||
|
end
|
||||||
|
else if (OldIndex < NewIndex) then begin
|
||||||
|
if (AnUnitInfo.WindowIndex > OldIndex) and (AnUnitInfo.WindowIndex <= NewIndex) then
|
||||||
|
AnUnitInfo.WindowIndex := AnUnitInfo.WindowIndex - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TProject.RemoveNonExistingFiles(RemoveFromUsesSection: boolean);
|
procedure TProject.RemoveNonExistingFiles(RemoveFromUsesSection: boolean);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
@ -4274,6 +4274,7 @@ end;
|
|||||||
constructor TSourceNotebook.Create(AOwner: TComponent);
|
constructor TSourceNotebook.Create(AOwner: TComponent);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
n: TComponent;
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FManager := TSourceEditorManager(AOwner);
|
FManager := TSourceEditorManager(AOwner);
|
||||||
@ -4281,7 +4282,8 @@ begin
|
|||||||
FFocusLock := 0;
|
FFocusLock := 0;
|
||||||
Visible:=false;
|
Visible:=false;
|
||||||
i := 2;
|
i := 2;
|
||||||
if SourceEditorManager.SourceWindowCount > 0 then begin
|
n := Owner.FindComponent(NonModalIDEWindowNames[nmiwSourceNoteBookName]);
|
||||||
|
if (n <> nil) and (n <> self) then begin
|
||||||
while Owner.FindComponent(NonModalIDEWindowNames[nmiwSourceNoteBookName]+IntToStr(i)) <> nil do
|
while Owner.FindComponent(NonModalIDEWindowNames[nmiwSourceNoteBookName]+IntToStr(i)) <> nil do
|
||||||
inc(i);
|
inc(i);
|
||||||
Name := NonModalIDEWindowNames[nmiwSourceNoteBookName] + IntToStr(i);
|
Name := NonModalIDEWindowNames[nmiwSourceNoteBookName] + IntToStr(i);
|
||||||
@ -4295,9 +4297,9 @@ begin
|
|||||||
KeyPreview:=true;
|
KeyPreview:=true;
|
||||||
FProcessingCommand := false;
|
FProcessingCommand := false;
|
||||||
|
|
||||||
if EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(self.Name) <> nil then {$note create new layouts for extra windows}
|
if EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(self.Name) = nil then
|
||||||
|
EnvironmentOptions.CreateWindowLayout(self.name);
|
||||||
EnvironmentOptions.IDEWindowLayoutList.Apply(Self, self.Name);
|
EnvironmentOptions.IDEWindowLayoutList.Apply(Self, self.Name);
|
||||||
//EnvironmentOptions.IDEWindowLayoutList.Apply(Self,Name);
|
|
||||||
ControlDocker:=TLazControlDocker.Create(Self);
|
ControlDocker:=TLazControlDocker.Create(Self);
|
||||||
ControlDocker.Name:='SourceEditor';
|
ControlDocker.Name:='SourceEditor';
|
||||||
{$IFDEF EnableIDEDocking}
|
{$IFDEF EnableIDEDocking}
|
||||||
@ -5089,9 +5091,13 @@ procedure TSourceNotebook.DoClose(var CloseAction: TCloseAction);
|
|||||||
begin
|
begin
|
||||||
inherited DoClose(CloseAction);
|
inherited DoClose(CloseAction);
|
||||||
{$IFDEF MultiSrcWindow}
|
{$IFDEF MultiSrcWindow}
|
||||||
if PageCount = 0 then {$NOTE maybe keep the last one}
|
if PageCount = 0 then begin { $NOTE maybe keep the last one}
|
||||||
CloseAction := caFree
|
if EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(Self.Name) <> nil then
|
||||||
else
|
EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(Self.Name).CloseForm;
|
||||||
|
// Make the name unique, because it may not immediately be released
|
||||||
|
Name := Name + '___' + IntToStr(PtrInt(Pointer(Self)));
|
||||||
|
CloseAction := caFree;
|
||||||
|
end else
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
CloseAction := caHide;
|
CloseAction := caHide;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user