Windows Ribbon Tutorial

This tutorial will show you how to create a Ribbon application similar to WordPad. You will learn how to design the ribbon using the Ribbon Designer and how to hook it up to your application.

Before you start the tutorial, you may want to browse through the MSDN documentation for the Windows Ribbon Framework. This will give you some insights into the philosophy behind this framework. You can skip over the parts the discuss the XML format and the C++ APIs. These details will be handled by the Ribbon Designer and the Delphi Ribbon Class Library respectively.

You should have downloaded and unpacked the "Windows Ribbon Framework for Delphi". The library contains the following directories:

  • Designer: this directory contains the source code for Ribbon Designer.
  • Designer\Bin: this directory contains the pre-compiled version of the Ribbon Designer. Just start RibbonDesigner.exe to launch it. This directory also contains the Microsoft Ribbon Compiler (UICC.exe and UICCDLL.dll). These files are used by the Ribbon Designer to compile a Ribbon XML file to a binary format that can be linked to your executable as a resource.
  • Lib: this directory contains the source code for the Windows Ribbon Framework for Delphi. You should add this directory to your Library Path in Delphi to make it available to all your Delphi projects. Alternatively, you can add this directory to the Search Path of individual Delphi projects to make the library only available to those projects.
  • Samples: this directory contains some sample applications that show how to work with the ribbon framework.
  • Samples\Low Level: contains Delphi translations of the ribbon samples that come with the Windows 7 SDK. These applications use the Microsoft Ribbon APIs directly to implement the ribbon functionality.
  • Samples\Medium Level: contains the same samples, but using the Delphi Ribbon Class Library instead of the MS Ribbon API. This approach should be more familiar to Delphi developers and cuts the amount of code needed to implement a ribbon by more than half. This directory also contains a Text Pad example, which shows how to create a WordPad-like application. This tutorial will show you how to create this application.

Now you are ready to start the tutorial, which involves the following steps:

Next: Design the ribbon using the Ribbon Designer