Subwindows - $event

Michael Mantkowski michaelj at clientrax.com
Thu Jul 13 13:55:13 EDT 2017


Hi Terry,

Thanks, this is almost exactly what I pieced together after a few other
responses here on the list.

The two lines of code below are in the $event method of the Parent Window.
$test is in the class assigned as the subwindow.  I had actually just copied
the exCancel and evOk sections of the $event to that method.  Seems to do
what I am looking for.  This is still all proof of concept so I am sure it
will be streamlined.

On evOk
    Set reference lvRef to $cinst.$objs.SubWindowBox.$objs.SubWindow
    Do lvRef.$test


*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************


-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf
Of Terry Young
Sent: Thursday, July 13, 2017 1:13 PM
To: omnisdev-en at lists.omnis-dev.com
Subject: Re: Subwindows - $event

Hi Brian,


I deal with this issue whenever I use a sub window to actually enter data
instead of using a popup window to do the edits and adds.  My parent window
has a tabbed pane filed that holds numerous sub windows; in this example,
the pane contains a paged pane with three sub windows.  One key here is to
set a reference to current sub window. regardless of where it is.  The
button to start the data entry is on the sub window.


The parent window receives the Ok event and then passes to the sub window's
$msPersonalOK method which then calls the sub window's $event method



Here is how I deal with this..

In the $event of the parent window, I place the following code..


On evOK

  Switch $cinst.$objs.wDataHomeTabbedPane.$panenumber(ivCurPaneRef)

    Case 6

      Do ivCurPaneRef.$msPersonalOK() Returns lvRtnFlag

      Quit method

    Default

    ;

  End Switch


On evCancel

  Switch $cinst.$objs.wDataHomeTabbedPane.$panenumber(ivCurPaneRef)

    Case 6

    Do ivCurPaneRef.$msPersonalCancel() Returns lvRtnFlag

    Quit method

    Default

    ;

  End Switch

In the field $event of the tabbed pane field, I do the following to set the
ivCurPaneRef item reference..
On evTabSelected     ;; Event Parameters - pTabNumber ( integer )
  If #EDATA
    Queue tab
    Quit event handler (Discard event)
  End If
  Set reference ivCurPaneRef to ''

  If pTabNumber=1
      bla, bla...
  Else If pTabNumber=6; the pane contains a PagedPane with three sub
windows; I am interested in the first one
    If
$cinst.$objs.wDataHomeTabbedPane.$objs.StaffPgPane.$objs.wStaffHoursSub.$cla
ssname<>$windows.wStaffHours().$name
      Do
$cinst.$objs.wDataHomeTabbedPane.$objs.StaffPgPane.$objs.wStaffHoursSub.$cla
ssname.$assign($windows.wStaffHours().$name)
      Do
$cinst.$objs.wDataHomeTabbedPane.$objs.StaffPgPane.$objs.wStaffHoursSub.$msO
pen()
    Else
      Do
$cinst.$objs.wDataHomeTabbedPane.$objs.StaffPgPane.$objs.wStaffHoursSub.$msO
pen(1)
    End If
    Set reference ivCurPaneRef to
$cinst.$objs.wDataHomeTabbedPane.$objs.StaffPgPane.$objs.wStaffHoursSub.$ref
    Do
$cinst.$objs.wDataHomeTabbedPane.$objs.StaffTab.$SetCurrentStripTab(1)
  End If

  Quit method

In the subWindow, I create/use the following class methods..
$msPersonalOK
  Do method $event

$msPersonalCancel
  Do method $event

$event
  On evOK
    Do method UpdateTotal
    Do method FinalChks Returns lvRtnFlag
       ;;the final Checks method has alternate code, depending upon the
action, i.e. Find client, Find Date on calendar, etc
    If lvRtnFlag=kFalse
        Quit event handler (Discard event)
    End If
    Do $cinst.$ivars.ivEnterDataTrigger.$assign(1)

  On evCancel
    Do $cinst.$ivars.ivEnterDataTrigger.$assign(2)

Hope this example helps.
terry
________________________________
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> on behalf of
Brian O'Sullivan <brian.os at verizon.net>
Sent: Tuesday, July 11, 2017 12:32 PM
To: omnisdev-en at lists.omnis-dev.com
Subject: Re: Subwindows - $event

Alternately in the parent window's $test method you should be able to use


Do redirect iSubWinRef


Brian O'Sullivan
brian.os at verizon.net




-----Original Message-----
From: Mayada Al-Kishtini <malkishtini at gmail.com>
To: 'OmnisDev List - English' <omnisdev-en at lists.omnis-dev.com>
Sent: Tue, Jul 11, 2017 10:49 am
Subject: RE: Subwindows - $event

Hi Michael,

Try to set a reference to the subwindow
Set reference iSubWinRef to $cinst.objs.pagepaneobj.$objs.mysubwindowobjname

Then try iSubWinRef.$test

See if that will work with you.

HTH,
Mayada

-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf
Of Michael Mantkowski
Sent: Tuesday, July 11, 2017 10:33 AM
To: 'OmnisDev List - English'
Subject: Subwindows - $event

I am getting my brain into an endless loop here.  I have never tried to use
a Subwindow in the way I am right now and maybe it's just is wrong...

Assume you have a Normal Window that operates just fine with its own $event
and $control methods.  The $event picks up on evOk or evCancel to direct the
flow of data entry to add lines to an invoice.  Press ok and the contents of
the entry fields are added to the list.  Etc.

If I now use this window class as a subwindow the evOk and evCancel are
picked up by the parent window.  What is the best method to pass this back
to the original window methods $event that are now encased in the subwindow?
Or is there no way to that since the SubWindow field itself can have a
$event?

The objects within the subwindow are able to call the original windows
methods but I cannot seem to find a way to reference them from the parent
window.

    Do $cinst.$objs.$SubWindow.$test    ;gives me an error

However, clicking a button in the subwindow that does

    Do method $test  ; works fine

I feel like I am missing something simple.

*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************



_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com


_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com If you received
this e-mail in error, please notify the sender, delete the e-mail, and do
not use, disclose or store the information it contains. This e-mail and any
attachments may contain confidential information, including records
protected by WI Mental Health 51.30 and/or AODA federal confidentiality
rules (42 CFR Part 2) - both prohibit you from making any further disclosure
of this information unless further disclosure is expressly permitted by the
written consent of the person to whom it pertains or as otherwise permitted
by 51.30 or 42 CFR Part 2. A general authorization for the release of
medical or other information is NOT sufficient for this purpose. Federal
rules restrict any use of this information to criminally investigate or
prosecute any alcohol or drug abuse client.
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com





More information about the omnisdev-en mailing list