
-----------------------------------
Paul
Tue Feb 03, 2004 7:01 pm

[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 :oops: . Here it is.
Edit I fixed the input slower, with delay after click proc.

-----------------------------------
Catalyst
Tue Feb 03, 2004 7:04 pm


-----------------------------------
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
Tue Feb 03, 2004 7:07 pm


-----------------------------------
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.  :cry:

-----------------------------------
Cervantes
Tue Feb 03, 2004 7:18 pm


-----------------------------------
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
Tue Feb 03, 2004 7:21 pm


-----------------------------------
So delaying whenever you click the button is the same as delaying after the procedure click right?

-----------------------------------
Delta
Tue Feb 03, 2004 7:25 pm


-----------------------------------
well in my opinion the best way would to do something like this 


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
Tue Feb 03, 2004 7:35 pm


-----------------------------------
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
Tue Feb 03, 2004 7:38 pm


-----------------------------------
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?

-----------------------------------
Cervantes
Tue Feb 03, 2004 8:28 pm


-----------------------------------
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
Tue Feb 03, 2004 8:44 pm


-----------------------------------
thatsa really cool calculator man, t hen interface is very nice, but that's all i can say now cause:  :burn:

-----------------------------------
sport
Tue Feb 03, 2004 9:56 pm


-----------------------------------
That's nice just slow down the main procedure. Great work.

-----------------------------------
we64
Tue Feb 03, 2004 10:00 pm


-----------------------------------
why every time I click on a number and it appears 3 times...

-----------------------------------
jonos
Tue Feb 03, 2004 10:01 pm


-----------------------------------
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
Tue Feb 03, 2004 10:05 pm


-----------------------------------
Great Job , Same Prob with the Speed of the input but heck who am i to complain , 

+BITS | STIB +[/size]

-----------------------------------
jonos
Tue Feb 03, 2004 10:06 pm


-----------------------------------
i htought you were giving bits to me for a second, though i must admit, the calculator is bit worthy  :D
