2

I want to place the elements of my (resizable) dialog in one of two panes.
How do I create a splitter for the panes, using WTL?

I found CSplitterImpl and CSplitterWindowImpl, but I can't figure out how to use them with my dialogs.

user541686
  • 205,094
  • 128
  • 528
  • 886

1 Answers1

3

WTLExplorer sample from WTL should get you the idea, see \Samples\WTLExplorer. If you'd like more, there's a lot around, e.g. http://www.viksoe.dk/code/splitterbar.htm

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • It works with dialogs too, what is exactly the problem you are having? – Roman R. Sep 08 '11 at 18:44
  • Hm... one of the problems is, do I have to position everything manually, every time it resizes? Dialogs have `BEGIN_DLGRESIZE_MAP`, but how do I get that working with splitters? – user541686 Sep 08 '11 at 18:49
  • Exactly as frames, dialogs receive WM_SIZE message and you can handle them (e.g. by updating position of the splitter). If you use DLGRESIZE maps, base class does resizing for you, and in this case you have to take care of both delivering message to the base class and handling it in your own. Other than this, there are no differences beteeen frames and dialogs, as both are obviously windows. – Roman R. Sep 08 '11 at 18:57
  • I'm confused. `DLGREIZE_CONTROL` takes in an ID. The splitter will have no ID, because it's not an element. How would they possibly work together? (I *really* don't want to have to do position layouts manually...) – user541686 Sep 08 '11 at 19:03
  • 2
    You always have the option to do SetDlgCtrlID on a child window, including splitter. – Roman R. Sep 08 '11 at 19:12
  • 1
    Oh cool! After fixing an error, that worked! Thanks so much for the help, that function is so helpful! :) – user541686 Sep 08 '11 at 20:05