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

Username:   Password: 
 RegisterRegister   
 [SOURCE] GUI Keypad for number entry into a program
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
the_short1




PostPosted: Sat Mar 27, 2004 12:53 am   Post subject: [SOURCE] GUI Keypad for number entry into a program

here it is... a key pad so users can enter a number using GUI's.. not very complicated but is good for beginers..
also if you add a couple more buttons it becomes a calculator...

you can store the string number into an interger variable using

var anumber : int
anumber := strint (nums)

i have it just to display that amount using strint

Please post any comments, they are really apreciated.... also if you need help and want to add some more buttons to it.. i can help ya, or just post to tell me waht ur going to be making... !!!



keypad.t
 Description:

Download
 Filename:  keypad.t
 Filesize:  1.92 KB
 Downloaded:  284 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Mar 28, 2004 11:19 am   Post subject: (No subject)

Hehe...not bad.

But not quite up to your standard either.

Change those GUI.CreateButton's to GUI.CreateButtonFull's and add some keyboard shortcuts to it.

I mean, we all know that onscreen keypads look nice, but there's no way anyone is going to click out a large number. Plus, having both keyboard/mouse options makes it more versitle.
the_short1




PostPosted: Sun Mar 28, 2004 11:32 am   Post subject: (No subject)

i said it was simplke for beginers... but having the button key shortcuts would kick.... ill get on it later... thx delos..

i just made this cuz i was bored and its cooler then having to imput by hand... and i will be using it later for a program of mine...
guruguru




PostPosted: Mon Mar 29, 2004 2:56 pm   Post subject: (No subject)

It looks as if you could compress the whole program into a couples less lines... as in, make all the buttons into an array; somehow make one procedure that tests if any button has been pressed...

BTW: A get this error and I'm wondering how to fix it (relates to making the buttons into an array.

If I did...
code:

var buttons : array 1 .. * of int := init (GUI.CreateButton (5, 5, 71, "0", btn0))

The error appears:
Quote:

Compile time expression expected

Why does that happen and how do i fix it???
the_short1




PostPosted: Mon Mar 29, 2004 3:44 pm   Post subject: (No subject)

did u make a proc called btn0...
.
.also... the big size down would be on all the procs....
.
but ya see i asked the master module maker delos to help me make it so u can just import it into ur program very easily.... so its being updated while we speak... using import vitKeyboard then to make the keyboard apear u just have to call
vitKeyboard.main,.....

folr that error.... hmmm.... what is the start in the array declaration....

make it an acuall number and try it again.... and if taht dont help... remove the init... i dont think u acually need it...
guruguru




PostPosted: Mon Mar 29, 2004 4:08 pm   Post subject: (No subject)

The reason I used a '*' is so that I can have a different number of buttons without having to change it every time I change the number of buttons. When I do use '*', you have to initialize all the values or it yells at you Shocked . So ya, you gotta use init... Thx neways.

Anybody know why that happens (maybe I should make a new thread... Confused )
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  [ 6 Posts ]
Jump to:   


Style:  
Search: