Hi During the writing of my program I encountered a challenge (not a very big one). I want my program to have a "Recent Files" menu. You know, that list of the most recent files the user has opened/saved. It sounds easy, but it's not really that easy since I need to store full paths+filenames; manage the menu which involves calculating its width (I don't want the menu to take up the whole screen just because the filename is long). I need to shift the items accordingly to the use of the files: the most recent goes to the top the rest get shifted downwards (a process which involves shifting large strings, there's probably a better way, but that's what I figured out in the meantime) Now what if the file opened is already on the list? It has to go to the top and the rest of the items simply to shift downwards, without the least recent filename disappearing from the menu. If the filename is too long its name in the menu needs to be cut to the appropriate width (graphical, not in characters, since the font in the menu is not size- fixed, so there: more calculations) and those three dots need to be added to the end. I want each item to have a keyboard shortcut, index of numbers: 1,2,3,4... etc. There's a little bit more to it, but I'll settle for this. As you see it's a pretty "big" thing since we program in ASM. My program is complete.. I wrote most of the mentioned above, but in a very not-optimized way. I would like to write a library which will handle all of that, and the programmers will only have to interact with it: telling how many items they want on the menu, the width of the menu, the addresses of the buffers to store the filenames and the menu item names. And then of course I want to distribute this library. Now my questions are. Is there already a FREE library like that available (written of course in ASM)? If there is I'd be glad if you appointed me to it. If you haven't heard of such thing I'd be glad if you could appoint me to some docs, that you think I could use to make this lib in the most perfect way (managing menus is supposed to be a pretty common thing, but please don't send me to that, I need docs that could help me figure out how to organize all the strings, maybe not strings, just create index to each menu item and shift that, you get my drift) And last but not least. Is there a strong point in making this thing in a DLL? (which will contain only this baby). Thanks for reading this :) RingZer0
Posted on 2001-03-26 19:54:00 by RingZer0
I think you have a great idea for a commonly used thing. I'd like it in an include file, or lib - not a DLL. I'd look at a program that does this already - AsmEdit by Ewanye L. Wagner is the first that comes to mind (using it right now). He stores the strings in registry like half a billion other pieces of software (maybe that's just my machine :P) They usually have a folder for the name of the program and then in that they have MRU (most recently used) file folders. Some programs have more than one folder. AsmEdit doesn't clip the names in the menu, or provide keyboard shortcuts for them. There is a API that will truncate the names with the three dots for you (in shlwapi.dll I think). bitRAKE
Posted on 2001-03-26 20:15:00 by bitRAKE