Computer Science Canada help with buttons |
Author: | recyclebin123 [ Sun May 08, 2005 11:38 am ] |
Post subject: | help with buttons |
can some1 plz help.....i cant get my buttons to workout rite...when u click stop on the second one it doesnt work and when u click next on the second one it does not move onto the third one |
Author: | jamonathin [ Sun May 08, 2005 1:17 pm ] | ||
Post subject: | |||
Here it is, just press and hold for a second to get to the next step. The programming isn't pretty (that's your job) I just fixed it for you, now just organize it. And for the record, process and proc's are very different. (one works)
|
Author: | recyclebin123 [ Sun May 08, 2005 2:32 pm ] |
Post subject: | |
wow..thanks a bunch =)......also i got another problem....when u click next on the last theme it ends...i need it to loop back to the first theme which i do not know how..also i just remembered that i needed a different music for each theme which i also do not know how to add in |
Author: | mercuryy [ Sun May 08, 2005 4:25 pm ] |
Post subject: | |
I am doing a program that has the similar structure. I want to put a menu in front of the first screensaver. and is there anyway that i can use the mouse to click back to the menu after I view all the screensaver? |
Author: | jamonathin [ Sun May 08, 2005 7:13 pm ] | ||
Post subject: | |||
This should answer all of your questions. This program can be easily edited, so make more slides and add them on. ![]()
|
Author: | recyclebin123 [ Sun May 08, 2005 8:22 pm ] |
Post subject: | |
WOW! thanks i owe u one...lol ![]() |
Author: | jamonathin [ Mon May 09, 2005 9:58 am ] | ||
Post subject: | |||
Try this out. I've never personally used Music for Background or anything, juss sfx so I've never had to worry about stopping it. I have no actaual music here to work with, but just try it out and play with it. The concept at least should be correct. ![]()
|
Author: | mercuryy [ Tue May 10, 2005 10:25 pm ] |
Post subject: | |
Humm. I treid to modify the program but it dosnt' work for some reason. Instead of a screen saver. I tried to put text (e.g. put"Menu") inside the procedure. But the program output an never-ending loop. Why? How should I change it to make the first screen a menu instead? |
Author: | jamonathin [ Wed May 11, 2005 5:45 am ] | ||
Post subject: | |||
Well, if you make a new procedure, you're going to have to change some of the coding. For example, if you want this one (your menu) to be the first item, then you need to put it on selection:=1 and bump everything back one and make an if for screensaver_3 under selection = 4.
Now you have to change maxslide to 4, which will make things easier because now you don't need to edit the back and next buttons. Try that out and see how it goes. ![]() |
Author: | WebHead [ Fri May 27, 2005 9:01 pm ] |
Post subject: | for buttons help |
i need to clear the screen of the old calculations when i click a new button. So when i click a button, i do what it says, then when i go to click another of the buttons, the put statements come up but the old calculations are still there and get over written. all i need is something to clear the old calculations but still have the 3 buttons on the screen. Thanx, have fun with it ![]() import GUI setscreen("graphics:600;250") %*********************************************Calculate Circle**************************************************** %procedures containing all the work you want that button to do procedure circle locate (1,1) colour (01) const Pi:=3.1415922653 %formula for pie var Radius:real %variable to find radius put "Area of a Circle" %title statement put "Type in your radius: " .. %intructional statement get Radius %User's Radius colour (12) put "The area of the circle with the given radius is: " ,Pi*Radius**2:1:3 ," sq.cm." %last statemenmt and formula to calculate end circle %*********************************************Calculate Rectangle**************************************************** procedure rectangle locate(1,1) colour (01) var Length:int var Width:int put "The Area of a Rectangle" put "Type in your length and width of rectangle (eg L W): " .. %statement to get length and width colour (12) get Length get Width %get user's information put "The area of your rectangle is: " ,(Length*2)+(Width*2):1:3 ," sq.cm." end rectangle %*********************************************Calculate Triangle**************************************************** procedure triangle locate(1,1) colour (01) var Base:int var Height:int %both needed to calculate the area of a trainge put "The Area of a Triangle" %title statement put "Type your base and height (eg 4 2): " .. %statement explaing to user what to typt get Base get Height %get commands the get information from user colour (12) put "The area of your triangle is: " ,0.5*Base*Height:1:3 ," sq cm." end triangle %button names as variables %create buttons var button1:int:=GUI.CreateButton(25,25,0,"Calculate Area of Circle",circle) var button2:int:=GUI.CreateButton(25,50,0,"Calculate Area of Rectangle",rectangle)%names of buttons var button3:int:=GUI.CreateButton(25,75,0,"Calcualte Area of Triangle",triangle) %*********************************************Main Loop**************************************************** loop exit when GUI.ProcessEvent end loop |