KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Newbie help needed - Muiltple selection box

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
tonyh
KiXforms Novice
KiXforms Novice


Joined: 05 Nov 2003
Posts: 4

PostPosted: Wed Nov 05, 2003 3:51 pm    Post subject: Newbie help needed - Muiltple selection box Reply with quote

Hi
Im new to kixforms - I have been trying to create a simple multiply selection box where to display say 6 tick boxes (selections). I want the user to be able say to tick four/five options - then after pressing a ok button it runs the five or so options (which would run batch files depending on the tick boxes ticked one after the other).
I have been trying this for some time now and have got on where - can any1 help me or supply me a quick script for this as I am now banging my head.

Many thanks

Tonyh Smile
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Nov 05, 2003 4:22 pm    Post subject: Reply with quote

Hi Tony,

Welcome, here is a bit of a template for doing this ...

Code:

break on

$form = createobject("kixtart.form")
$form.size = 300,400

$groupbox = $form.groupbox()
$groupbox.size = 200,200
$groupbox.center

$checkbox1 = $groupbox.checkbox()
$checkbox1.center
$checkbox1.top = 20
$checkbox1.text = "Option One"

$checkbox2 = $groupbox.checkbox()
$checkbox2.center
$checkbox2.top = $checkbox1.bottom + 10
$checkbox2.text = "Option Two"

$checkbox3 = $groupbox.checkbox()
$checkbox3.center
$checkbox3.top = $checkbox2.bottom + 10
$checkbox3.text = "Option Three"

$checkbox4 = $groupbox.checkbox()
$checkbox4.center
$checkbox4.top = $checkbox3.bottom + 10
$checkbox4.text = "Option Four"

$button = $form.button()
$button.text = "Show on console"
$button.center
$button.top = $groupbox.bottom + 20
$button.onclick = "onbuttonclick()"

$form.show()
while $form.visible
 $=execute($form.doevents)
loop

exit 1

function onbuttonclick()

 ?"Selections are:"

 if $checkbox1.checked
  ?"Option One Checked"
 endif

 if $checkbox2.checked
  ?"Option Two Checked"
 endif

 if $checkbox3.checked
  ?"Option Three Checked"
 endif

 if $checkbox4.checked
  ?"Option Four Checked"
 endif

 ?
endfunction
Back to top
View user's profile Send private message
tonyh
KiXforms Novice
KiXforms Novice


Joined: 05 Nov 2003
Posts: 4

PostPosted: Wed Nov 05, 2003 4:27 pm    Post subject: Reply with quote

many thanks for the quick reply - i try running the script but get a error in line 7 - im running kixforms.dll 2.2.0 does that make a difference.

cheers

Tony
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Wed Nov 05, 2003 5:45 pm    Post subject: Reply with quote

It would help if you would post the exact error message.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Nov 05, 2003 6:11 pm    Post subject: Reply with quote

You probably have the version without the GroupBox control. Try changing GroupBox to Frame() instead. Plus, the Checked property is relatively new too. Use Value = 1 instead. Or upgrade to latest beta.

-Shawn
Back to top
View user's profile Send private message
tonyh
KiXforms Novice
KiXforms Novice


Joined: 05 Nov 2003
Posts: 4

PostPosted: Thu Nov 06, 2003 8:00 am    Post subject: Reply with quote

Shawn

youre a star Smile. i updated to the new beta version - woppee.

Cheers mate

Tony
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group