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.
CreateMask
This is the code to create the mask
SetTablePath
Selects the tablepath chosen by the user
SelChangedHandler
A reserved procedure, called automatically when the set of selected rows changes.
WinFocusChangedHandler
A reserved procedure, called automatically when the window focus changes
WinClosedHandler
A reserved procedure, called automatically when a Map, Browse, Graph, Layout, Layout Designer, Redistricting, Legend, Legend Designer, or MapBasicwindow is closed.
About
Dialogue box with instructions on how to use the application
End_Program
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.