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

Username:   Password: 
 RegisterRegister   
 Widgit ID problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
unknowngiver




PostPosted: Mon May 29, 2006 9:10 pm   Post subject: Widgit ID problem

Hey
I am getting a WIDGIT ID PROBLEM when i use hte command
code:

GUI.DISABLE[BUTTON]


it opens another file [GUI] and says:

code:

process "whatpage": Assert condition is false


and it puts this on the PROGRAM SCREEN too:
code:

Disable: Widgit ID number "449' not found


but when i remove the GUI.DISABLE button it works fine...

here is the code for what page:

code:

% -------------------------------------------
% Checks to see what page should be displayed
% -------------------------------------------
process whatpage
    if page_main = true then

        GameServer.main_content (serverAddress + "maincontent.txt")
    end if

    loop

        if page_reg = true then
            cls
            render.bg
            GameServer.reg (serverAddress + "register.php")
            page_reg := false
        end if

    end loop
end whatpage

and here is where i put the DISABLE thing:

code:

    procedure check_register
        % -------------------
        % Gets all the Input
        % -------------------
        new_user := GUI.GetText (name_field)
        new_pass := GUI.GetText (password_field)
        conf_pass := GUI.GetText (passwordconfirm_field)
        new_email := GUI.GetText (emailid_field)

        if length (new_user) not= 0 and length (new_email) not= 0 and length (conf_pass) not= 0 and length (new_pass) not= 0 then
            if new_pass = conf_pass then
                put "Registration is complete"
              GUI.Disable(x_register)
            else
                put "Passwords dont match"
            end if
        else
            put "Please fill all fields"
        end if
    end check_register


    procedure register_fields

        render.bg

        var registerButton := GUI.CreateButton (x_register - 50, 200, 200, "Register", check_register)
        name_field := GUI.CreateTextFieldFull (x_register, 400, 150, "",
            NameEntered, GUI.INDENT, 0, 0)

        emailid_field := GUI.CreateTextFieldFull (x_register, 370, 130, "",
            emailEntered, GUI.INDENT, 0, 0)

        password_field := GUI.CreateTextFieldFull (x_register, 340, 120, "",
            passwordEntered, GUI.INDENT, 0, 0)
        GUI.SetEchoChar (password_field, '*')

        passwordconfirm_field := GUI.CreateTextFieldFull (x_register, 310, 120, "",
            password2Entered, GUI.INDENT, 0, 0)
        GUI.SetEchoChar (passwordconfirm_field, '*')

        var nameLabel := GUI.CreateLabelFull (x_register - 50, 400, "User Name:", 0, 0,
            GUI.RIGHT, 0)
        var addressLabel := GUI.CreateLabelFull (x_register - 50, 370, "Email:", 0, 0,
            GUI.RIGHT, font_register)
        var passlabel := GUI.CreateLabelFull (x_register - 50, 340, "Password:", 0, 0,
            GUI.RIGHT, font_register)
        var pass2label := GUI.CreateLabelFull (x_register - 50, 310, " Confirm Password:", 0, 0,
            GUI.RIGHT, font_register)


        loop
            exit when GUI.ProcessEvent
        end loop



    end register_fields
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Mon May 29, 2006 9:14 pm   Post subject: (No subject)

what is x_register? is it a button or other GUI widget that you have declared? if not, there is nothing for the Disable proc to disable, hence the ID problem if youre not sure the syntax for GUI.Disable is as such
code:

GUI.Disable(widgetID)
unknowngiver




PostPosted: Mon May 29, 2006 9:19 pm   Post subject: (No subject)

code:
       var registerButton := GUI.CreateButton (x_register - 50, 200, 200, "Register", check_register)

how do i find the WIDGET ID for this? i thought "x_register" is what i have to put in/
Clayton




PostPosted: Mon May 29, 2006 9:24 pm   Post subject: (No subject)

the widget ID for that is the variable name (in your case registerButton), in other cases, if you need to disable a widget depending on what was used you can use GUI.GetEventWidgetID to determine what widget was used Razz
unknowngiver




PostPosted: Mon May 29, 2006 9:32 pm   Post subject: (No subject)

hm
well i m kinda stuck here then

if i put hte proces check :
code:

    procedure check_register
        % -------------------
        % Gets all the Input
        % -------------------
        new_user := GUI.GetText (name_field)
        new_pass := GUI.GetText (password_field)
        conf_pass := GUI.GetText (passwordconfirm_field)
        new_email := GUI.GetText (emailid_field)

        if length (new_user) not= 0 and length (new_email) not= 0 and length (conf_pass) not= 0 and length (new_pass) not= 0 then
            if new_pass = conf_pass then
                put "Registration is complete"
                GUI.Disable (registerButton)
            else
                put "Passwords dont match"
            end if
        else
            put "Please fill all fields"
        end if
    end check_register


before the procedure where it draws it all...then it says registerButton has not been decleared before...if i put it AFTER the procedure that draws the form..then it says that the "check_registeR" has not been declared Sad
Clayton




PostPosted: Mon May 29, 2006 9:34 pm   Post subject: (No subject)

what exactly is it that you are trying to disable, if it is the register button then you cant disable it outside of the proc it was created in because registerButton is local to that proc, if it is one of the text fields you are trying to disable, put in the text fields respective identifier
unknowngiver




PostPosted: Mon May 29, 2006 9:45 pm   Post subject: (No subject)

hm well i m trying to disable the button after it checks 2 make sure that everything is correct
Clayton




PostPosted: Mon May 29, 2006 10:11 pm   Post subject: (No subject)

then make sure that you have your button created in the proc with your textfields
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Mon May 29, 2006 10:13 pm   Post subject: (No subject)

also you could create the button globally if you cant do it inside the proc
unknowngiver




PostPosted: Mon May 29, 2006 10:19 pm   Post subject: (No subject)

hm i still cant get it 2 work:(
i have to have the button in a process because the main program just inteprets the procedures...and i have to disable it AFTEr running the check procedure Sad
Clayton




PostPosted: Mon May 29, 2006 10:20 pm   Post subject: (No subject)

could you post or PM me the code so i could look it over plz?
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  [ 11 Posts ]
Jump to:   


Style:  
Search: