` Printed Icetips Article

Icetips Article



Par2: Derive a method
2001-11-29 -- Rick Martin
 
I'm assuming you want this to automatically happen for all of the browses in
your program.
1) Create a new .CLW and .INC file in the LibSrc folder to hold your new
class. You want the !ABCIncludeFile bit of magic near the top of your .inc
file. Look at some of the other class files as samples.
2) Declare your class in the .inc file, be sure to derive the class from
BrowseClass. You'll want to include abbrowse.inc at the top of your file.
Also, make sure you include the MODULE and LINK portions of the class
definition. Copy these from another class and change the module name to your
new file.
3) Declare the prototypes for the methods you want to add or derive. Use the
keyword Derive on virtual methods you are overriding. This will generate
compiler errors if you do something wrong.
3) Write your methods in the .clw file. Don't forget to call the Parent
method if you want that functionality to still occur. Put your popup Kill
statement after the parent call.
4) In your .APP go to the Global button and go out on the tabs until you get
to the Classes tab. In the Browser button change the default browse class to
your new class name.
5) hit the Refresh ABC button.
6) Compile
7) If you application is multi-Dll, you need to change the default browse
class in the globals for each one. I use a template that sets these values
for me that I include in all of my .app files. The template variable for the
default browse class is %BrowserType.

It is a bit of working setting up the first time. But once everything is in
place you'll find it very easy to change the base classes functionality or
to add your own features.



Printed November 21, 2024, 12:42 pm
This article has been viewed/printed 35309 times.