Page 1 of 1
Base class for Panel
Posted: Thu Oct 20, 2016 9:55 am
by soa
This is pproably VL 11 but...
When I create a new RP from, say, a tile design It is created with a set of method routines, eg OnAdd, with the redefine option. When I save my own panel as myBasePanel and set the *EXTENDS value to point to it it's method routines do not appear in the new panel. How do I make my base RP act like the LANSA ones.
Re: Base class for Panel
Posted: Thu Oct 20, 2016 10:31 am
by Stewart Marshall
Hi Jim
The short answer is "manually"
As part of the creation of Design parts, we specifically inject code, something we do primarily to save you the keystrokes as you're likely going to need some of the routines.
However, changing the Ancestor or the implemented interface doesn't have any effect on the source. You need to manually code you any redefined routines.
Regards
Re: Base class for Panel
Posted: Thu Oct 20, 2016 5:47 pm
by soa
Surely the same applies with user defined RPs - I know which routines I'm going to use and what code I would like to see included (instance specific, obviously, not generic. The fact that you include these method demonstrates that it is useful. I think it would be a good addition. Obviously some new markup/decoration would be required.
Re: Base class for Panel
Posted: Fri Oct 21, 2016 9:18 am
by Stewart Marshall
Hi Jim
I understand the argument, but I suspect that anything we could automate would risk causing more problems than it solves. Automatically inserting statements in to existing source is a minefield at best.
So perhaps a more pragmatic middle ground; one where you decide what needs redefining and we help you do it quickly.
Attached is an export containing a handful of templates that I use regularly to write the lines of code I write over and over e.g. Define_Map, define_evt and yes, redefining methods.
The templates all have short names such as RM for redefine method or DIM for define input map.
At some point in relatively recent history, we enhanced the editor so that templates could be executed simply by typing the name at the start of a line and pressing enter. To redefine a method, I type RM and press enter. This inserts the following
Code: Select all
Mthroutine Name() Options(*Redefine)
Endroutine
I can then position the cursor in the Name parameter and use Ctrl+Space to select from a list of Ancestor Features.
Suitable compromise...if we do something more intelligent with the cursor position?
Regards
Re: Base class for Panel
Posted: Fri Oct 21, 2016 1:37 pm
by soa
Thanks I'll have a look.