MFC button control in MFC vissual C++

MFC button control in MFC vissual C++

Post by RonSou » Sun, 24 Jun 2001 11:04:16



I am writing an SDI in Visual C++.  I need to now how to use MFC
buttons to trigger functions like rotation, pan and zoom then use the
mouse to use these functions and I need a button to reset the scene to
original position.  I already have rotate and pan mapped to the left
and right mouse buttons, but I just want the left mouse button to
control every thing and have the functions switch through the MFC
buttons.

Thanks in advance for the help.

 
 
 

MFC button control in MFC vissual C++

Post by Christian Schlett » Tue, 26 Jun 2001 14:59:17


hi ron,

I can think of three ways to get the result you wish to implement.
they would look different at the surface, although the underlying
MFC procedures are actually the same.

1. dialog
even in SDI apps its possible to open further windows, and there
is a special sort of dialog, that doesnt have to be closed before the
main program can carry on - a modal dialog.

you can design such a dialog with the ressource editor, including all
the buttons you wish to have, e.g. "pan", "rotate" etc.
for each of those buttons you will have to set up an ID as well.
then, use the class wizard to get a new class for your dialog and
connect the buttons with the messaging system calling them via
their IDs. set up some bools too, to keep track of the current
button thats pressed.

as far as I can remember, the modality of a dialog isnt decided by
its baseclass, but the calling procedure.

now, you'll need a switch-statement in your message handlers for
your mouse - according to the button thats pressed - aka the "mouse
mode" thats chosen - you have to do different things.

2. menu entries
another way to do it, is to include some new menu entries in your menu
bar,
one for each "mouse mode" you wish to implement.

under the hood, its the same - IDs to name them and message handlers
to connect them to the message loop. menu entries can be "checked" -
use this feature to keep track of the current mode...

3. floating toolbars
yet another way to achieve what you want to do, is to fumble around with
floating toolbars. they are a mixture of the two possibilities of user
interaction
described above - toolbars are those buttons with images beneath the menu
bar.

you can set up toolbars with the ressource editor. then, you will have to
set some
flags to make them able to "float" - to allow the toolbar to move around
and/ or
being attached to the borders of you SDI mainframe window.

cheers,
christian

 
 
 

MFC button control in MFC vissual C++

Post by Ron Sou » Wed, 27 Jun 2001 06:19:30


On Mon, 25 Jun 2001 07:59:17 +0200, Christian Schlette

christian
thanks for the help, I am kinda looking for a code example.  I am
trying to code a GUI in openGL for my CFD code.  I am new to the whole
MFC thing.  Anyway I basically was doing what you suggested but for
some reason I cant get it to work.  Any more help would be great.

Thanks
Ron

PS check out the attachment, its a screen captue of my CFD front end
it will give you an idea of what I am trying to do.

Quote:>hi ron,

>I can think of three ways to get the result you wish to implement.
>they would look different at the surface, although the underlying
>MFC procedures are actually the same.

>1. dialog
>even in SDI apps its possible to open further windows, and there
>is a special sort of dialog, that doesnt have to be closed before the
>main program can carry on - a modal dialog.

>you can design such a dialog with the ressource editor, including all
>the buttons you wish to have, e.g. "pan", "rotate" etc.
>for each of those buttons you will have to set up an ID as well.
>then, use the class wizard to get a new class for your dialog and
>connect the buttons with the messaging system calling them via
>their IDs. set up some bools too, to keep track of the current
>button thats pressed.

>as far as I can remember, the modality of a dialog isnt decided by
>its baseclass, but the calling procedure.

>now, you'll need a switch-statement in your message handlers for
>your mouse - according to the button thats pressed - aka the "mouse
>mode" thats chosen - you have to do different things.

>2. menu entries
>another way to do it, is to include some new menu entries in your menu
>bar,
>one for each "mouse mode" you wish to implement.

>under the hood, its the same - IDs to name them and message handlers
>to connect them to the message loop. menu entries can be "checked" -
>use this feature to keep track of the current mode...

>3. floating toolbars
>yet another way to achieve what you want to do, is to fumble around with
>floating toolbars. they are a mixture of the two possibilities of user
>interaction
>described above - toolbars are those buttons with images beneath the menu
>bar.

>you can set up toolbars with the ressource editor. then, you will have to
>set some
>flags to make them able to "float" - to allow the toolbar to move around
>and/ or
>being attached to the borders of you SDI mainframe window.

