Computer Science Canada

Buttons...yet again

Author:  CReid [ Wed Jan 21, 2004 1:13 pm ]
Post subject:  Buttons...yet again

Please check this out.. I have one set of buttons (a login menu) and then when you get the user and pass it opens up a new windoe (the program) but the buttons wont work when it opens up the new window?PLEASE HELP!!!URGENT!!!
(There is a pic in there iHEALTH.bmp you can just get rid of it)

-Chris
code:
import GUI
var loginwin := Window.Open ("title:iHEALTH Login,position:top;center,graphics:225;200")
var FontID : int := Font.New ("Arial:13:italic,Bold,underline")
var FontID1 : int := Font.New ("Arial:11:italic")
var userTextField, passwordTextField : int
var user1 : string
var pass1 : string
forward procedure medhis
forward procedure journal
forward procedure med
forward procedure dcontact
forward procedure resources

%Login Menu
procedure UsernameEntered (text : string)
end UsernameEntered

procedure PasswordEntered (text : string)
end PasswordEntered

GUI.SetBackgroundColor (white)
var LoginButton := GUI.CreateButton (75, 25, 10, "Login", GUI.Quit)
GUI.SetColor (LoginButton, white)

userTextField := GUI.CreateTextFieldFull (100, 90, 100, "", UsernameEntered, GUI.INDENT, 0, 0)

passwordTextField := GUI.CreateTextFieldFull (100, 60, 100, "", PasswordEntered, GUI.INDENT, 0, 0)
GUI.SetEchoChar (passwordTextField, '*')

var nameLabel := GUI.CreateLabelFull (75, 90, "Username:", 0, 0, GUI.RIGHT, 0)

var addressLabel := GUI.CreateLabelFull (75, 60, "Password:", 0, 0, GUI.RIGHT, 0)

Pic.ScreenLoad ("C:/iHEALTH/iHEALTH.bmp", 0, 110, picCopy)
Font.Draw ("Please Login..", 60, 120, FontID1, black)
loop
    exit when GUI.ProcessEvent
end loop

colorback (white)
user1 := GUI.GetText (userTextField)
pass1 := GUI.GetText (passwordTextField)
if user1 = "Admin" and pass1 = "forefront"
        or user1 = "Peter" and pass1 = "Reid"
        or user1 = "Chris" and pass1 = "Reid"
        or user1 = "Guest" and pass1 = ""
        then
    GUI.Dispose (LoginButton)
    locate (11, 7)
    put "Welcome " + user1
    delay (1000)
else
    GUI.Dispose (LoginButton)
    locate (11, 7)
    put "Incorrect Login"
    delay (99999999)
end if

var winID := Window.Open ("title:iHEALTH,position:top;center,graphics:800;300")
Window.Hide (loginwin)
var medhisb := GUI.CreateButton (140, 240, 0, "Medical History", medhis)
GUI.SetColor (medhisb, white)
var journalb := GUI.CreateButton (260, 240, 0, "My Journal", journal)
GUI.SetColor (journalb, white)
var medb := GUI.CreateButton (360, 240, 0, "My Medications", med)
GUI.SetColor (medb, white)
var dcontactsb := GUI.CreateButton (480, 240, 0, "My Doctors", dcontact)
GUI.SetColor (dcontactsb, white)
var resourcesb := GUI.CreateButton (580, 240, 0, "Resources", resources)
GUI.SetColor (resourcesb, white)
loop
    exit when GUI.ProcessEvent
end loop

body procedure medhis
put "hey"
end medhis

body procedure journal
put "hey"
end journal

body procedure med
put "hey"
end med

body procedure dcontact
put "hey"
end dcontact

body procedure resources
put "hey"
end resources

Author:  shorthair [ Wed Jan 21, 2004 4:21 pm ]
Post subject: 

if your not using turing 5 WHICH you should be , then you need to read the tutorial about restetting h eprocess event , please people i cant stress this enough , look around before you ask a question , ive answerd this question mabye 4 times now , there are entire tutorials dedicated to this ,

If your using turing 5 you can use the command ** not sure what it is , but its in hte help file , i think its like GUI.ResetQuit

Author:  Boarder16 [ Wed Jan 21, 2004 4:43 pm ]
Post subject: 

hahah reid..its jones....waht did mr.k think cause ur buttosn went crap.. Laughing


: