Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] GUI Calculator

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Sat Sep 13, 2008 7:33 pm    Post subject: [C++] GUI Calculator Reply with quote

Well, I decided to make a simple calculator with a GUI using ResEdit. For now, all this calculator is meant to do is add. Would I use a dialog? Similar to this?

[

* Number 1 goes in first box
Number 2 goes into second box

Answers shown in popup.

_________________
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Sep 13, 2008 7:47 pm    Post subject: Reply with quote

or create an array of int and i

use GetDlgItemInt and increment i (for the array stored) and use 1 edit box and 9 buttons each with a number, and buttons for +, -, *, /, power, etc
and a button for clear

when clear is called, i = 0
when a modifier is called, the operation is performed and stored in the current array

so say array[0] = 5 and array[1] = 10 (i = 1)
array[i] = array[i-1] modifier array[i]

this way you can keep a running total of the calc until the clear is called.

and display array[i] in the edit box after modifying.

I guess you could even use 2 int array and just call GetDlgItemInt and you will have the last used number.

Just a little rant and is in no way the entire process. Just some brainstorming

_________________
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Sat Sep 13, 2008 7:53 pm    Post subject: Reply with quote

blankrider wrote:
or create an array of int and i

use GetDlgItemInt and increment i (for the array stored) and use 1 edit box and 9 buttons each with a number, and buttons for +, -, *, /, power, etc
and a button for clear

when clear is called, i = 0
when a modifier is called, the operation is performed and stored in the current array

so say array[0] = 5 and array[1] = 10 (i = 1)
array[i] = array[i-1] modifier array[i]

this way you can keep a running total of the calc until the clear is called.

and display array[i] in the edit box after modifying.

I guess you could even use 2 int array and just call GetDlgItemInt and you will have the last used number.

Just a little rant and is in no way the entire process. Just some brainstorming


Heh, thanks. But, I'm just going to keep it adding only for now. I'm not too experienced with win32/gui's so im going to stay simple till i get a bit of experience from this.


Anyways, Once I've made my desired GUI through ResEdit and added the newly made .rc and .h files to my project, what do I use for the actual source file? Make a window and hide it? or just <include> what is needed ?

_________________
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Sep 13, 2008 7:58 pm    Post subject: Reply with quote

uhm, why would you make a window and hide it if the window is going to be your gui? I don't get you. If you compile with the WIN32GUI switch then you won't get a cmd line.

and look up using dialogs as a window.

and for this, i would not use a dialog, but rather CreateWindow each of the windows(controls) in your project.

_________________
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Sat Sep 13, 2008 8:03 pm    Post subject: Reply with quote

Thanks for your effort blankrider, the lack of communication is due to my lack of knowledge on the topic (my apologies).

How exactly do you create the GUI through the window? What I had done was create the main GUI interface on a dialog

_________________
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Sep 13, 2008 8:07 pm    Post subject: Reply with quote

http://www.winprog.org/tutorial/




read them all and look at the source.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites