An AskDialog always comes up in the centre of the screen. When you hit “Yes” or
“No” on the AskDialog, the dialog ends and so disappears from the screen.
Now, your code has several AskDialogs appearing one after the other. And if you
move the first AsklDialog from the centre, then hit either Yes or No, then that
dialog ends and closes - i.e. disappears. BUT - your code immediately brings
up a *new* AskDialog, which appears, as did the first, In the centre of the
screen.
This sequence looks as if the original AskDialog has moved. But it hasn’t – it
just ended and the new one appeared.
Maybe you need to build a dialog that has some radio buttons in it, so you can
select all the options you need, and then press Enter (or whatever).
If it would help (let me know) I’ll see if I can build such a dialog for you as
an example. However, unfortunately I’m not able at this point to *promise* to
do so any time soon.
Atb,
Oliver
From: Bertram Moshier [mailto:bertrammosh...@gmail.com]
Sent: 27 February 2015 22:09
To: oorexx-users@lists.sourceforge.net
Subject: [Oorexx-users] (no subject)
Hello again Oliver,
> Sounds a bit weird - don?t know if I can help, but what kind of dialog is it
> ? i.e. what?s its superclass (e.g. UserDialog)?
Oh, weird?! Ah. Well, I'm learning to the ooDialog by using bits and pieces
of sample code. Thus maybe I'm incorrectly using a call or something. Here is
a snippet of the code.
Background: This Rexx program allows the user to set the Power Plan for the
system. Originally written only to support passed parameters (e.g. PowerPlan
High or PowerPlan GoodNight, I added Dialog in two places. One displays a list
of the power plans and allows the user to select one of them. The other
toggles between two plans (High Performance and a "Good Night" plan I created).
Code Snippet:
if GBL.parameter.0 = 2 & ,
((abbrev('DIALOG',upper(GBL.parameter.1),1) | ,
abbrev('DIALOG',upper(GBL.parameter.2),1)) & ,
(abbrev('TOGGLE',upper(GBL.parameter.1),1) | ,
abbrev('TOGGLE',upper(GBL.parameter.2),1))) then do
if PowerPlanName.DialogAnswer <> HighPerf & ,
PowerPlanName.DialogAnswer <> GoodNight then do
call !!Say_Directed 4,'w','Current "' || PowerPlanName.DialogAnswer || '"
is not valid for Dialog Toggle. Changing the current power plan to "' ||
HighPerf || '" and continuing.'
PowerCMD '-setactive' HighPerfGUID
DialogAnswer = HighPerfPCL
end
msg = 'Toggle Power Plan? Yes or No (Quit)' ||
.endOfLine~copies(2) || ,
'Current Power Plan is' PowerPlanName.DialogAnswer
do while AskDialog(msg, 'Y')
select
when PowerPlanName.DialogAnswer = HighPerf then do
PowerCMD '-setactive' GoodNightGUID
call !!Say_Directed 10,'i','Power plan changed to Good Night (' ||
GoodNightGUID || '). Reqest is: Dialog Toggle.'
PowerPlanName.DialogAnswer = GoodNight
end
when PowerPlanName.DialogAnswer = GoodNight then do
PowerCMD '-setactive' HighPerfGUID
call !!Say_Directed 10,'i','Power plan changed to High Performance ('
|| HighPerfGUID || '). Reqest is: Dialog Toggle.'
PowerPlanName.DialogAnswer = HighPerf
end
otherwise do
nop
end
end
msg = 'Toggle Power Plan? Yes or No (Quit)' ||
.endOfLine~copies(2) || ,
'Current Power Plan is' PowerPlanName.DialogAnswer
end
call !!Say_Directed 1201,'i','Dialog terminated. Current power plan is "' ||
PowerPlanName.DialogAnswer || '."'
call !!EOJ 0
end
else if GBL.parameter.0 = 2 then do
call !!Say_Directed 1200,'e','Invalid double parameter combination.
They must be Dialog and Toggle.'
call !!EOJ 1200
end
I chose the AskDialog call because all I need is a Yes or No (Yes, toggle; No,
end). Maybe I'm expecting too much from AskDialog to stay where put, as it is
a message. If so,
* What is a better call given the toggle idea and the existing code?
* What is a good way to learn how to use ooDialog?
* Also a good resource compiler?
Thank you, Oliver, for your two replies thus far. :-)
Bert.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users