Archive for January, 2013

Cincom® Objectstudio®: Bitmaps in Menu Items

Last October and November we previewed the MarqueeDialog and the Progress Bar. These were inspired by the ObjectStudio New GUI Project, and they will be available in ObjectStudio 8.5.

We’ll talk more about that project in coming months, but for now, the approach is to create a new GUI library of Windows native widgets for ObjectStudio using DLLCC instead of C code.


  • No more primitives—100% Smalltalk code.
  • The code can be changed at any time.
  • Easier for support to send fixes to customers.
  • Customers can now modify or extend the code to their liking.
  • Easier enhancements of features not yet implemented.

Menu Items

The topic of this month’s article is adding bitmap graphics to your menus. This is a feature that was developed for the new GUI.  We were inspired by doing it there to make it available in the upcoming 8.5 release of ObjectStudio as well.

We all know the monochrome bitmaps in the System Menu of Windows.

We already had the checked menu items like in the ObjectStudio View menu.

Now we’ll also provide functionality to assign a custom bitmap to any menu item you want, like this example from the Mapping Tool shows:

Define the Bitmaps

Standard windows usage supports bitmaps with up to 256 colors. (Note that it is possible to use True Color bitmaps in menus by using the OWNERDRAW option.  However, for now, we will leave that as an exercise for the reader.) We tested with bitmaps ranging from 1 bit (monochrome) to 8 bits (256 colors) and they give the required result.

Once you have the desired bitmap, you need to define it in ObjectStudio. This can be done like this:

     loadNamed: #WriteDescriptor
     filename: ’e:\ObjectStudio8.5\icons\bmp\writedescriptor_256.bmp’
     onError: [nil].

Assign a Bitmap to the Menu

The bitmaps can be used on the menu bar and also on popup menus.  The easiest way to associate the bitmap with the menu item is in the openInitialization method.

menu := self mainForm menuBar menus at: 1.
menu setMenuItem: 2 bitmap: (Bitmap loadNamed: #WriteDescriptor).

In the first line, the first menu from the menu bar is assigned to the menu variable.

In the second line, the second menu item from the first menu gets the WriteDescriptor bitmap assigned.

When you assign the bitmap to a menu item in the openInitialization, the menu formItem is automatically updated. If you assign the bitmap later in the process, for example in a popup menu, then you need to manually do:

menu formItem update.

And there you have it. You’ll see the code in 8.5 in the new AbstractMenuItem hierarchy, along with changes to FormSubMenu and menu-related additions to OStudioSystemSupport. It’s a functionality that allows you to brighten up your GUI a bit, and more importantly, it points the way for future GUI enhancements for ObjectStudio.

We are pleased to announce that the evaluation copies of the new releases of ObjectStudio and VisualWorks are now available for personal use!

Cincom ObjectStudio 8.4.1

ObjectStudio 8.4.1 is the maintenance release of the ObjectStudio 8.4 major release, and is the latest release of ObjectStudio. Since ObjectStudio shares a foundation library and VM with VisualWorks, ObjectStudio 8.4.1 improvements include most of the action requests (ARs) and resolutions for VisualWorks 7.9.1, which include over 50 ARs and resolutions representing improvements, refinements and fixes to the product. See the ObjectStudio 8.4.1 major release feature changes by visiting the ObjectStudio product site. Also, for detailed release information, see the ObjectStudio 8.4.1 release notes and readme files.

Cincom VisualWorks 7.9.1
VisualWorks 7.9.1 is the maintenance release of the VisualWorks 7.9 major release, and is the latest release of VisualWorks. The release contains over 50 ARs (action requests) and resolutions, which represent improvements, refinements and fixes to the product. See the VisualWorks 7.9 major release feature changes by visiting the VisualWorks product site. Also, for detailed release information, see the VisualWorks 7.9.1 release notes.

To obtain your evaluation copy of the personal-use versions, click here.