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

Reply via email to