20 December 2018, 20:40 | #1 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Query about custom dialogs in WB
What I mean by dialogs is the little windows that pop up with a question, offering options via buttons. Is that available via a Shell script in WB3.1 (ClassicWB) or does it require extra software?
And if it is available, then how do I program them via a Shell script? |
20 December 2018, 21:03 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
You can use
requestchoice title text choice1 choice2 ... |
20 December 2018, 23:26 | #3 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
|
20 December 2018, 23:35 | #4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,987
|
Code:
set result `requestchoice title text choice1 choice2 choice3` if "$result" eq "1" echo "choice 1" endif if "$result" eq "2" echo "choice 2" endif if "$result" eq "0" echo "choice 3" endif |
21 December 2018, 01:33 | #5 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
That's pretty cool
Thank you thomas for posting a sample script; I too was wondering how you could relate requester selections to different commands I did notice from running "requestchoice title text choice1 choice2" in shell that clicking the first option returned "1" while clicking the last option returned "0"; but had no idea how to use this... |
21 December 2018, 08:33 | #6 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,987
|
The rightmost button is usually Cancel, so it returns 0. The other buttons are numbered from from left to right starting with 1.
So if you have a traditional Ok/Cancel requester, Ok gives 1 (TRUE) and Cancel gives 0 (FALSE). |
21 December 2018, 11:02 | #7 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Thanks, people.
I've got a script that works with a simple Yes/No question, although I wonder if I can insert the keyboard shortcuts under the Y and N. The official AmigaDOS reference seems to say that all I have to do is prefix the Yes and No with an underscore each, but it didn't work when I tried it. |
21 December 2018, 11:40 | #8 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
Yeah, that's what it says here: RequestChoice but didn't work for me either...
|
21 December 2018, 11:48 | #9 | |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Quote:
|
|
21 December 2018, 11:50 | #10 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
Thing is that request window looks very different to how it does in OS 3.1; so it's probably a feature in a later AmigaOS.
|
21 December 2018, 12:43 | #11 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
|
21 December 2018, 16:25 | #12 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
The shortcuts you are looking for, are left-amiga v and b.
|
21 December 2018, 16:37 | #13 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Here it works under OS 3.1 (requestchoice 39.4). Edit: Seems ReqTools is responsible for this feature.
Last edited by daxb; 21 December 2018 at 22:28. |
21 December 2018, 16:50 | #14 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
You're missing the point kolla.
In the above example you would expect:
|
21 December 2018, 16:54 | #15 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Well, you cannot have that consistently on OS3, while lamiga+v/b works regardless of language settings etc.
|
21 December 2018, 17:04 | #16 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
So how does that work if you have more than 2 buttons?
...I get it's not usual, but interested to here. |
21 December 2018, 17:45 | #17 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
|
21 December 2018, 18:13 | #18 | |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
Quote:
|
|
21 December 2018, 18:14 | #19 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
I have tested the script and it works the same way on OS AMiGA obsolete too, tested on OS 2.1, 3.1 and 3.9. Certainly the aesthetics of the GUI changes but this may depend on several factors. On OS 2.1 the command "RequestChoice" it is not present in the system but can be taken from subsequent operating systems
Last edited by AMIGASYSTEM; 13 January 2019 at 19:09. |
21 December 2018, 18:22 | #20 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
Yes, as I said this feature only works in OS4, in these previous versions (2.1, 3.1, and 3.9) you just get an extra underscore character as seen on your screenshots, and it doesn't work as a keyboard shortcut. So, an OS4 only feature. Except that last shot might look like working one, but it has some 3rd party replacement for requesters, standard Workbench installations don't support this on 68k systems.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WinUAE file dialogs and more | Leandro Jardim | support.WinUAE | 4 | 24 May 2016 19:10 |
Shadow of the Beast II dialogs | s2325 | request.Other | 0 | 25 July 2011 00:57 |
B.A.T. 2 query | gizmomelb | HOL data problems | 3 | 31 August 2006 08:55 |
Windowed/Full Screen Display Dialogs | Quickbeam | support.WinUAE | 3 | 09 July 2002 11:58 |
Query..... | Dr Xavier | request.Apps | 3 | 20 December 2001 15:22 |
|
|