If you look at the original MapBasic code for this application you will note that it is all contained within a single program which can be compiled to an .mbx executable file.
This is the code to create the mask
Selects the tablepath chosen by the user
A reserved procedure, called automatically when the set of selected rows changes.
A reserved procedure, called automatically when the window focus changes
A reserved procedure, called automatically when a Map, Browse, Graph, Layout, Layout Designer, Redistricting, Legend, Legend Designer, or MapBasicwindow is closed.
Dialogue box with instructions on how to use the application
Procedure to check whether the use wishes to end the application
For more information on the SelChangedHandler, WinFocusChangedHandler and WinClosed Handler please look in the MapBasic Help section where you can also find example code.
The Main procedure contains the code to create a menu and a button which can be enabled if the user selects a polygon or polygons. The first step in creating a new ribbon based version is to change the Main procedure to reflect the new ribbon interface. This is shown in the following screen shots.
In addition we need to create a definition file as shown in the following screen shot:-
If WindowInfo(FrontWindow), WIN_INFO_TYPE) = WIN_MAPPER Then:-
The other additional procedure is called RibbonMaskSwitchDisplay as shown in the following code:-
This code is based on the slide presentation given in November 2016 by Peter Horsbøll Møller. This presentation gives an overview of the features used in this current application and should be studied in conjunction with this blog to understand how how the application works.