Using a splitpane in a dialog
In your favourite dialog editor, if available, select the user-defined
control or use a container or frame to reserve space for the splitpane
control.
Once you have moved the place holder control on the
dialog, place over that the two controls to be displayed on the
sides of the splitpane, without caring too much about position and
size, as the splitpane would take care of that, add any other controls needed
by the dialog and then save it as a resource script.
Then open the .dlg or .rc file you created with a text
editor and find the statement of the user-control or any other
control you used as splitpane place holder. It will probably be
something like:
CONTROL "some text", <id>, <x>, <y>, <cx>, <cy>, <class>, <style>
Now modify the statement:
- Replace
the control text, if present, with an empty string (""),
- do not modify the id, position coordinates and size of the
control (unless there is any problem with them),
- replace <class>
with WC_SPLITPANE,
- ensure that the WS_VISIBLE
and WS_TABSTOP styles have been specified
and add to them any other specific splitpane
style
you may find suitable for your purposes.
Regarding the splitpane children, you can safely ignore their size and
position. Just ensure that their IDs are unique within their parent
dialog.
Finally, to make the splitpane work properly, in your dialog
procedure,
on dialog initialization, you have to notify it the IDs of its child
windows, by sending the proper PM message or by using the macro defined
for that purpose in axSplitpane.h:
In case you need to create nested splitpanes, just overlay the
control you are using as place holder as you would do
with any other kind of control and then modify the resource script
statements as described. Finally, when calling the dSplitSetChildren()
macro, use the
id of the nested splitpane.