Skip to main content
GameDev.net gamedev.net
🔒 Locked

MFC toolbar question

Started by Agemaniac Jun 2, 2004 at 2:02 PM 3 replies 500+ views
Original Post
Agemaniac
Agemaniac
Hi, i have a question about the ways u can use a tool bar with MFC. i already know that u can use a tool bar as default, like save, undo, cut, tool bar. And a Dialog Bar, that is attached to the parent window and based on dialog template (can have all the controls, like a dialog). But i want a dialog with some tools like a Dialog Bar, but that can float, so the user can move it around. Ps: the main window cant stop the execution when the dialog open. Is there a way to do this setting some kind of flag in the Dialog Bar or should i use a Dialog instead. if so, how can i do it? how can i create the dialog, and call it? i cant find any method like ShowDialogBar to hide and show the dialog. Should i destroy and Create the dialog each time i wanna show it?? thanks...!
felisandria
felisandria
quote:

Ps: the main window cant stop the execution when the dialog open.


Look at the information on modeless dialogs in your VC help files.
quote:

Is there a way to do this setting some kind of flag in the Dialog Bar or should i use a Dialog instead.


If you want it to be dockable, then I would suggest you use a CControlBar, because those are easier to do docking with, though it''s also possible for normal frames. See docking, enabling toolbars for, in your help index.
quote:

if so, how can i do it? how can i create the dialog, and call it? i cant find any method like ShowDialogBar to hide and show the dialog.


CControlBars are derived from CWnd like anything else. You should be able to just use the base ShowWindow(SW_HIDE) to hide it.
quote:

Should i destroy and Create the dialog each time i wanna show it??


No reason to, just makes things slow. As long as you can show and hide there''s no reason to not keep the control bar resident if you expect them to pop it up and down fairly often.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
SoDdit
SoDdit
or you could check out CDialogBar

which is handy.

just one note you need to enable/disable the controls on the dialogBar the same as you do for toolbars and menus.

i is 1337
felisandria
felisandria
CDialogBar is derived from CControlBar. I wasn't sure if he would want CReBar or CDialogBar, so I thought I'd just talk about the base class.

-fel


[edited by - felisandria on June 2, 2004 7:25:44 PM]
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Agemaniac
Agemaniac
Many thanks...i really apreciate the info.....
thanks.!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.