|
Re: (wish) RECENT FILES menu to show most recently used files on top
|
Bruno Gauthier
|
Oct 26, 2002 07:59 PDT
|
Hi John,
Hi Bob,
Hi all
Perhaps the soluce to the problem.
That seems to works fine on my pc under xp.
Bruno
in :Class :POPUP (in the wined.f file) change the existing def of
InsertMenuItem:
by this new one :
:M InsertMenuItem: { zMenuText pFunc \ iRank iFlag text$ -- }
recent-files?
IF MAXSTRING LocalAlloc: text$
FALSE to iFlag \ mark as not already
inserted
FALSE To iRank
insertedMenus 0
?DO
mid[] i CELLS+ @ NULL <> \ if the id isn't NULL
IF MF_BYCOMMAND
MAXSTRING
text$ 1+ rel>abs
mid[] i CELLS+ @ \ use the ID to get text
pid Call GetMenuString text$ c!
zMenuText text$ count tuck
CAPS-COMPARE dup 0= if i to iRank then
0= iFlag or to iFlag
THEN
LOOP
iFlag 0= \ if not already inserted
IF insertedMenus 0=
IF NextId mid[] insertedMenus CELLS+ ! \ set the menu
ID
pFunc mfunc[] insertedMenus CELLS+ ! \ set the
function
zMenuText rel>abs
mid[] insertedMenus cells+ @
MF_STRING
pid
Call AppendMenu drop
1 +to insertedMenus
ELSE \ make room for an additional entry
mid[] dup CELL+ insertedMenus CELLS move
mfunc[] dup CELL+ insertedMenus CELLS move
\ the the entry in the table
NextId mid[] !
pFunc mfunc[] !
\ if the table is full, delete last
entry
insertedMenus MAXMENU >=
IF MF_BYCOMMAND
mid[] insertedMenus CELLS+ @
pid
Call DeleteMenu drop
ELSE
1 +to insertedMenus
THEN
\ insert the new entry in menu
zMenuText rel>abs
mid[] @
MF_STRING
MF_BYCOMMAND or
mid[] CELL+ @
pid
Call InsertMenu drop
THEN
ELSE iRank 0<> ( if already the 1st no need to change)
IF \ delete the entry in menu
MF_BYCOMMAND
mid[] iRank CELLS+ @
pid
Call DeleteMenu drop
-1 +to insertedMenus
\ make room for the entry
mid[] dup CELL+ iRank CELLS move
mfunc[] dup CELL+ iRank CELLS move
\ the entry in the table
NextId mid[] !
pFunc mfunc[] !
\ insert the new entry in
menu
zMenuText rel>abs
mid[] @
MF_STRING
MF_BYCOMMAND or
mid[] CELL+ @
pid
Call InsertMenu drop
1 +to insertedMenus
THEN
THEN
THEN
;M
----- Original Message -----
From: John A. Peters
To: Win32Forth@Topica ; win32-@yahoogroups.com
Cc: Bob Smith
Sent: Saturday, October 19, 2002 8:09 PM
Subject: (wish) RECENT FILES menu to show most recently used files on top
Who Priority on list
rls & jap 12 hard, ask rls
RECENT FILES menu to show most recently used files on top, LRF off bottom.
\ Put a double down arrow on the bottom for more files like MS programs
\ Remove "Recent Files" title to make room for two more files in the list
\ How do you remove files from this list, use reg edit?
\ We may have to wait for the completion of the C wrapper project.
|
|
 |
|