At the last ESUG conference in Gent, Andreas Hiltner gave a lightning talk about the new Cincom® ObjectStudio® GUI project. The goal of this project is to create a new GUI library of Windows-native widgets for ObjectStudio using DLLCC instead of writing them in C. The first widget we would like to present in this series is the MarqueeDialog.

Benefits

  • No more primitives—100% Smalltalk code.
  • The code can be changed at any time.
  • It makes it easier for Support to send fixes to customers.
  • Customers can now overwrite or change the code to their liking.
  • Easy enhancements of features not yet implemented.

MarqueeDialog

The MarqueeDialog is the first widget we would like to focus on.  The marquee is a bar that shows some simple animation while a larger process is being performed, and the system seems to be idle. The marquee shows you that the system is working, so you don’t need to panic. Unlike a typical progress bar, the marquee style does not show you how much of the task is complete. It’s useful to indicate activity when you don’t have a clear set of steps from start to finish.

A typical example of a marquee is:

Using this marquee dialog in your application is actually very simple.

Protocol

To create a new MarqueeDialog, you have the option of the following two methods:

  1. createTitle: aString, or
  2. createTitle: aString position: aPosition extent: anExtent in which aPosition and anExtent are Point objects.

When you use “MarqueeDialog createTitle: ‘Database Query’,” you create a dialog that will appear at position 225@475 and with a size of 1160@350. It will look like this:

By using “MarqueeDialog createTitle: ‘Database Query’ position: 400@800 extent: 1300@250.”, you define where you want the dialog and the size of it. In this case you get:

Once you have a MarqueeDialog instance, you can send it the “showWhile:

marquee := MarqueeDialog
createTitle: 'Database Query'
position: 400@800
extent: 1300@250.
marquee showWhile:
[self someTimeConsumingCode]

As long as the code in the showWhile block is executing, the marquee dialog animation will be shown. When the code execution finishes, the dialog will close.