View Issue Details

IDProjectCategoryView StatusLast Update
0006496FPCTextmode IDEpublic2019-01-08 05:16
ReporterSalvatore LicciardiAssigned ToMichael Van Canneyt 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOSAllOS Version
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.3.1 
Summary0006496: ide 1.0.6, menu file
Description¦ New ¦ ile Debug Tools Options Window Help 20:06:58
¦ New from template... ¦
¦ Open... F3 ¦
¦ Reload ¦
¦ Save F2 ¦
¦ Save as... ¦
¦ Save all ¦
+---------------------------¦
¦ Print ¦
¦ Print setup ¦
+---------------------------¦
¦ Change dir... ¦
¦ Command shell ¦
¦ Exit Alt+X ¦
+---------------------------¦
¦ 1 C:\#\atapi_cdd.TXT ¦
¦ 2 C:\#\CERCA_SC.TXT ¦
¦ 3 C:\#\interE.txt ¦
¦ 4 C:\#\REN.TXT ¦
¦ 5 C:\#\XMOVE.TXT ¦
¦ 6 C:\#\QDIR.TXT ¦
¦ 7 C:\#\SETFDT.TXT ¦
¦ 8 C:\#\winzip10.txt ¦
¦ 9 C:\#\ACDC22.TXT ¦
+---------------------------+

In this example the menu file not work.
If number of row is > resolution_Y-4, can you add a sub-menu "recent file" and insert here

