Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Agemaniac

MFC toolbar question

This topic is 5281 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...!

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!