mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:19:19 +02:00
* Apply patch from Margers to fix bug ID #6496
git-svn-id: trunk@40804 -
This commit is contained in:
parent
db29d01c15
commit
a9696520fb
@ -1657,7 +1657,10 @@ procedure TIDEApp.UpdateRecentFileList;
|
|||||||
var P: PMenuItem;
|
var P: PMenuItem;
|
||||||
{ID,}I: word;
|
{ID,}I: word;
|
||||||
FileMenu: PMenuItem;
|
FileMenu: PMenuItem;
|
||||||
|
R: TRect;
|
||||||
|
AdjustRecentCount : word;
|
||||||
begin
|
begin
|
||||||
|
if not assigned(MenuBar) then exit;
|
||||||
{ ID:=cmRecentFileBase;}
|
{ ID:=cmRecentFileBase;}
|
||||||
FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
|
FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
|
||||||
repeat
|
repeat
|
||||||
@ -1683,13 +1686,25 @@ begin
|
|||||||
if (P<>nil) and IsSeparator(P) then
|
if (P<>nil) and IsSeparator(P) then
|
||||||
RemoveMenuItem(FileMenu^.SubMenu,P);
|
RemoveMenuItem(FileMenu^.SubMenu,P);
|
||||||
|
|
||||||
if RecentFileCount>0 then
|
GetExtent(R);
|
||||||
AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
|
AdjustRecentCount :=0;
|
||||||
for I:=1 to RecentFileCount do
|
{calculate how much lines on screen for reacent files can be used }
|
||||||
|
if r.b.y-r.a.y -19 > 0 then AdjustRecentCount:=r.b.y-r.a.y -19;
|
||||||
|
{only if there is enough space then show all reacent files }
|
||||||
|
{else cut list shorter }
|
||||||
|
if RecentFileCount < AdjustRecentCount then
|
||||||
|
AdjustRecentCount:=RecentFileCount;
|
||||||
|
|
||||||
|
if AdjustRecentCount>0 then
|
||||||
begin
|
begin
|
||||||
P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
|
AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
|
||||||
kbNoKey,cmRecentFileBase+I,hcRecentFileBase+I,nil);
|
|
||||||
AppendMenuItem(FileMenu^.SubMenu,P);
|
for I:=1 to AdjustRecentCount do
|
||||||
|
begin
|
||||||
|
P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
|
||||||
|
kbNoKey,cmRecentFileBase+I,hcRecentFileBase+I,nil);
|
||||||
|
AppendMenuItem(FileMenu^.SubMenu,P);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ begin
|
|||||||
Mode.col:=x;
|
Mode.col:=x;
|
||||||
Mode.row:=y;
|
Mode.row:=y;
|
||||||
SetScreenVideoMode(Mode);
|
SetScreenVideoMode(Mode);
|
||||||
|
UpdateRecentFileList; {ensure file menu not go over screen}
|
||||||
Redraw;
|
Redraw;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user