The last thing to do in our subclass definition is adding the Action Event Handler. The purpose of this property is to store the address of the method that will be invoked when the user selects a given menu item based on this class (i.e.: a recent item from the “Recent Items” submenu). Next, add a new property to the class using this data in the Inspector Panel: Parameteres: Caption As String, Value As String. Then, add a new Delegate to the subclass using the following data in the Inspector Panel: So, add a new class to the project using the following data in the Inspector Panel: This event is the one that will be fired every time the user selects an entry among those listed in the “Recent Items” submenu from the main File menu. This will be a subclass of the MenuItem class, so we can implement the Action Event Handler. Once you create a new Xojo Desktop project the first thing we need to do is to add a new class to it because this will be a dynamically created submenu. This blog post will teach you one of the multiple approaches to do this in Xojo. It’s helpful and common these days to add a “Recent Items” menu that tracks the last opened files or other recent searches among other things.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |