[sourse] Simple Calculator, with mouse and graphics
Author |
Message |
Paul

|
Posted: Tue Feb 03, 2004 7:01 pm Post subject: [sourse] Simple Calculator, with mouse and graphics |
|
|
Here's the calculator I made today, believe it or not, it is pretty hard for someone like me, it still has lots of bugs in it I believe, and you cannot erase something once you entered it. You have to clear it with C after ever calculation, and it CAN do continuous calculations, but its probably with lots of bugs, like it cannot do BEDMAS. I did use this to practice my procedures and trying to shorten the main program like everyone is saying. I also drew everything, using turing, without bmps and stuff like that. I'll add on it once I can figure out what this mess is myself . Here it is.
Edit I fixed the input slower, with delay after click proc.
Description: |
|
 Download |
Filename: |
calculator.t |
Filesize: |
6.28 KB |
Downloaded: |
535 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Catalyst

|
Posted: Tue Feb 03, 2004 7:04 pm Post subject: (No subject) |
|
|
good work
a tip tho, slow down the input, in clicked once and the number appearead 3 times also it numbers can leave the little window
|
|
|
|
|
 |
Paul

|
Posted: Tue Feb 03, 2004 7:07 pm Post subject: (No subject) |
|
|
Ok, sure, it might be because my computer is slow, so the input seemed fine to me, I'll fix that right away, thanx. BTW, I hope this is not considered as spamming.
|
|
|
|
|
 |
Cervantes

|
Posted: Tue Feb 03, 2004 7:18 pm Post subject: (No subject) |
|
|
yes slow down the delay... but you don't have to do that by slowing down the main delay of the loop.. you should actually have no delay in the loop. make it so that whenever you click a button it delays. thats the best way to do it.
|
|
|
|
|
 |
Paul

|
Posted: Tue Feb 03, 2004 7:21 pm Post subject: (No subject) |
|
|
So delaying whenever you click the button is the same as delaying after the procedure click right?
|
|
|
|
|
 |
Delta

|
Posted: Tue Feb 03, 2004 7:25 pm Post subject: (No subject) |
|
|
well in my opinion the best way would to do something like this
code: |
var down : boolean := false
var mX, mY, mB : int
loop
Mouse.Where (mX,mY,mB)
if mB = 1 and down = false then
down := true
elsif mB = 0 and down = true then
down := false
end if
end loop
|
this only lets stuff happen if the mouse was just clicked.... and only lets it do it again if the mouse has been released
|
|
|
|
|
 |
Cervantes

|
Posted: Tue Feb 03, 2004 7:35 pm Post subject: (No subject) |
|
|
no Paulbian, not after the procedure... during the procedure that has all the clicking stuff, inside the if statements, you put the delay.
Delta that looks good
|
|
|
|
|
 |
Paul

|
Posted: Tue Feb 03, 2004 7:38 pm Post subject: (No subject) |
|
|
Does it affect this program in particular all that much though? I don't understand... I tested it, and for its current purposes, it works fine. I'd probably have to use that for more complicated stuff, like really big games that involves mouse right? Oh, I hadn't learned how to make that kind of variables, like true and false and stuff, but it acts like a on off switch right?
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Cervantes

|
Posted: Tue Feb 03, 2004 8:28 pm Post subject: (No subject) |
|
|
boolean variables are really easy to use, they are like a light switch.
you should try to make your prmograms as good as they can possibly be with your knowledge.. you just got new knowledge, you should impliment it. its a good habit
|
|
|
|
|
 |
jonos

|
Posted: Tue Feb 03, 2004 8:44 pm Post subject: (No subject) |
|
|
thatsa really cool calculator man, t hen interface is very nice, but that's all i can say now cause:
|
|
|
|
|
 |
sport

|
Posted: Tue Feb 03, 2004 9:56 pm Post subject: (No subject) |
|
|
That's nice just slow down the main procedure. Great work.
|
|
|
|
|
 |
we64

|
Posted: Tue Feb 03, 2004 10:00 pm Post subject: (No subject) |
|
|
why every time I click on a number and it appears 3 times...
|
|
|
|
|
 |
jonos

|
Posted: Tue Feb 03, 2004 10:01 pm Post subject: (No subject) |
|
|
it's because the calculator was made on a computer slower than yours, and the procedure needs to be slowed down. ^^read up there a little
|
|
|
|
|
 |
shorthair

|
Posted: Tue Feb 03, 2004 10:05 pm Post subject: (No subject) |
|
|
Great Job , Same Prob with the Speed of the input but heck who am i to complain ,
[size=18]+BITS | STIB +[/size]
|
|
|
|
|
 |
jonos

|
Posted: Tue Feb 03, 2004 10:06 pm Post subject: (No subject) |
|
|
i htought you were giving bits to me for a second, though i must admit, the calculator is bit worthy
|
|
|
|
|
 |
|
|