Was: Window - Subwindows - $event - Now: Lets use a Superclass instead.

Reg Paling reg.paling at lokanet.com
Fri Feb 8 18:04:07 EST 2019


Hi Michael,

Here's a more direct way to walk the list of $bobjs.
lvRef is an Item Reference.
I've just typed this without testing, so you might need to tweak it.

  Set reference lvRef to $cwind.$bobjs.$first()
   While lvRef
     OK message {[lvRef().$name]}
     If lvRef.$myattribute=whateverIwanttotestfor
       Calculate lvRef.$top as lvRef.$top+32
     End If
     Set reference lvRef to cwind.$bobjs.$next(lvRef)
   End While

Regards,
Reg


On 9/2/19 8:01 am, Michael Mantkowski wrote:
> Thanks everyone for your thoughts on using subwindows.
>
> After this issue and others that kept cropping up, we have decided to use a
> templated Superclass instead to set our windows to the new look while we go
> through the long process of rewriting them.  So of course, we have run into
> an issue there as well.  I created the superclass window and attached it to
> all my user facing windows.  I am using the code below in the $construct of
> the Superclass to move the top-level objects of the window we are opening
> down 32 pixels to allow for the new unified title that the Superclass is
> putting on everything.  Too bad I can't put a picture on here.  Its pretty
> cool. Lol
>
> Anyway, I have run across an issue and I think it is a bug in Omnis.  I
> cannot seem to address background objects of the opening window form the
> superclass methods.  Foreground objects work fine but I cannot even manually
> set a reference to a $bobjs on the window.  I have tried "$cinst, $cinst(),
> $cwind, $cwind(), $iwindows.$cinst, $iwindows.WindowName, etc. and any
> combination results in a NULL reference.
>
> Below is the code I am using to do this.  Works fine for the foreground
> objects but failing with the background.  You can see in the $bobjs section
> that I have been playing around with trying to create a usable reference.
> Failed every time so far.
>
> This is from Omnis 4.3.2.1 but I have also tried it in Omnis 10 with the
> same result.
>
> Any ideas?
>
> If inNewInterface
> Begin reversible block
> Set current list lvObjList
> End reversible block
> Do
> $cinst.$objs.$makelist($ref.$ref,$ref.$ident,$ref.$objtype,$ref.$name,$ref.$
> top,$ref.$left,$ref.$height,$ref.$width,$ref.$edgefloat) Returns lvObjList
> Do
> lvObjList.$redefine(lvResRef,lvResId,lvResType,lvResName,lvResTop,lvResLeft,
> lvResHeight,lvResWidth,lvResEdgeFloat)
> ;  Clear Edge Float Options - Place Objects in New Location
> Delete line in list {1}     ;; Remove the Template Object
> For each line in list from 1 to #LN step 1
> Calculate lvObjList.lvResRef.$edgefloat as 'none'
> Calculate lvObjList.lvResRef.$top as lvObjList.lvResRef.$top+32
> End For
>
> ;  Does not seem to work with background objects.  Need to figure this out.
> Do
> $cinst.$bobjs.$makelist($ref.$ref,$ref.$ident,$ref.$objtype,$ref.$name,$ref.
> $top,$ref.$left,$ref.$height,$ref.$width,$ref.$edgefloat) Returns lvObjList
> Do
> lvObjList.$redefine(lvResRef,lvResId,lvResType,lvResName,lvResTop,lvResLeft,
> lvResHeight,lvResWidth,lvResEdgeFloat)
> ;  Clear Edge Float Options - Place Objects in New Location
> For each line in list from 1 to #LN step 1
> Calculate lvObjList.lvResRef.$edgefloat as 'none'
> Calculate lvObjList.lvResRef.$top as lvObjList.lvResRef.$top+32
> If lvObjList.lvResId=1211|lvObjList.lvResId=1233|lvObjList.lvResId=1259
> Load from list
> Set reference lvRef to $cwind     ;; $cwind.$bobjs.[lvResId].$ref
> Breakpoint
> Set reference lvRef to lvRef.$bobjs
> Breakpoint
> Set reference lvRef to lvRef.$bobjs.1211  ;; Fails here
> Breakpoint
>
>
> Set reference lvRef to $iwindows.Payments.$bobjs.1233.$ref
> OK message  {[lvObjList.lvResRef.$top]  [lvObjList.lvResRef.$ref.$top]
> [lvRef.$top]}
> Breakpoint
> End If
> End For
>
> Calculate $cinst.$height as $cinst.$height+32
>
> ;  Reset Edge Float Options
> For each line in list from 1 to #LN step 1
> Calculate lvObjList.lvResRef.$edgefloat as lvObjList.lvResEdgeFloat
> End For
>
> Calculate $cinst.$objs.TemplateBox.$width as $cinst.$width+2
> Calculate $cinst.$objs.TemplateBox.$visible as kTrue
> End If
>
> *********************************************************************
> Michael Mantkowski
> ClienTrax Software
> 1-614-875-2245
> *********************************************************************
>
>   
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com





More information about the omnisdev-en mailing list