To use the ribbon based interface used in the slide presentation examples, you also need some understanding of modular programming. Again this has been fully explained by Egg-Jan Polle in his pdf Modular Programming in MapBasic. As the example code for Modular Programming in MapBasic uses the menu based version of MapInfo Pro we could modify the User Interface Module: ProjectUI.mb. This module contains menu based code and can be used to demonstrate how to update existing code to a ribbon based interface. One of the advantages of modular code is that only those modules requiring changes need to be modified. All the other modules can be linked again to form the executable without further work or need for compiling of these modules.
When you create custom code you will either have to create images or download them from the web. The presentation by Peter Hors Boller, mentioned earlier, includes the various options regarding images including using one of the numerous icons available within MapInfo Pro. In this coding example some free images for the time, date and about buttons were downloaded from the web. These images were then resized to 32x32 pixels using the Paint program.The above code snippets, when compiled and linked, will create a button with an image of a clock in MapInfo to reflect the fact that this module gives us the current time.
Here is the updated code:-
Here is the code for the About module:-
In summary in this blog we have taken existing legacy code and revised it so that it could be run as a ribbon based application. The code example requires an understanding of how modular programs work as well as some understanding of how to implement ribbon based applications.