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

Username:   Password: 
 RegisterRegister   
 Text Classes - Field and Box
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Expirant




PostPosted: Sat May 05, 2007 11:03 pm   Post subject: Text Classes - Field and Box

Hey all,
I've been working on these two classes for a little while, and thought I'd share them. I find myself getting very annoyed with Turing's GUI (for some reason, they cause all sorts of problems on my computer sometimes). So, I've decided to write my own two classes for the two GUI's that I use the most - A text box and a text field.

Now to use these two classes I'll admit it's a little more work than using Turing's GUI, but I personally enjoy the freedom of calling some of the individual procedures from the classes when I like, instead of just having your one line
'exit when GUI.ProcessEvent'

So, I've included the two classes, along with an example as to how to use them (I'm sure everyone would be lost if there was no example). I've tried to comment the example as best I could, but I unfortunately haven't had time to comment the actual classes. If someone thinks these might help them in any way and would like a little more in-depth explanation, let me know either PM or here and I'll comment the classes more heavily.

Currently the only bug I'm aware of (although not the biggest of bugs) is that the text box doesn't wrap lines. By that I mean if you type a string longer than the width of the text box, the string will not be cut in half and put on separate lines, it will write outside of the text box. I'm currently working on a way to fix this. For the text box you can currently decide what font you want to have as the default font (entering 0 will default it to ("ariel:10")), and I've already typed in quickly three fonts that you can change near the main part of the example, to get an idea of what other fonts look like in the box.

Keep in mind the two classes don't have to be used together. You can use just the text box to display stats about a character in a game, or just the text field to get input for a text game, but not display anything on screen (?) Who knows, it's up to you!

Anyways here is the download, if you read all of what I typed, thank you. If not, hope you enjoy the classes anyways.



Text Example - No Line Wrap.t
 Description:
This has both the text box and text field classes, as well as an example utilizing both in conjunction.

Download
 Filename:  Text Example - No Line Wrap.t
 Filesize:  13.97 KB
 Downloaded:  84 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sun May 06, 2007 12:26 am   Post subject: RE:Text Classes - Field and Box

Seems pretty good. You could definitely get some more functionality for them, though. Things like holding shift to select ranges, holding ctrl to move the cursor based on whitespace, instead of one character at a time, combinations of ctrl and shift, home and end, combinations of shift with home or end... Using the mouse, also, is a big one. Use it to click where the cursor should go, and to select regions of text.

I did a bunch of this sort of stuff about a year ago. You can find my efforts here. The text field was really good, if I do say so myself.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: