mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 10:19:17 +02:00
Larger Change Directory dialog for larger console/terminal dimensions
This commit is contained in:
parent
8d7a6cc778
commit
97b79b3d4e
@ -2064,12 +2064,14 @@ begin
|
|||||||
|
|
||||||
R.Assign(3, 3, 30, 4);
|
R.Assign(3, 3, 30, 4);
|
||||||
DirInput := New(PInputLine, Init(R, FileNameLen+4));
|
DirInput := New(PInputLine, Init(R, FileNameLen+4));
|
||||||
|
DirInput^.GrowMode:=gfGrowHiX;
|
||||||
Insert(DirInput);
|
Insert(DirInput);
|
||||||
R.Assign(2, 2, 17, 3);
|
R.Assign(2, 2, 17, 3);
|
||||||
Control := New(PLabel, Init(R,slDirectoryName, DirInput));
|
Control := New(PLabel, Init(R,slDirectoryName, DirInput));
|
||||||
Insert(Control);
|
Insert(Control);
|
||||||
R.Assign(30, 3, 33, 4);
|
R.Assign(30, 3, 33, 4);
|
||||||
Control := New(PHistory, Init(R, DirInput, HistoryId));
|
Control := New(PHistory, Init(R, DirInput, HistoryId));
|
||||||
|
Control^.GrowMode:=gfGrowHiX or gfGrowLoX;
|
||||||
Insert(Control);
|
Insert(Control);
|
||||||
|
|
||||||
R.Assign(32, 6, 33, 16);
|
R.Assign(32, 6, 33, 16);
|
||||||
@ -2077,6 +2079,7 @@ begin
|
|||||||
Insert(Control);
|
Insert(Control);
|
||||||
R.Assign(3, 6, 32, 16);
|
R.Assign(3, 6, 32, 16);
|
||||||
DirList := New(PDirListBox, Init(R, PScrollBar(Control)));
|
DirList := New(PDirListBox, Init(R, PScrollBar(Control)));
|
||||||
|
DirList^.GrowMode:=gfGrowHiX or gfGrowHiY;
|
||||||
Insert(DirList);
|
Insert(DirList);
|
||||||
R.Assign(2, 5, 17, 6);
|
R.Assign(2, 5, 17, 6);
|
||||||
Control := New(PLabel, Init(R, slDirectoryTree, DirList));
|
Control := New(PLabel, Init(R, slDirectoryTree, DirList));
|
||||||
@ -2084,13 +2087,17 @@ begin
|
|||||||
|
|
||||||
R.Assign(35, 6, 45, 8);
|
R.Assign(35, 6, 45, 8);
|
||||||
OkButton := New(PButton, Init(R, slOk, cmOK, bfDefault));
|
OkButton := New(PButton, Init(R, slOk, cmOK, bfDefault));
|
||||||
|
OkButton^.GrowMode:=gfGrowHiX or gfGrowLoX;
|
||||||
Insert(OkButton);
|
Insert(OkButton);
|
||||||
Inc(R.A.Y,3); Inc(R.B.Y,3);
|
Inc(R.A.Y,3); Inc(R.B.Y,3);
|
||||||
ChDirButton := New(PButton,Init(R,slChDir,cmChangeDir,
|
ChDirButton := New(PButton,Init(R,slChDir,cmChangeDir,
|
||||||
bfNormal));
|
bfNormal));
|
||||||
|
ChDirButton^.GrowMode:=gfGrowHiX or gfGrowLoX;
|
||||||
Insert(ChDirButton);
|
Insert(ChDirButton);
|
||||||
Inc(R.A.Y,3); Inc(R.B.Y,3);
|
Inc(R.A.Y,3); Inc(R.B.Y,3);
|
||||||
Insert(New(PButton, Init(R,slRevert, cmRevert, bfNormal)));
|
Control := New(PButton, Init(R,slRevert, cmRevert, bfNormal));
|
||||||
|
Control^.GrowMode:=gfGrowHiX or gfGrowLoX;
|
||||||
|
Insert(Control);
|
||||||
if AOptions and cdHelpButton <> 0 then
|
if AOptions and cdHelpButton <> 0 then
|
||||||
begin
|
begin
|
||||||
//Inc(R.A.Y,3); Inc(R.B.Y,3);
|
//Inc(R.A.Y,3); Inc(R.B.Y,3);
|
||||||
|
@ -325,11 +325,20 @@ end;
|
|||||||
|
|
||||||
procedure TIDEApp.RunDir;
|
procedure TIDEApp.RunDir;
|
||||||
var
|
var
|
||||||
s : DirStr;
|
S,Dir : DirStr;
|
||||||
|
D : PFPChDirDialog;
|
||||||
begin
|
begin
|
||||||
s:=GetRunDir;
|
{$push}{$I-}
|
||||||
SelectDir(s,hidRunDir);
|
GetDir(0,Dir);
|
||||||
SetRunDir(s);
|
{$pop}
|
||||||
|
S:=GetRunDir;
|
||||||
|
S:=FExpand(S);
|
||||||
|
New(D, Init(cdNormal, hidRunDir));
|
||||||
|
if ExecuteDialog(D,@S)= cmOk then
|
||||||
|
SetRunDir(S);
|
||||||
|
{$push}{$I-}
|
||||||
|
ChDir(Dir);
|
||||||
|
{$pop}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
PFPChDirDialog = ^TFPChDirDialog;
|
PFPChDirDialog = ^TFPChDirDialog;
|
||||||
TFPChDirDialog = object(TChDirDialog)
|
TFPChDirDialog = object(TEditChDirDialog)
|
||||||
constructor Init(AOptions: Word; HistoryId: Sw_Word);
|
constructor Init(AOptions: Word; HistoryId: Sw_Word);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4637,6 +4637,7 @@ begin
|
|||||||
DirInput^.getData(S);
|
DirInput^.getData(S);
|
||||||
R.Assign(3, 3, 30, 4);
|
R.Assign(3, 3, 30, 4);
|
||||||
DInput := New(PEditorInputLine, Init(R, FileNameLen+4));
|
DInput := New(PEditorInputLine, Init(R, FileNameLen+4));
|
||||||
|
DInput^.GrowMode:=gfGrowHiX;
|
||||||
DInput^.SetData(S);
|
DInput^.SetData(S);
|
||||||
InsertBefore(DInput,DirInput); {insert before to preserv order as it was}
|
InsertBefore(DInput,DirInput); {insert before to preserv order as it was}
|
||||||
Delete(DirInput);
|
Delete(DirInput);
|
||||||
@ -4653,6 +4654,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
Control:=Control^.Next;
|
Control:=Control^.Next;
|
||||||
end;
|
end;
|
||||||
|
{resize}
|
||||||
|
if Desktop^.Size.Y > 26 then
|
||||||
|
GrowTo(Size.X,Desktop^.Size.Y-6);
|
||||||
|
if Desktop^.Size.X > 80 then
|
||||||
|
GrowTo(Min(Desktop^.Size.X-(80-Size.X),102),Size.Y);
|
||||||
{set focus on the new input line}
|
{set focus on the new input line}
|
||||||
DirInput^.Focus;
|
DirInput^.Focus;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user