Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
12 user(s) are online (11 user(s) are browsing Forum)

Members: 0
Guests: 12

more...


Browsing this Thread:   1 Anonymous Users






Re: Need an example for radio button
#5
Just can't stay away
Just can't stay away


See User information
Ofcourse, Thanks.

Proper code line:

guiRadio := win.addRadioChoice('Age', ['Young', 'Old', NILA]:ARRAY_OF_CHAR).setState(1)

Posted on: 2011/6/8 18:54
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need an example for radio button
#4
Home away from home
Home away from home


See User information
@mrdarek
Have you tried "guiRadio.setState(1)"?

Posted on: 2011/6/7 21:30
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need an example for radio button
#3
Just can't stay away
Just can't stay away


See User information
Thanks
OK, Code is tested and start working in my program.
I have only one ask for future - how modify this code to on start first option was unchecked and second checked?

Posted on: 2011/6/7 18:18
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Need an example for radio button
#2
Home away from home
Home away from home


See User information
Here is what you wanted:
<pre>MODULE 'std/cGui'

PROC main()
DEF quit:BOOL
DEF win:PTR TO cGuiWindow, item:PTR TO cGuiItem
DEF guiRadio:PTR TO cGuiRadioChoice, guiOK:PTR TO cGuiButton
DEF choices:ARRAY OF ARRAY OF CHAR

CreateApp().build() ->equivalent to IsDesktopApp()

->create the GUI
win := CreateGuiWindow('example')
win.beginGroupVertical()
guiRadio := win.addRadioChoice('Age', ['Young', 'Old', NILA]:ARRAY_OF_CHAR)
guiOK := win.addButton('OK')
win.endGroup()
win.build()

->handle GUI events
quit := FALSE
REPEAT
item := WaitForChangedGuiItem()
SELECT item
CASE NIL
->(a non-item event occured) so check if user tried to close the window
IF win.getCloseRequest() THEN quit := TRUE

CASE guiOK
Print('You chose radio item number \d\n', guiRadio.getState())

choices := guiRadio.infoChoices()
Print('You chose radio item string "\s"\n', choices[guiRadio.getState()])
ENDSELECT
UNTIL quit

win.close()
FINALLY
PrintException()
ENDPROC</pre>

Posted on: 2011/6/5 19:11
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Need an example for radio button
#1
Just can't stay away
Just can't stay away


See User information
I need radio button and totally not understand how to do it. Can I ask for example with 2 radio buttons and 1 normal button OK and how read state this radio buttons (which was selected...) after pressing OK???

Posted on: 2011/6/5 17:10
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project