New Posts New Posts RSS Feed - subclassing property class to an object
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

subclassing property class to an object

 Post Reply Post Reply
Author
hellounni View Drop Down
Groupie
Groupie


Joined: 24-November-2014
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote hellounni Quote  Post ReplyReply Direct Link To This Post Topic: subclassing property class to an object
    Posted: 24-November-2014 at 7:02am
Hi Friends,
  Could someone please help me how to find subclassing property class to an object. generic_subclass function is doing object subclassing through my script but I want to do the subclassing through property class. Please help.
 
Thanks,
Unni
Back to Top
administrator View Drop Down
Admin Group
Admin Group

Stefan Mueller

Joined: 25-January-2003
Location: New Zealand
Points: 1028
Post Options Post Options   Thanks (0) Thanks(0)   Quote administrator Quote  Post ReplyReply Direct Link To This Post Posted: 25-November-2014 at 4:26am
Unni,

Applying a property class to an object also works with the generic_subclass function (build 407 fixed and issue with property classes keeping file/path info)!
  
The generic_subclass function takes either a Forms object or a property class and applies it to the given Forms Object.

To find out what property class is applied to an object you can check the D2FP_PAR_NAM/D2FP_PAR_TYP properties (check out the property explorer tool with the "show formsapi information" option switched on). 


Regards,
Stefan
Back to Top
administrator View Drop Down
Admin Group
Admin Group

Stefan Mueller

Joined: 25-January-2003
Location: New Zealand
Points: 1028
Post Options Post Options   Thanks (0) Thanks(0)   Quote administrator Quote  Post ReplyReply Direct Link To This Post Posted: 25-November-2014 at 8:12am
Unni,

i just noticed that build 407 has introduced a bug - when subclassing a property class from within the same module then it should indeed remove the file/path info (as build 407 does) ... but if you apply the property class from an object library then that file/path info has to be left there or else you get error messages loading the module saying that it can't find the property class!

I will fix that bug in the next release, workaround for now is to set that information after you call generic_subclass yourself.

DECLARE
  olb, frm   number;
  obj, obj2  number;

BEGIN
  API_SetFormsPath('d:\fapitest\unni');
  olb := API_LoadModule('d:\fapitest\unni\testlib.olb');
  obj :=  ObjectLib_FindObjByName(olb, 'PCTEST', D2FFO_PROP_CLASS);

  frm := API_LoadModule('d:\fapitest\unni\testsource.fmb');
  obj2 :=  Generic_FindObj( generic_getobjprop(frm, D2FP_BLOCK) , 'ITEM3', D2FFO_ITEM);

  logadd( 'value: ' || to_char(obj) );
  logadd( 'value: ' || to_char(obj2) );

  Generic_SubClass(obj2, obj);
  Generic_SetTextProp(obj2, D2FP_PAR_FLNAM, 'testlib.olb');

  API_SaveModule(frm, 'd:\fapitest\unni\testtarget.fmb');

  API_FreeModule(frm);
  API_FreeModule(olb);
END;

notice the "Generic_SetTextProp(obj2, D2FP_PAR_FLNAM, 'testlib.olb');" line!
Also set D2FP_PAR_FLPATH property if you want to keep the path of the referenced module (usually nobody wants to keep the path).

Regards,
Stefan

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.