>cheers,
>christian

 
 
 

MFC button control in MFC vissual C++

Post by Ron Sou » Wed, 27 Jun 2001 07:47:26


On Mon, 25 Jun 2001 07:59:17 +0200, Christian Schlette

>hi ron,

>I can think of three ways to get the result you wish to implement.
>they would look different at the surface, although the underlying
>MFC procedures are actually the same.

>1. dialog
>even in SDI apps its possible to open further windows, and there
>is a special sort of dialog, that doesnt have to be closed before the
>main program can carry on - a modal dialog.

>you can design such a dialog with the ressource editor, including all
>the buttons you wish to have, e.g. "pan", "rotate" etc.
>for each of those buttons you will have to set up an ID as well.
>then, use the class wizard to get a new class for your dialog and
>connect the buttons with the messaging system calling them via
>their IDs. set up some bools too, to keep track of the current
>button thats pressed.

>as far as I can remember, the modality of a dialog isnt decided by
>its baseclass, but the calling procedure.

>now, you'll need a switch-statement in your message handlers for
>your mouse - according to the button thats pressed - aka the "mouse
>mode" thats chosen - you have to do different things.

>2. menu entries
>another way to do it, is to include some new menu entries in your menu
>bar,
>one for each "mouse mode" you wish to implement.

>under the hood, its the same - IDs to name them and message handlers
>to connect them to the message loop. menu entries can be "checked" -
>use this feature to keep track of the current mode...

>3. floating toolbars
>yet another way to achieve what you want to do, is to fumble around with
>floating toolbars. they are a mixture of the two possibilities of user
>interaction
>described above - toolbars are those buttons with images beneath the menu
>bar.

>you can set up toolbars with the ressource editor. then, you will have to
>set some
>flags to make them able to "float" - to allow the toolbar to move around
>and/ or
>being attached to the borders of you SDI mainframe window.

>cheers,
>christian

 
 
 

MFC button control in MFC vissual C++

Post by Ron Sou » Wed, 27 Jun 2001 07:48:10


On Mon, 25 Jun 2001 07:59:17 +0200, Christian Schlette

christian
thanks for the help, I am kinda looking for a code example.  I am
trying to code a GUI in openGL for my CFD code.  I am new to the whole
MFC thing.  Anyway I basically was doing what you suggested but for
some reason I cant get it to work.  Any more help would be great.

Thanks
Ron

PS check out the attachment, its a screen captue of my CFD front end
it will give you an idea of what I am trying to do.

Quote:>hi ron,

>I can think of three ways to get the result you wish to implement.
>they would look different at the surface, although the underlying
>MFC procedures are actually the same.

>1. dialog
>even in SDI apps its possible to open further windows, and there
>is a special sort of dialog, that doesnt have to be closed before the
>main program can carry on - a modal dialog.

>you can design such a dialog with the ressource editor, including all
>the buttons you wish to have, e.g. "pan", "rotate" etc.
>for each of those buttons you will have to set up an ID as well.
>then, use the class wizard to get a new class for your dialog and
>connect the buttons with the messaging system calling them via
>their IDs. set up some bools too, to keep track of the current
>button thats pressed.

>as far as I can remember, the modality of a dialog isnt decided by
>its baseclass, but the calling procedure.

>now, you'll need a switch-statement in your message handlers for
>your mouse - according to the button thats pressed - aka the "mouse
>mode" thats chosen - you have to do different things.

>2. menu entries
>another way to do it, is to include some new menu entries in your menu
>bar,
>one for each "mouse mode" you wish to implement.

>under the hood, its the same - IDs to name them and message handlers
>to connect them to the message loop. menu entries can be "checked" -
>use this feature to keep track of the current mode...

>3. floating toolbars
>yet another way to achieve what you want to do, is to fumble around with
>floating toolbars. they are a mixture of the two possibilities of user
>interaction
>described above - toolbars are those buttons with images beneath the menu
>bar.

>you can set up toolbars with the ressource editor. then, you will have to
>set some
>flags to make them able to "float" - to allow the toolbar to move around
>and/ or
>being attached to the borders of you SDI mainframe window.

>cheers,
>christian

 
 
 

MFC button control in MFC vissual C++

Post by Ron Sou » Wed, 27 Jun 2001 07:48:39


On Mon, 25 Jun 2001 07:59:17 +0200, Christian Schlette

