English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 20 December 2018, 20:40   #1
Foebane
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?
Foebane is offline  
Old 20 December 2018, 21:03   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
You can use
requestchoice title text choice1 choice2 ...
Leffmann is offline  
Old 20 December 2018, 23:26   #3
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Quote:
Originally Posted by Leffmann View Post
You can use
requestchoice title text choice1 choice2 ...
Cool, but I'm wondering how I could use the input value to point to different commands.
Foebane is offline  
Old 20 December 2018, 23:35   #4
thomas
Registered User
 
thomas's Avatar
 
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
Note: the signs around the requestchoice commands are back ticks (grave accents), not single quotes.
thomas is offline  
Old 21 December 2018, 01:33   #5
DamienD
Banned
 
DamienD's Avatar
 
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...
DamienD is offline  
Old 21 December 2018, 08:33   #6
thomas
Registered User
 
thomas's Avatar
 
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).
thomas is offline  
Old 21 December 2018, 11:02   #7
Foebane
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.
Foebane is offline  
Old 21 December 2018, 11:40   #8
DamienD
Banned
 
DamienD's Avatar
 
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...
DamienD is offline  
Old 21 December 2018, 11:48   #9
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Quote:
Originally Posted by DamienD View Post
Yeah, that's what it says here: RequestChoice but didn't work for me either...
Yep, that's what I usually look at concerning AmigaDOS.
Foebane is offline  
Old 21 December 2018, 11:50   #10
DamienD
Banned
 
DamienD's Avatar
 
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.
DamienD is offline  
Old 21 December 2018, 12:43   #11
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Quote:
Originally Posted by DamienD View Post
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.
Agreed.
Foebane is offline  
Old 21 December 2018, 16:25   #12
kolla
Banned
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
The shortcuts you are looking for, are left-amiga v and b.
kolla is offline  
Old 21 December 2018, 16:37   #13
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Quote:
Originally Posted by Foebane View Post
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.
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.
daxb is offline  
Old 21 December 2018, 16:50   #14
DamienD
Banned
 
DamienD's Avatar
 
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:
  • pressing the letter "O" selects the "OK" button.
  • pressing the letter "M" selects the "Maybe" button.
  • pressing the letter "C" selects the "Cancel" button.
DamienD is offline  
Old 21 December 2018, 16:54   #15
kolla
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.
kolla is offline  
Old 21 December 2018, 17:04   #16
DamienD
Banned
 
DamienD's Avatar
 
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.
DamienD is offline  
Old 21 December 2018, 17:45   #17
kolla
Banned
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
Quote:
Originally Posted by DamienD View Post
So how does that work if you have more than 2 buttons?
It doesn't, AmigaOS is littered with shortcomings.
kolla is offline  
Old 21 December 2018, 18:13   #18
jPV
Registered User
 
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 1,006
Quote:
Originally Posted by DamienD View Post
Yeah, that's what it says here: RequestChoice but didn't work for me either...
That site is for AmigaOS 4 and doesn't apply for AmigaOS 3.x. This feature isn't mentioned in OS3.9 manual for instance.
jPV is offline  
Old 21 December 2018, 18:14   #19
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
Quote:
Originally Posted by jPV View Post
That site is for AmigaOS 4 and doesn't apply for AmigaOS 3.x. This feature isn't mentioned in OS3.9 manual for instance.
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.
AMIGASYSTEM is offline  
Old 21 December 2018, 18:22   #20
jPV
Registered User
 
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 1,006
Quote:
Originally Posted by AMIGASYSTEM View Post
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.
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.
jPV is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:15.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.44007 seconds with 13 queries