I am trying to make the RecentItems fit into my program. I got the [quote]Designing a Recent Items Submenu, By Charles Yeomans[/quote] to work ax he designed it. I now need to change the MenuItem to call that uhmm stuff from a window, so it can work with the methods which call their own opening documents.
I added the following code to a window’s EnableMenuItems event and now I get the error “has no member”
FileOpenRecent.Enabled = (me.RecentItems.Count > 0)
If me.file <> Nil Then RecentItemsMenuItem.Enable
I tried the “Convert to Shared Method” as it is a member of the class App, but that didn’t solve it.
I then tried to change the me… into self… That didn’t work. It’s interesting the IDE won’t present “Self”, but “self”
You must add the menu structure into the Menu Object before it can be used
Hmm. Not sure which you mean.
The MenuItem is a class with a lot structure.
The MenuItem works when it is part of the App, but I changed how it is enabled so it wouldn’t be global.
This is what is a member of the App
Public Shared Property RecentItems as RecentItemsManager
Look down the panel at the left side of the IDE where all you windows and methods are listed
See where it says “MainMenuBar”?
THIS is where you need to set the menu structure
I have MRUF in almost all of my apps… (MRUF=Most Recent Used Files), although I wrote my own methods
Aaah. It was a beginner question. It is also the beginning step.
I added the MenuItem and it solved THAT problem
The (new) MenuItem is simply RecentItems with no Super, so that might be the problem, but when I make the super “RecentItemsManager” it adds another error. So, I think I solved the above error, but…
The next problems are 2 different errors. I’ll put the code on Dropbox since it’s complicated.
It is 2 parts. 1. The Binary of the folder for RecentItemsClasses and 2. The XML of my version of the project with the App.
Binary of Folder
Recent Items Text Project
I’m not planning on leaving this up after the discussion is solved. It is mostly someone else’s code and not for free.
AddCardWindow is the Window and is just a straight up window.
Error 1 shouldn’t be happening since Count is method of the class “RecentItemsManager” and RecentItemsMenuItem.Count (I think inherits from) returns an Integer.
[quote]AddCardWindow.EnableMenuItems, line 22
Not enough arguments: missing Integer value for parameter “index”
FileOpenRecent.Enabled = If me.RecentItems.Count > 0 the[/quote]
Error 2 shouldn’t be happening since File is a method of the RecentItemsMenuItem and returns a folderItem.
[quote]AddCardWindow.EnableMenuItems, line 23
Type “AddCardWindow.AddCardWindow” has no member named “file”
If me.file <> Nil Then RecentItemsMenuItem.Enable[/quote]