christian
thanks for the help, I am kinda looking for a code example.  I am
trying to code a GUI in openGL for my CFD code.  I am new to the whole
MFC thing.  Anyway I basically was doing what you suggested but for
some reason I cant get it to work.  Any more help would be great.

Thanks
Ron

PS check out the attachment, its a screen captue of my CFD front end
it will give you an idea of what I am trying to do.

Quote:>hi ron,

>I can think of three ways to get the result you wish to implement.
>they would look different at the surface, although the underlying
>MFC procedures are actually the same.

>1. dialog
>even in SDI apps its possible to open further windows, and there
>is a special sort of dialog, that doesnt have to be closed before the
>main program can carry on - a modal dialog.

>you can design such a dialog with the ressource editor, including all
>the buttons you wish to have, e.g. "pan", "rotate" etc.
>for each of those buttons you will have to set up an ID as well.
>then, use the class wizard to get a new class for your dialog and
>connect the buttons with the messaging system calling them via
>their IDs. set up some bools too, to keep track of the current
>button thats pressed.

>as far as I can remember, the modality of a dialog isnt decided by
>its baseclass, but the calling procedure.

>now, you'll need a switch-statement in your message handlers for
>your mouse - according to the button thats pressed - aka the "mouse
>mode" thats chosen - you have to do different things.

>2. menu entries
>another way to do it, is to include some new menu entries in your menu
>bar,
>one for each "mouse mode" you wish to implement.

>under the hood, its the same - IDs to name them and message handlers
>to connect them to the message loop. menu entries can be "checked" -
>use this feature to keep track of the current mode...

>3. floating toolbars
>yet another way to achieve what you want to do, is to fumble around with
>floating toolbars. they are a mixture of the two possibilities of user
>interaction
>described above - toolbars are those buttons with images beneath the menu
>bar.

>you can set up toolbars with the ressource editor. then, you will have to
>set some
>flags to make them able to "float" - to allow the toolbar to move around
>and/ or
>being attached to the borders of you SDI mainframe window.

>cheers,
>christian

 
 
 

MFC button control in MFC vissual C++

Post by Christian Schlett » Wed, 27 Jun 2001 15:43:00


hi ron,

for MFC code examples,
its always a good idea to get your hands on the MSDN
(Microsoft Developer Network).
its a bunch of CDs, updated every six months,
and its the best help one can get,
when working with the MFC.

as far as I know, there are parts of it available through
www.microsoft.com, at least when using their "search"
tool, looking for specific answers.

cheers,
christian

 
 
 

MFC button control in MFC vissual C++

Post by Uwe Kotycz » Fri, 29 Jun 2001 16:55:03



> On Mon, 25 Jun 2001 07:59:17 +0200, Christian Schlette

> christian
> thanks for the help, I am kinda looking for a code example.

You might check out my demo http://www.virtue.nu/kotyczka/opengl_en.html
to see if my design matches your desire.

Quote:> I am
> trying to code a GUI in openGL for my CFD code.  I am new to the whole
> MFC thing.  Anyway I basically was doing what you suggested but for
> some reason I cant get it to work.  Any more help would be great.

HTH
 
 
 

1. C++/GUI MFC Visual C++ help needed

Ladies and Gentlemen,

My name is Ron Mason with Professional Recruiters in Salt Lake City,
Ut.  I am currently working an assignment involving GUI applications for
a time management software firm and a radio station erp package.  I have
openings in Portland and on the Oregon coast in a rural town.

We need a total of 5 people to fill these positions.  If you or
associates would be interested please contact Ron Mason for further
details.

Thank you for your time and your consideration.

Regards,

Ron Mason
PROFESSIONAL RECRUITERS
3900 SOUTH 220 EAST
SUITE 9
SALT LAKE CITY, UTAH 84107
VOICE:  801-268-9940-307
FAX:    801-268-9825

2. FREE TEXTURES !!

3. coreldraw CDR format

4. OI 2.6 with MFC in a none MFC project

5. Building sced/elk for Linux: no member named '_pptr'/'_pbase'

6. newbie MFC button & OpenGL

7. Immediate animation JOB OPENING in Boston area

8. Using OpenGL on an MFC Common Control

9. MFC : how to release control to dialog box?

10. thumbwheel controls - MFC

11. OpenGL, MFC, and Control bars...

12. Printing Direct3D displays from MFC ActiveX control