Radio Buttons
- Posted by msuclay at hotmail.com May 06, 2001
- 481 views
Hey guys, Thanks for the great forum. I have a problem that I have been working on and cannot find the answer. I would appreciate any and all help. Thanks. Below is a small program that I have written to try to solve the problem that I am having. If you take a look at the program you will see a series of 5 rows. Each row has 3 radio buttons and an edit box for a number. With this program I would like to be able to select 1 radio button per row. This program will only allow 1 radio button per page. If the user selects the left radio button I would like for it to multiply the value entered in the edit box time 1. If the user selects the middle radio button I would like for it to multiply the value entered in the edit box times 2. If the user selects the right radio button I would like for it to multiply the value entered in the edit box times 3. Then display the answer in the total box at the bottom. Thanks again, Clay ------------------------------------------ include win32lib.ew with trace without warning global constant panelwin = create( Window, "Load", 0, Default, Default, 230, 320, 0 ), abtitle9 = create( LText, "Value", panelwin, 86, 10, 50, 40, 0 ), x = create( EditText, "", panelwin, 85, 38, 50, 20, 0 ), y = create( EditText, "", panelwin, 85, 66, 50, 20, 0 ), z = create( EditText, "", panelwin, 85, 96, 50, 20, 0 ), xx = create( EditText, "", panelwin, 85, 126, 50, 20, 0 ), yy = create( EditText, "", panelwin, 85, 156, 50, 20, 0 ), title1 = create( LText, " 1", panelwin, 1, 5, 20, 30, 0 ), title2 = create( LText, " 2", panelwin, 26, 5, 20, 30, 0 ), title3 = create( LText, " 3", panelwin, 51, 5, 20, 30, 0 ), a = create( Radio, "", panelwin, 5, 40, 15, 10, 0 ), b = create( Radio, "", panelwin, 30, 40, 15, 10, 0 ), c = create( Radio, "1", panelwin, 55, 40, 23, 10, 0 ), d = create( Radio, "", panelwin, 5, 68, 15, 10, 0 ), e = create( Radio, "", panelwin, 30, 68, 15, 10, 0 ), f = create( Radio, "2", panelwin, 55, 68, 23, 10, 0 ), g = create( Radio, "", panelwin, 5, 98, 15, 10, 0 ), h = create( Radio, "", panelwin, 30, 98, 15, 10, 0 ), i = create( Radio, "3", panelwin, 55, 98, 23, 10, 0 ), j = create( Radio, "", panelwin, 5, 128, 15, 10, 0 ), k = create( Radio, "", panelwin, 30, 128, 15, 10, 0 ), l = create( Radio, "4", panelwin, 55, 128, 23, 10, 0 ), m = create( Radio, "", panelwin, 5, 158, 15, 10, 0 ), n = create( Radio, "", panelwin, 30, 158, 15, 10, 0 ), o = create( Radio, "5", panelwin, 55, 158, 23, 10, 0 ), total = create( LText, "Total", panelwin, 1, 185, 100, 30, 0 ), output = create( EditText, "", panelwin, 85, 185, 50, 20, 0 ), line1 = create( LText, "----------------------------------------", panelwin, 0, 175, 300, 10, 0 ), line2 = create( LText, "----------------------------", panelwin, 100, 175, 300, 10, 0 ), cal = create( PushButton, "Calculate", panelwin, 10, 230, 60, 30, 0 ) procedure onClick_cal() atom one, two, three, four, five, totall one = getNumber( x ) two = getNumber( y ) three = getNumber( z ) four = getNumber( xx ) five = getNumber( yy ) totall = (one+two+three+four+five) setText( output, sprintf("%8.2f",totall)) end procedure onClick[ cal ] = routine_id("onClick_cal") WinMain( panelwin, Normal )