| View previous topic :: View next topic |
| Should I continue the tutorial? |
| Yes |
|
58% |
[ 10 ] |
| No |
|
41% |
[ 7 ] |
|
| Total Votes : 17 |
|
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Jun 09, 2007 3:34 pm Post subject: |
|
|
Mkay, I understood. I have a question, which might (probably will be) nooby, how do I make a GUI in C++? I was going to make something in delphi but my trial expired and I can't buy it because my parents won't let me.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Jun 09, 2007 3:37 pm Post subject: |
|
|
You create a Resource script. If you use VC++ you go to File->New...->Files-> Resource script. From there you can design the dialog, or you can open the file in notepad and modify it from there.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Jun 09, 2007 3:39 pm Post subject: |
|
|
Um, an example code to help me with that?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 09, 2007 3:43 pm Post subject: |
|
|
you do not need a resource script, rcs, dialogs and all their ilk will serve to confuse you instead of teaching you how GUIs (and ultimately Windows) works. To get a basic GUI going:
1. Register your own class or use a system class.
2. use CreateWindow(ex) to create a window(s and buttons and stuff)
3. Enter a message pumping loop
Many code examples are out there on the internet.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Jun 09, 2007 3:44 pm Post subject: |
|
|
I will look for one, but can you give me one in the mean time.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Jun 09, 2007 3:48 pm Post subject: |
|
|
| appalsap wrote: | you do not need a resource script, rcs, dialogs and all their ilk will serve to confuse you instead of teaching you how GUIs (and ultimately Windows) works. To get a basic GUI going:
1. Register your own class or use a system class.
2. use CreateWindow(ex) to create a window(s and buttons and stuff)
3. Enter a message pumping loop
Many code examples are out there on the internet. |
You can do that, but when I tried using CreateWindow, it wasn't easy to get a "atleast good looking" window. So resource files do there job and it's easy to create something nice. But I guess it's not so hard with that too. (I mainly use scripts because when I needed help, I went to codeproject.com and most of them were not using CreateWindow)
@oib111. Go take a look at the site I gave you
_________________
Last edited by UnLmtD on Sat Jun 09, 2007 3:51 pm; edited 1 time in total |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 09, 2007 3:51 pm Post subject: |
|
|
| zomgiownyou wrote: | | You can do that, but when I tried using CreateWindow, it wasn't easy to get a "atleast good looking" window. |
you're going to have to define "good looking"
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Jun 09, 2007 4:02 pm Post subject: |
|
|
What I mean is, when you create a window using CreateWindow, the window that's going to be created will have a with background, with nothing on it. (That's okay) But here is why I think using resources is better, when you want to create a button you will have to specify the height, width and all. I think it's a little bit to complicated. And with a resource file, it's fast to go, even though it will only work on Windows.
Just like that, I learned GUI basic using http://www.winprog.org/tutorial/
there the teach resource files and using CreateWindow, I thought resource files where more easy.
BUT if I learned from http://www.foosyerdoos.fsnet.co.uk/ I would of used CreateWindow all the time.
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Jun 09, 2007 4:04 pm Post subject: |
|
|
Well what do you want on it?! If you want more stuff on it, call CreateWindow again, this time creating buttons or edit controls or whatever else you want. You have to specify the height, width and all that stuff in resource files too, but you never notice since Visual Studio shields you from all of that!
|
|
| Back to top |
|
 |
DeltaFlyer Grandmaster Cheater
Reputation: 0
Joined: 22 Jul 2006 Posts: 666
|
Posted: Sat Jun 09, 2007 5:28 pm Post subject: |
|
|
Any good program starts out on paper. Just plan out your program on paper with all the size, location, functions and stuff.
_________________
Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for? |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Jun 10, 2007 2:26 pm Post subject: |
|
|
Ok, re-wrote the whole thing. Hopefully it is better now.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|