[RexxLA] Position ooDialog Window

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[RexxLA] Position ooDialog Window

RockFox

In an ooRexx program that generates email I wish to temporarily disable network connections so no email is sent until I re-enable the network.  I have not found a way to do this programmatically so I'm experimenting with this code:

 

      Call infoDialog "Control Panel will now open.  Right click on the network connection you wish to Disable.  Then click OK"

      Address 'CMD' "control.exe netconnections"

 

The problem is that the Control Panel window always opens on top of the infoDialog message and I want the infoDialog window to be visible at the same time as Control Panel.

 

How can I position the infoDialog window to the left of the Control Panel window which usually opens in the center of the screen?

 

/Fran



_______________________________________________
rexxla-members mailing list -- mailto:[hidden email]
http://rexxla.org/mailman/listinfo/rexxla-members
Reply | Threaded
Open this post in threaded view
|

Re: [RexxLA] Position ooDialog Window

sahananda
You could write your own infodialog and position it anywhere.  I knocked up this one which by default sits in the top left corner of the screen, but you could pass it optional x y coordinates and even size.

It doesn't centre the text or OK button properly for short text strings, but you could fix that SMOP

/* infodialog2.rex */
use arg text, x = 0, y = 0, cx = 60, cy = 60

dlg=.infodialog2~new(text,x,y,cx,cy)
dlg~execute('ShowTop')

RETURN

::requires "ooDialog.cls"

::class infodialog2 subclass userdialog

::method init
expose text
use arg text, x, y, cx, cy
  self~init:super 
  
  success=self~create(x, y, max(self~gettextsizedu(text)~width+30, cx, 60), cy, 'Information')

  if \success then do
    self~initCode=1
    return
  end

::method defineDialog
expose text

   self~createStaticText(100, 10, 10, self~sizeX-20, 10,'right',text)
   self~createPushButton(IDOK,(self~sizeX % 2) - 20 ,30,40,15,'DEFAULT','OK')



enjoy

Jon

On 25 May 2018 at 17:45, Fran Hensler <[hidden email]> wrote:

In an ooRexx program that generates email I wish to temporarily disable network connections so no email is sent until I re-enable the network.  I have not found a way to do this programmatically so I'm experimenting with this code:

 

      Call infoDialog "Control Panel will now open.  Right click on the network connection you wish to Disable.  Then click OK"

      Address 'CMD' "control.exe netconnections"

 

The problem is that the Control Panel window always opens on top of the infoDialog message and I want the infoDialog window to be visible at the same time as Control Panel.

 

How can I position the infoDialog window to the left of the Control Panel window which usually opens in the center of the screen?

 

/Fran



_______________________________________________
rexxla-members mailing list -- mailto:[hidden email]
http://rexxla.org/mailman/listinfo/rexxla-members



_______________________________________________
rexxla-members mailing list -- mailto:[hidden email]
http://rexxla.org/mailman/listinfo/rexxla-members
Reply | Threaded
Open this post in threaded view
|

Re: [RexxLA] Position ooDialog Window

RockFox

Good morning Jon –

 

I’m sorry for the long delay in thanking you for this solution.  I had to study this to figure out how it works.

 

/Fran

 

From: [hidden email] <[hidden email]> On Behalf Of Jon Wolfers
Sent: Friday, May 25, 2018 2:22 PM
To: RexxLA Members mailing list <[hidden email]>
Subject: Re: [RexxLA] Position ooDialog Window

 

You could write your own infodialog and position it anywhere.  I knocked up this one which by default sits in the top left corner of the screen, but you could pass it optional x y coordinates and even size.

 

It doesn't centre the text or OK button properly for short text strings, but you could fix that SMOP

 

/* infodialog2.rex */

use arg text, x = 0, y = 0, cx = 60, cy = 60

 

dlg=.infodialog2~new(text,x,y,cx,cy)

dlg~execute('ShowTop')

 

RETURN

 

::requires "ooDialog.cls"

 

::class infodialog2 subclass userdialog

 

::method init

expose text

use arg text, x, y, cx, cy

  self~init:super 

  

  success=self~create(x, y, max(self~gettextsizedu(text)~width+30, cx, 60), cy, 'Information')

 

  if \success then do

    self~initCode=1

    return

  end

 

::method defineDialog

expose text

 

   self~createStaticText(100, 10, 10, self~sizeX-20, 10,'right',text)

   self~createPushButton(IDOK,(self~sizeX % 2) - 20 ,30,40,15,'DEFAULT','OK')

 

 

 

enjoy

 

Jon

 

On 25 May 2018 at 17:45, Fran Hensler <[hidden email]> wrote:

In an ooRexx program that generates email I wish to temporarily disable network connections so no email is sent until I re-enable the network.  I have not found a way to do this programmatically so I'm experimenting with this code:

 

      Call infoDialog "Control Panel will now open.  Right click on the network connection you wish to Disable.  Then click OK"

      Address 'CMD' "control.exe netconnections"

 

The problem is that the Control Panel window always opens on top of the infoDialog message and I want the infoDialog window to be visible at the same time as Control Panel.

 

How can I position the infoDialog window to the left of the Control Panel window which usually opens in the center of the screen?

 

/Fran

 


_______________________________________________
rexxla-members mailing list -- mailto:[hidden email]
http://rexxla.org/mailman/listinfo/rexxla-members

 


_______________________________________________
rexxla-members mailing list -- mailto:[hidden email]
http://rexxla.org/mailman/listinfo/rexxla-members