Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 19 in printed book and digital formats -- plus a one-year subscription (beginning with 20.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 2.1

FEATURE

Designing a Recent Items Submenu

Issue: 2.1 (August/September 2003)
Author: Charles Yeomans
Author Bio: Charles Yeomans is a compulsive refactorer.
Article Description: No description available.
Article Length (in bytes): 24,324
Starting Page Number: 24
Article Number: 2112
Resource File(s):

Download Icon 2112.zip Updated: 2013-03-10 14:52:17

Related Link(s): None

Excerpt of article text...

Most document-based applications should offer a Recent Items submenu that allow users to quickly open recently-opened files -- or, as buzzword-loving geeks might say, to allow users to exploit locality of reference. Adding such a feature isn't difficult, but since it's something that you might want to use in multiple projects, it's worth spending some time on it. In this article, I'll show how to write some classes that allow you to more or less plug this capability into your projects. Along the way, I'll discuss some of my design and implementation decisions.

The Problem

The first step is to get a clear description of the problem to solve. What I want is a menu item, Open Recent, and a submenu of it that lists recently-opened files. Choosing a submenu item should open the file just as if I had chosen the file from the Open dialog. I would also like to be able to provide for a user-customizable limit on the number of recently-opened files displayed, and I'd like the allow the user to clear the submenu. And I'd like to be able to open a recently-opened file even if it has been moved. Finally, I'd like to save the list of recently-opened files between runs.

...End of Excerpt. Please purchase the magazine to read the full article.