Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Creating a list
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Boiq




PostPosted: Thu Oct 30, 2008 7:15 am   Post subject: Creating a list

Hey guys. I've been working on a list that I have to create. How it works is that I check a box of the list topic that I would like to preview, then it opens up the list in a new window. The list's would be saved for example in a notepad file and would contain say, a list of birthday's in order from youngest to oldest. So far I have the box's to check off. They light up when you click with the left mouse button, and go back blank when you right click them to unselect your option. Here is the code that I got working so far, all I need for it to do now is open up a certain list when you actually check the box, right now when you check the box it does not do anything. The codes open seperately in two different windows. The one program open's the other, making it work properly. Here is the first code named "list":

setscreen ("graphics:640;480")
buttonchoose ("multibutton")
var button, x, y, sale : int
var font : int
font := Font.New ("Bradley Hand ITC:10:bold")
Font.Draw ("Text", 30, 460, font, 49)
Font.Draw ("Text", 30, 440, font, 39)
Font.Draw ("Text", 30, 420, font, black)
Font.Draw ("Text", 30, 400, font, 58)
Font.Draw ("Text", 30, 380, font, cyan)
Font.Draw ("Text", 30, 360, font, 13)
include "List-Lib.t"
drawbox (10, 460, 20, 470, gray)
drawbox (10, 440, 20, 450, gray)
drawbox (10, 420, 20, 430, gray)
drawbox (10, 400, 20, 410, gray)
drawbox (10, 380, 20, 390, gray)
drawbox (10, 360, 20, 370, gray)
loop
mousewhere (y,x,button)
mouse
end loop
open : sale, "OnHand", put
var houseType :
record
color : string (10)
location : string (20)
price : int
end record


And here is the second code to the next program named "list-ilb":

proc mouse
if button = 1 then
if x >= 10 and x <= 20 and y >= 460 and y <= 470 then
drawfill (15, 465, 49, gray)
end if
end if
if button = 100 then
if x >= 10 and x <= 20 and y >= 460 and y <= 470 then
drawfill (15, 465, white, gray)
end if
end if
if button = 1 then
if x >= 10 and x <= 20 and y >= 440 and y <= 450 then
drawfill (15, 445, 39, gray)
end if
end if
if button = 100 then
if x >= 10 and x <= 20 and y >= 440 and y <= 450 then
drawfill (15, 445, white, gray)
end if
end if
if button = 1 then
if x >= 10 and x <= 20 and y >= 420 and y <= 430 then
drawfill (15, 425, black, gray)
end if
end if
if button = 100 then
if x >= 10 and x <= 20 and y >= 420 and y <= 430 then
drawfill (15, 425, white, gray)
end if
end if
if button = 1 then
if x >= 10 and x <= 20 and y >= 400 and y <= 410 then
drawfill (15, 405, 58, gray)
end if
end if
if button = 100 then
if x >= 10 and x <= 20 and y >= 400 and y <= 410 then
drawfill (15, 405, white, gray)
end if
end if
if button = 1 then
if x >= 10 and x <= 20 and y >= 380 and y <= 390 then
drawfill (15, 385, cyan, gray)
end if
end if
if button = 100 then
if x >= 10 and x <= 20 and y >= 380 and y <= 390 then
drawfill (15, 385, white, gray)
end if
end if
if button = 1 then
if x >= 10 and x <= 20 and y >= 360 and y <= 370 then
drawfill (15, 365, 13, gray)
end if
end if
if button = 100 then
if x >= 10 and x <= 20 and y >= 360 and y <= 370 then
drawfill (15, 365, white, gray)
end if
end if

end mouse


Now once both of these are saved and you run the program "list" the whole program should open up without any errors. Sorry it is not organized to well, seems like a lot of work to view my program that I got so far, but it would be really appreciated if you could to see where I am at and what needs to be done.

Anyhelp would greatly be appreciated. Again, when I check one of the boxes, it must be programmed to open a list in a new window type of deal, thanks!
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: