Art,

Here's your example, edited so that it works the way you want, I think.

/*   */
parentDlg = .SimpleParentDlg~new
msgObj = parentDlg~Execute("SHOWTOP",IDI_DLG_OOREXX)

::requires 'ooDialog.cls'

::class "ExampleChildDlg" subclass userDialog

::Method init
  expose didCancel

  forward class (super) continue

  self~create(60, 70, 257, 123, "Example - I am the Child Dialog")
  self~createPushButton(IDOK, 142, 99, 50, 14, "DEFAULT", "OK")
  self~createPushButton(IDCANCEL, 197, 99, 50, 14, , "CANCEL")

  didCancel = .false

::method initDialog
  self~start(loopingTask)
  return

::method loopingTask unguarded
  expose didCancel

  do i=1 to 20
    Say "Child loop" i
    if didCancel then leave
    j = msSleep(1000)
    end

::method ok  unguarded
  expose didCancel

  didCancel = .true
  self~ok:super

::method cancel  unguarded
  expose didCancel

  didCancel = .true
  self~cancel:super


::class "SimpleParentDlg" subclass UserDialog

::method init
  forward class (super) continue

  self~create(30, 30, 257, 123, "Simple Parent Dialog", "CENTER")
  self~createPushButton(IDOK, 142, 99, 50, 14, "DEFAULT", "OK")
  self~createPushButton(IDCANCEL, 197, 99, 50, 14, , "CANCEL")

::method ok unguarded
  childDlg = .ExampleChildDlg~new

  reply .false

  self~newPushButton(IDOK)~disable
  self~newPushButton(IDCANCEL)~disable

  childDlg~popupAsChild(self, "SHOWTOP", IDI_DLG_OODIALOG)
  if childDlg~initcode = 0 then do
    do i=1 to 30
      Say "Parent loop" i
      j = msSleep(1000)
      if \ childDlg~isDialogActive then do
        say 'User canceled.  Abort'
        leave
      end

    end
  end

  self~ok:super

Personally, I like the ProgressDialog approach a little better.  But, your
approach in your example is doable.

--
Mark Miesfeld



On Thu, Aug 15, 2013 at 8:17 AM, Art Heimsoth <artst...@artheimsoth.com>wrote:

> > On Thu, Aug 15, 2013 at 7:39 AM, Staffan Tylen
> > <staffan.ty...@gmail.com> wrote:
> >
> >>>
> >>> I put the looping logic in B to look for the cancel signal in
> >>> the
> >>>
> > initDialog method, but that prevents the B dialog panel from being
> > displayed.  How do I get that checking logic to run AND the dialog
> > to be displayed?
> >>
> >>
> >> If you insert FORWARD CLASS(SUPER) CONTINUE as the first
> >> statement in initDialog,
> >
> >
> > Actually, the super class initDialog() is a nop.  Invoking the
> > super class initDialog() through forward does nothing and is not
> > needed.
> >
> >
> > Doesn't hurt, but really doesn't add anything.  ;-)
> >
>
> I have modified the example code in the reference manual under
> popupAsChild
> by moving where the child dialog is started and putting some Say
> statements to
> see the operation.  I attached that if someone can tell me what stupid
> thing I
> am doing or not doing :-)..
>
> --
>  Art Heimsoth - artst...@artheimsoth.com
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________
> Oorexx-users mailing list
> Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to