Re: Non-modal dialog in CSplitterWindow???

Tech-Archive recommends: Speed Up your PC by fixing your registry



Tom Serface wrote:

You could just use RUNTIME_CLASS() on the dialog class to put it in a view,
but I'm not sure this would solve your problem.

You might want to put your toolbar code into the mainframe class or use
OnCmdMsg() to route the messages to all of the views. Then you could just
us a CFormView for your dialog.

This is quite an ugly workaround. Enabling and disabling toolbar command
is the responsibility of a view, the mainframe should not be burdened
with such tasks. Putting my dialog into a view won't do no good: I would
get back the problems that I got before I tried to make the view to a
dialog.


"Scott McPhillips [MVP]" wrote:
If you really want a splitter, you probably should put a CFormView into
the splitter pane instead of a dialog. A CFormView is a view that
displays a dialog template. Using a CFormView will not disable the
toolbar buttons if you put the OnUpdate... handlers in CMainFrame.

See above about putting the handlers in the main frame.

From your description it sounds like you might not really want a
splitter. You can simply create a modeless dialog independent of the
views (it would float above the view), or you can put the user controls
on a CDialogBar (a strip along some edge of the view), or you could put
them on a control pallette. The MFC samples contains examples of all of
these approaches.

I want a dialog that does not float, but sits on the left side of the
frame window. One should be able to make it thinner (resize it
horizontally), so a splitter bar would be perfect. The dialog should be
able to scroll vertically, though.

Here is my (ugly) workaround: I use a CScrollView instead of the dialog.
This view has empty OnUpdate-handlers, so it won't mess with the tool
bar. Any OnCommands from the tool bar are routed by hand to the view.

I believe that this is quite unsophisticated. There should be a better
way to do this in MFC. I will have a look at the CDialogBar class. Is it
possible to create a dialog bar with any dialog template? Even
containing edits and such? Can I make a CDialogBar scrollable?

Thanks,
Stuart
.


Quantcast