- 18.07 (released) ...
- The EiffelRibbon Library
- EiffelRibbon Applications
- Usage notes
EiffelRibbon is a library of classes with an associated tool which allows the integration of the Microsoft Windows "Ribbon" into graphical user interfaces programmed with EiffelVision 2 and targeted to Microsoft Windows. The ribbon is part of a revamped user interface approach introduced by Microsoft with the 2007 release of the Microsoft Office applications. So you've experienced the ribbon if you've used Microsoft Word, PowerPoint, or Excel from 2007 or later.
Figure 1: A ribbon at the top of a window.
The EiffelRibbon library contains the classes that are used to implement the ribbon facilities. The classes in the EiffelRibbon library all have class names beginning "EV_", the default prefix for EiffelVision 2 classes. So the EiffelRibbon classes can be seen as an extension to the EiffelVision 2 library. If you've used EiffelVision 2 to create applications with graphical user interfaces, then the EiffelRibbon class won't look unfamiliar to you. However, unlike other EiffelVision 2 classes, the EiffelRibbon classes only work in applications targeted to Microsoft Windows.
To gain a detailed understanding of the goals of Microsoft's Ribbon technology including some guidelines on designing effective ribbons, see the '''Ribbons''' page on Microsoft's MSDN site.
The EiffelRibbon Library
The EiffelRibbon library contains the classes necessary to add ribbons to EiffelVision 2 applications. As stated above, you won't really need to use the library directly. Rather, you use the EiffelRibbon tool to build an application that uses the library classes.
Still you may find it interesting to browse the classes in the library. You'll see that as in the EiffelVision 2 library, many of the classes are there to provide support for the various elements that can be used in an application. Most of the class names for EiffelRibbon-specific elements begin with the prefix "
EV_RIBBON". Some examples are:
EV_RIBBON_COMBO_BOX_ITEM. Again, similar to EiffelVision 2, the class
EV_RIBBON_COMBO_BOX_ITEM models an item for a
So, here again, if you are familiar with EiffelVision 2, then EiffelRibbon should not seem very foreign to you.
When you build an application with the EiffelRibbon tool, it generates classes for you. These classes are often clients or heirs to classes in the EiffelRibbon library. The classes generated for the objects on your ribbon should look familiar to you as well. For example, as with EiffelBuild, for each ribbon object, say a button, there will be a class ending with the suffix "
_IMP" which will get regenerated each time you request the EiffelRibbon tool to generate classes. Also generated is an heir to that class with a name that does not include the suffix. This class you are free to edit, as it will not be regenerated. It is in these editable classes that you provide the action sequences for your ribbon objects' behaviors.
The class shown in the Edit pane of EiffelStudio in Figure 2 is a portion of a generated class
BUTTON_CHANGE_SMALL_IMAGE, representing a ribbon button, from one of the EiffelRibbon examples.
BUTTON_CHANGE_SMALL_IMAGE is a heir to
BUTTON_CHANGE_SMALL_IMAGE_IMP. You can see that in the redefined version of
create_interface_objects code has been added to add an agent to the
select_actions for the ribbon button. In this case, it's an inline agent that will toggle the associated image back and forth between two different images.
EiffelRibbon projects can be built in one of two different project modes. The project mode is selected from the Project menu of the EiffelRibbon design tool.
The default mode, called DLL mode, is the most all encompassing project mode. It has the advantage that the full capabilities of EiffelRibbon are accessible. In DLL mode, a separate DLL is created to contain the generated code for each ribbon created for the project.
The alternative to DLL mode is Application mode. Application mode allows almost all the capabilities of DLL mode, but includes all ribbon code in the project's executable image (.exe). For this reason, it is necessary to re-freeze the project after changes when using Application mode. Re-freezing is not necessary in DLL mode.
Both modes allow multiple ribbons to be created for multiple windows. However certain restrictions apply in Application mode that do not apply in DLL mode. In DLL mode, different DLL's are created for each ribbon. These DLL's are separate and do not share data. However, in Application mode, a number of ribbon facilities, including the help button, the quick access toolbar, and the mini toolbar, are shared among all the ribbons defined. In DLL mode, these facilities are not shared and as such can be different for each ribbon.
To use the EiffelRibbon library and tools you must have:
- Windows 7
- The Microsoft C compiler provided with either:
- Windows SDK 7.0 or greater
- Visual Studio 2008 or greater
Current state of development
- The EiffelRibbon library is not usable directly. The EiffelRibbon design tool allows you to design a ribbon and will generate code that relies on the EiffelRibbon library.
- A class
EV_RIBBON_TITLED_WINDOWis provided with the library.
EV_RIBBON_TITLED_WINDOWis a descendant of the standard EiffelVision 2 class
EV_TITLED_WINDOW. The ribbon classes generated by EiffelRibbon tool can be added only to instances of
Known issues and limitations
- Resizing policy is not yet supported.
- When working in Application Mode, it is necessary to freeze the target system each time the EiffelRibbon code is regenerated. This is not necessary in DLL Mode.