Computer Science Canada

Custom GUI

Author:  JSBN [ Thu Jun 19, 2003 11:31 am ]
Post subject:  Custom GUI

Yes, I Do realize that there is a tutorial, but it didn't tackle my problem. OK Here it is:
I have TextFeilds. And i want their background color(usually white) to be blue. I have tried many different things and edited TEXTFLD.tu many times, and i found that there was no result in my actions. At one point i even tried deleting the file, yet the bloody text feilds still drew themselves in white. If some1 could shed some light on me delemma, i would appreciate it.

thx, JSBN

Author:  Tony [ Thu Jun 19, 2003 12:58 pm ]
Post subject: 

you were looking in the wrong file Laughing

go to TextFieldClass.tu, scroll down to
code:

    procedure DrawText
        if colourbg = black and backgroundColour not= colourbg then
            Draw.FillBox (x1, y1, x2, y2, blue)%brightwhite)
        else
            Draw.FillBox (x1, y1, x2, y2, blue)% colourbg)
        end if
        View.ClipSet (x1, y1, x2, y2)
        Font.Draw (text, x1 - xOffset, y1 + fontDescent, textFontID,
            foregroundColour)
        View.ClipOff
    end DrawText


Thouse are the Draw.FillBox commands that draw your box... Oh, also if you change the value of foregroundColor you'll be able to have font of a different color to display nicely on blue (black on blue sucks).

Enjoy

Author:  JSBN [ Thu Jun 19, 2003 1:04 pm ]
Post subject: 

Works perfectly! THX alot tony

Author:  Asok [ Thu Jun 19, 2003 3:36 pm ]
Post subject: 

JSBN, it doesn't work in the version you sent me today.

editing those externals will only work on your machine. (it'll work in an exe because it packs the externals in it) if it's working on your box, make it an exe and send it to me.

Author:  JSBN [ Thu Jun 19, 2003 4:31 pm ]
Post subject: 

Yea, i'll send u my edited file. U gotta wait tho, i am in a cyber cafe right now :/


: