Files
eiffel-org/documentation/current/platform-specifics/microsoft-windows/eiffelribbon/index.wiki
halw 864484a851 Author:halw
Date:2011-10-25T15:00:06.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@998 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
2011-10-26 20:07:41 +00:00

100 lines
6.7 KiB
Plaintext

[[Property:title|EiffelRibbon]]
[[Property:weight|2]]
[[Property:uuid|2f24957c-7fdc-f918-8c0d-37a9ef525508]]
{{UnderConstruction}}
=Introduction=
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 [http://msdn.microsoft.com/en-us/library/aa338198.aspx#office2007uifordevelopers_detaileddesignofthenewuisystem 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.
{{note|''Although EiffelRibbon classes work with EiffelVision 2 which is multi-platform, systems using EiffelRibbon can be targeted only to the Microsoft Windows platform.''}}
[[Image:EiffelRibbon window 01|A ribbon on a window]]
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 [http://msdn.microsoft.com/en-us/library/cc872782.aspx the '''Ribbons''' page] on Microsoft's MSDN site.
The EiffelRibbon design tool helps you configure a ribbon in much the same way that [[EiffelBuild|EiffelBuild]] (ES Builder) helps you layout a GUI application.
==System requirements==
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
==The EiffelRibbon design tool==
The EiffelRibbon design tool allows you to design a ribbon graphically, then generate the ribbon markup file and the Eiffel classes necessary to implement your design.
[[Image:EiffelRibbon design tool 01|EiffelRibbon design tool]]
Figure 2: An EiffelRibbon project open in the EiffelRibbon design tool.
The interface of the design tool mimics that of [[EiffelBuild|EiffelBuild]]. That is, the interface contains three panes that have counterparts in EiffelBuild:
# Type selector: A list of all the elements available for use in a ribbon.
# Layout constructor: A structured view of the organization of the elements used in a particular ribbon design.
# Object editor: The properties of the ribbon element which is currently selected in the Layout constructor.
So, if you've used EiffelBuild, the the EiffelRibbon design tool should seem quite familiar to you.
The typical usage of the design tool is much like the typical usage of EiffelBuild.
* Create a new project ( <code lang="text">File -> New Project...</code> ) and choose a location for your EiffelRibbon project.
* Configure the ribbon by adding elements, name the elements, and choose icons for buttons.
* Save the project.
* Generate the code.
* Use EiffelStudio to compile the generated code.
==Current state of development==
Initial distribution:
* 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 <code>EV_RIBBON_TITLED_WINDOW</code> is provided with the library. <code>EV_RIBBON_TITLED_WINDOW</code> is a descendant of the standard EiffelVision 2 class <code>EV_TITLED_WINDOW</code>. The ribbon classes generated by EiffelRibbon tool can be added only to instances of <code>EV_RIBBON_TITLED_WINDOW</code>.
==Known issues and limitations==
Initial distribution:
* 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.
=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 "<code>EV_RIBBON</code>". Some examples are: <code>EV_RIBBON_BUTTON</code>, <code>EV_RIBBON_DROP_DOWN_GALLERY</code>, and <code>EV_RIBBON_COMBO_BOX_ITEM</code>. Again, similar to EiffelVision 2, the class <code>EV_RIBBON_COMBO_BOX_ITEM</code> models an item for a <code>EV_RIBBON_COMBO_BOX</code>.
So, here again, if you are familiar with EiffelVision 2, then EiffelRibbon should not seem very foreign to you.
=EiffelRibbon Applications=
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 "<code>_IMP</code>" 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 3 is a portion of a generated class <code>BUTTON_CHANGE_SMALL_IMAGE</code>, representing a ribbon button, from one of the EiffelRibbon examples. <code>BUTTON_CHANGE_SMALL_IMAGE</code> is a heir to <code>BUTTON_CHANGE_SMALL_IMAGE_IMP</code>. You can see that in the redefined version of <code>create_interface_objects</code> code has been added to add an agent to the <code>select_actions</code> 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.
[[Image:EiffelRibbon application 01|An EiffelRibbon application in EiffelStudio.]]
Figure 3.