|The DrWimp C Application Builder|
|Tailoring Template Library Objects|
The main idea of Template Library Objects is their use to share common code between DrWimpC applications by means of a Template window definition . Clearly not every application will want exactly the same definition so to make them more useful, a Link Name facility has been introduce into DrWi mpC library 1.20. This allows each aplication to add or replace a funciton of the library code of the Template Library Object with its own function. (This cam lso be done with any help string for the icon
to which the object function applies so the aplication can describe the action of its function. To apply
a Link Name to an object in an application's template window definition the Link Name must be
added to the icon name of the icon in the object towhich the funciton applies, in the object definition that has previously been copied into the application's template window definition as previously described in the Template Function pages of this getting started guide. The Link Name is added to the object icon's
name at the beginning of the name and followed by a '->' operator. For example, the !bar2 example
application has four !bar objects defined in i td main window . The nudge up buton in each !bar object has the icon name
|and with a Link Name of 'linktest' this becomes|
The name change can be applied by loading the !bar2 main window into a template editor as usual.
Then opening the template in DrWimpC Application Builder will allow you to define template funcitons for the icon using the Handlers menu by <Selecting> the icon. Functions will be defined for the !bar2 application and main window with icon name linktest. For example a mouse click function would be named -
|A source code editor window would be opened for the main window of the !bar2 application and the edit cursor placed at the start of the bar2_bar2tmpl_main() function body. You can then code youer own funciton.|
The new function can be called before or after or even entirely replace.the object's existing function, or even call the object's function itself.
The Link Name facility is described in more detail in the DrWimpC Functional API StrongHerlp Manual in the page Tailoring Template Objects. To navigate to the page, open the DrWimpC functional API manual either by placing the mouse pointer in the main DRwimpC Application Builder window and pressing the F1 key or using the DrWimpC Application Builder icon bar mrenu Help item sub menu. Then open the Template Functions topic and follow the information icon to an index page and select the Tempate Library Objects topic and finally from the page that opens, the Tailoring Template Objects topic.
|Previous: Copying the DrWimpC and GCC Resources to the RAM disc|