Page 1 of 1 1
Topic Options
#27000 - 2002-08-13 03:11 PM Radio buttons
Anonymous
Unregistered


Does anyone know if Kixtart supports radio buttons?

Thanks,

Brad

Top
#27001 - 2002-08-13 03:30 PM Re: Radio buttons
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
KiX does not have native suppoert for radio buttons. You can however use COM.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#27002 - 2002-08-13 05:02 PM Re: Radio buttons
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hey Brad, hows it going buddy ? You really got to visit here more often, my old friend and mentor !

Here's an idea for a UDF that me and Jan (Schuliebug) were kinda kicking around, its called OptionBox and displays a Dialog box containing option settings. You call it by passing a prompt and an array of strings representing the options, to use this in an admin script, you would first have to download and register Kixforms from here:

Kixforms

you just copy it to system32 then register it like any other ActiveX control ...

regsvr32 kixforms.dll

anways, heres the code:

code:
break on

$options = "Red","Yellow","Blue","Green","Orange","Black"

$prompt = "Please select a color from the list below:"

$choice = optionbox($prompt,$options)

?"choice = " $choice

exit 1

Function OptionBox($prompt,$options)

dim $form,$label,$ok,$cancel
dim $i,$top
dim $radio[ubound($options)]
dim $option

$form = createobject("kixtart.form")
$form.scalewidth = 400
$form.scaleheight = 100
$form.fontsize = 12
$form.tag = 0

$label = $form.label($prompt)
$label.top = 20
$label.left = 20
$label.width = $form.scalewidth-$label.left-20
$label.height = 30

$i = 0
$top = $label.bottom + 10
for each $option in $options
$radio[$i] = $form.optionbutton($option)
$radio[$i].left = $label.left + 20
$radio[$i].top = $top
$radio[$i].onclick = "$$option=$i"
$top = $top + 30
$i=$i+1
next

$ok = $form.commandbutton("OK")
$ok.left = 110
$ok.top = $top+30
$ok.width = 80
$ok.height = 25
$ok.onclick = "$$form.tag=1"

$cancel = $form.commandbutton("Cancel")
$cancel.left = $ok.right + 20
$cancel.top = $top+30
$cancel.width = 80
$cancel.height = 25
$cancel.onclick = "$$form.tag=2"

$form.height = $ok.bottom + 40

$form.center
$form.show
while $form.visible and $form.tag = "0"
$=execute($form.doevents)
loop

if $form.tag = "1"
$optionbox = $option
else
$optionbox = -1
endif

$form = 0

endfunction

-Shawn

Top
#27003 - 2002-08-13 05:07 PM Re: Radio buttons
Anonymous
Unregistered


Thanks Shawn, I'll give it a try. A need some users to make a choice out of three and it would be nice to be able to do this in one message window rather than three successive ones. I do visit occasionally, but have been spending a lot of my time recently on Unix (not much use for kix there [Smile] )

Thanks again!

Top
#27004 - 2002-08-13 05:50 PM Re: Radio buttons
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Brad:

You will need to use either KiXForms or KiXGUI if you need any kind of graphical user interface and/or buttons/listboxes/textboxes/...
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 957 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.056 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org