Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 23 FEB 2011 11:46:20PM dsig@sigafoos.org wrote:

I am reviewing a lot of old code and looking at ways to make it more modular etc. One way will be using promoted events. Some exist and need some cleaning and new ones need to be created.

For example, there is a got/lost focus event on almost every control .. traping bg color and changing in on focus. This is true in most every window. But is it better form to create a "WINDOW" level PE instead of a "EVENT" level PE. it would seem to me that a Window level pe would better.

Also, in the PE_COMMUTER is there a preferred standard on the calling params? ie PE_COMMUTER(EVENT,CTLRENTID,CTRLCLASSID,PARAM1…. or the ctrlentid first?

I know i am being anal but want to be sure that just about anyone could pick this up and run with it.


At 23 FEB 2011 11:52PM dsig@sigafoos.org wrote:

I forgot to ask .. if creating a window level PE, does it make sense to use the windows commuter module for code or do you use a seperate PE_COMMUTER module? It seems to me that the window commuter module would be better as it then encapsulates all the event code for the form. But what do you think. If you use the windows commuter module then do you change the name of the event .. say pegotfocus .. you might have a quick event handling other event process say


At 24 FEB 2011 04:38AM cpates@sprezzatura.com wrote:

Hi Dave,

If you're creating an event that only applies to controls on that window then it should be at the WINDOW level (though I've never had a reason to do this ;)

e.g.

MYAPP*GOTFOCUS*MYWIN

However, your example appears to suggest that this is a feature that is global to your application in which case it should be EVENT specific?

e.g.

MYAPP*GOTFOCUS..OIWIN*

One pitfall to beware of in PE handlers is coding for specific controls/windows - this leads to a maintenance nightmare if you're not careful. It's not so bad in WINDOW level handlers because they are related to a specific window, but for a global handler it's not such a good idea. It's better to set some sort of flag on a control (e.g. with an '@'property) and look for that instead when you need to allow for different behavior.

Also, in the PE_COMMUTER is there a preferred standard on the calling params? ie PE_COMMUTER(EVENT,CTLRENTID,CTRLCLASSID,PARAM1…. or the ctrlentid first?

I use (ctrlEntID, event, p1…. etc), i.e. putting the control first which is the way most commuter module code I've seen does it. I wouldn't mix the the two styles. Having said that the Sprezz PE layer was written before Rev put any PE/Commuter module tools in OI so it's not based on what's there now :)

cpates@sprezzatura.com

Captain's Blog

Battlestar Sprezzatura - BSG 77

Colonial leaders in all things RevSoft


At 24 FEB 2011 04:40AM cpates@sprezzatura.com wrote:

I'd have the PE handler call the window commuter module with a modified name.

cpates@sprezzatura.com

Captain's Blog

Battlestar Sprezzatura - BSG 77

Colonial leaders in all things RevSoft


At 24 FEB 2011 01:40PM dsigafoos wrote:

If 'MYAPP*GOTFOCUS*MYWIN' is a window specific (all controls) PE for gotfocus event .. why would 'MYAPP*GOTFOCUS..OIWIN*' be for all windows (all controls). I get the OIWIN being for all windows but what are the '..' for in the name. would it make more sense if it was 'MYAPP*GOTFOCUS*OIWIN'. Just asking …

Also, it sounds like you make PE for 'global' events .. ex GOTFOCUS for all windows all controls (MYAPP*GOTFOCUS..OIWIN*). In this case you wouldn't try to use a windows commuter module but would use a PE_GOTFOCUS commuter module. Yes …

Becoming clear as mud but starting to remember this stuff. Been away way too long


At 24 FEB 2011 02:14PM cpates@sprezzatura.com wrote:

Hi Dave,

If 'MYAPP*GOTFOCUS*MYWIN' is a window specific (all controls) PE for gotfocus event .. why would 'MYAPP*GOTFOCUS..OIWIN*' be for all windows (all controls). I get the OIWIN being for all windows but what are the '..' for in the name. would it make more sense if it was 'MYAPP*GOTFOCUS*OIWIN'. Just asking …

Actually - no idea - this was all written by the original OI 2.0 team way back when … but as a guess - what would happen if you created a window called "OIWIN"? I suspect the ".." and "*" characters are so that it doesn't get applied to a single window as they are illegal in window IDs.

Also, it sounds like you make PE for 'global' events .. ex GOTFOCUS for all windows all controls (MYAPP*GOTFOCUS..OIWIN*). In this case you wouldn't try to use a windows commuter module but would use a PE_GOTFOCUS commuter module. Yes …

Yes.

Becoming clear as mud but starting to remember this stuff. Been away way too long

I agree - you have :) If it helps here's a good starting point with promoted events - Read the "X-Events" on page 16 …

SENL v1i7

cpates@sprezzatura.com

Captain's Blog

Battlestar Sprezzatura - BSG 77

Colonial leaders in all things RevSoft


At 24 FEB 2011 02:49PM dsig@sigafoos.org wrote:

I did read that and Don's at srpcs .. the problem is when i read something my brain always say "why?" or "would this work" and then i a start asking questions. It was easier when I worked at the lab and could go in and ask Brie or MikeI about stuff

Thanks for hanging in there

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/3df4b35920a29dae85257841001a3729.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1