Advertisement

MFC and tool windows

Started by June 18, 2001 01:11 PM
0 comments, last by Goodlife 23 years, 7 months ago
Hi all, Once upon a time I was one of those "WRITE MY OWN GUI!" programmers. Well, I''m going over to MFC, because that''s what people want in a "commercial" product. So, what I''m writing right now is a modeler for my 3D things. And I''m trying to write it in MFC. So I''m using the Multiple Document Interface generated by the App wizard. Now, any of you who have seen Adobe Photoshop, Paint Shop Pro, etc, will recognize those tool windows that the brush styles are on. I''m not talking about docking toolbars-- I''m talking about the tool windows that float in the middle of nowhere. In my MFC Multi-document program, I want to put a CWnd up that can float anywhere (even off the main frame) and yet minimizes with the main frame. When I make a CWnd a child of the main frame, the CWnd does not process any messages, except WM_PAINT and that only occasionally. When it make it NOT a child, it can go behind the main frame, which I can''t do in my program. Can someone help? All I want to do is make a little CWnd that sits in front of all the documents, never loses the "selected" color on the toolbar, and basically acts like a child of the main frame. I''m fairly new at MFC, but not THAT new, and I''m not sure why I can''t make this happen. Thanks.
-- Goodlife-----------------------------Those whom the gods would destroy, they first drive mad.--DirectX design team official motto
My suggestion would be to use a CToolBar with embedded controls. To see how to embed controls in a CToolBar, reference this article on Codeguru

The actual control you want to insert would probably be a CRichEditCtrl, because those are the easiest thing to use to make a "box with color in it", oddly enough, from my experience (using SetBackgroundColor). Just be sure to call AfxInitRichEdit before the toolbar is displayed, as you must do that to load a rich edit control otherwise your app will just shut down with no warnings or errors.

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

This topic is closed to new replies.

Advertisement