the closed files?
Additional InformationReporter: Salvatore Licciardi
EMail: turylicciardi at tiscalinet dot it
TagsNo tags attached.
Fixed in Revision40804
FPCOldBugId4606
FPCTarget-
Attached Files
  • fp-ide-mrulist.png (28,009 bytes)
    fp-ide-mrulist.png (28,009 bytes)
  • fp-ide-mrulist-normal.png (27,655 bytes)
    fp-ide-mrulist-normal.png (27,655 bytes)
  • menuAdjust.patch (1,939 bytes)
    Index: packages/ide/fpide.pas
    ===================================================================
    --- packages/ide/fpide.pas	(revision 40775)
    +++ packages/ide/fpide.pas	(working copy)
    @@ -1657,7 +1657,10 @@
     var P: PMenuItem;
         {ID,}I: word;
         FileMenu: PMenuItem;
    +    R: TRect;
    +    AdjustRecentCount : word;
     begin
    +  if not assigned(MenuBar) then exit;
     {  ID:=cmRecentFileBase;}
       FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
       repeat
    @@ -1683,13 +1686,25 @@
       if (P<>nil) and IsSeparator(P) then
          RemoveMenuItem(FileMenu^.SubMenu,P);
     
    -  if RecentFileCount>0 then
    +  GetExtent(R);
    +  AdjustRecentCount :=0;
    +  {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
          AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
    -  for I:=1 to RecentFileCount do
    -  begin
    -    P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
    -        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;
     
    Index: packages/ide/fpmwnd.inc
    ===================================================================
    --- packages/ide/fpmwnd.inc	(revision 40775)
    +++ packages/ide/fpmwnd.inc	(working copy)
    @@ -38,6 +38,7 @@
           Mode.col:=x;
           Mode.row:=y;
           SetScreenVideoMode(Mode);
    +      UpdateRecentFileList; {ensure file menu not go over screen}
           Redraw;
         end;
     end;
    
    menuAdjust.patch (1,939 bytes)

Activities

Bart Broersma

2012-12-05 23:08

reporter   ~0064168

What exactly is the bug here, or is it feature request for a "recent file list"?
(If so, severity should be "feature", not "severe".)
I cannot see anything wrong with the current file menu of FP IDE 1.0.12 (2012/10/29)

Salvatore Licciardi

2012-12-09 17:44

reporter   ~0064217

you cannot see anything wrong if "recent file list" is short. Try with 9 files. A submenu was an idea

Bart Broersma

2012-12-09 21:29

reporter   ~0064221

I do not see any "recent file list" in FP IDE.

Salvatore Licciardi

2012-12-09 23:25

reporter   ~0064222

not exist. Open and close 9 file. Clic over menu FILE, now is wrong

Bart Broersma

2012-12-12 18:00

reporter   ~0064259

I opend and closed > 12 files.
The MRU list is always max 9 items, and I don't see anything wrong with it.
It displays OK, and it works a expected (tha is, clicking on it opens the correct file).
I attach screenshot (fp-ide-mrulist.png)

Can you please describe what is "wrong":
- it displays incorrect? (please attach a screenshot)
- it does not open correct file?
- something else?

Also, which version FP, fpc (if trunk, revision also), which OS?

2012-12-12 18:00

 

fp-ide-mrulist.png (28,009 bytes)
fp-ide-mrulist.png (28,009 bytes)

Salvatore Licciardi

2012-12-12 21:39

reporter   ~0064261

from fp-ide-mrulist.png ... where are menu file, edit ...? are hide

2012-12-12 22:58

 

fp-ide-mrulist-normal.png (27,655 bytes)
fp-ide-mrulist-normal.png (27,655 bytes)

Bart Broersma

2012-12-12 23:02

reporter   ~0064266

At last, I see it now.
I'm a little bit slow.

Just for anyone else reading this: when you open the File menu (and the MRU list is long enough), the top of the File menu is 1 line to high, so it covers other top level menu items to the right of it.
Compare fp-ide-mrulist.png and fp-ide-mrulist-normal.png

Marģers

2019-01-05 23:36

reporter  

menuAdjust.patch (1,939 bytes)
Index: packages/ide/fpide.pas
===================================================================
--- packages/ide/fpide.pas	(revision 40775)
+++ packages/ide/fpide.pas	(working copy)
@@ -1657,7 +1657,10 @@
 var P: PMenuItem;
     {ID,}I: word;
     FileMenu: PMenuItem;
+    R: TRect;
+    AdjustRecentCount : word;
 begin
+  if not assigned(MenuBar) then exit;
 {  ID:=cmRecentFileBase;}
   FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
   repeat
@@ -1683,13 +1686,25 @@
   if (P<>nil) and IsSeparator(P) then
      RemoveMenuItem(FileMenu^.SubMenu,P);
 
-  if RecentFileCount>0 then
+  GetExtent(R);
+  AdjustRecentCount :=0;
+  {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
      AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
-  for I:=1 to RecentFileCount do
-  begin
-    P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
-        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;
 
Index: packages/ide/fpmwnd.inc
===================================================================
--- packages/ide/fpmwnd.inc	(revision 40775)
+++ packages/ide/fpmwnd.inc	(working copy)
@@ -38,6 +38,7 @@
       Mode.col:=x;
       Mode.row:=y;
       SetScreenVideoMode(Mode);
+      UpdateRecentFileList; {ensure file menu not go over screen}
       Redraw;
     end;
 end;
menuAdjust.patch (1,939 bytes)

Marģers

2019-01-05 23:43

reporter   ~0113198

Last edited: 2019-01-05 23:44

View 2 revisions

added patch makes shorter list of recent files if can not fit in screen. 19 lines of screen not usable for recent files so in 25 line mode only 6 recent files will be shown.
Added call to UpdateRecentFileList on ResizeApplicaton. Maybe not best place for that kinda stuff but it works.

Michael Van Canneyt

2019-01-08 05:16

administrator   ~0113254

Applied the patch, thank you !

Issue History

Date Modified Username Field Change
2008-03-16 13:18 Jonas Maebe FPCTarget => -
2008-03-16 13:18 Jonas Maebe Reporter FPC core team => Salvatore Licciardi
2008-03-16 13:18 Jonas Maebe Additional Information Updated
2012-12-05 23:08 Bart Broersma Note Added: 0064168
2012-12-09 17:44 Salvatore Licciardi Note Added: 0064217
2012-12-09 21:29 Bart Broersma Note Added: 0064221
2012-12-09 23:25 Salvatore Licciardi Note Added: 0064222
2012-12-12 18:00 Bart Broersma Note Added: 0064259
2012-12-12 18:00 Bart Broersma File Added: fp-ide-mrulist.png
2012-12-12 21:39 Salvatore Licciardi Note Added: 0064261
2012-12-12 22:58 Bart Broersma File Added: fp-ide-mrulist-normal.png
2012-12-12 23:02 Bart Broersma Note Added: 0064266
2019-01-05 23:36 Marģers File Added: menuAdjust.patch
2019-01-05 23:43 Marģers Note Added: 0113198
2019-01-05 23:44 Marģers Note Edited: 0113198 View Revisions
2019-01-08 05:16 Michael Van Canneyt Fixed in Revision => 40804
2019-01-08 05:16 Michael Van Canneyt Note Added: 0113254
2019-01-08 05:16 Michael Van Canneyt Status new => resolved
2019-01-08 05:16 Michael Van Canneyt Fixed in Version => 3.3.1
2019-01-08 05:16 Michael Van Canneyt Resolution open => fixed
2019-01-08 05:16 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-01-08 05:16 Michael Van Canneyt Target Version => 3.2.0