Graphics Reference
In-Depth Information
SceneTree Control
Select a SceneNode
Select a Primitive
in current
SceneNode
XformInfo Control
controlls xformInfo of
selected SceneNode
Primitive Control
controlls attributes of
selected primitive
Figure 11.10.
Tutorial 11.5 user interface details.
Recall that a
GUI container
is a subwindow that contains functionally related GUI
elements for organization and reuse purposes. To create GUI containers with the
MFC GUI API, on the front end we must do the following.
GUI container.
See Tuto-
rial2.8onp.69formorede-
tails of working with GUI con-
tainers using MFC.
1. Create a separate GUI ID (GUI element) to contain all the GUI elements.
2. Create a placeholder on the application window for placing the subwindow.
In the back-end implementation, we must do the following.
1. Create a data type, that is a class, to define the functionality of the GUI
elements.
2. Call the
ReplaceDialogControl()
function at run time to place the GUI
container into the application window.
In this case, as illustrated in Figure 11.11,
SceneTreeControl
contains two sep-
arate GUI containers,
XformInfoControl
and
PrimitiveControl
:
GUI Container
GUI Front End (GUI ID)
Implementation Back End
IDD
_
SCENETREE
_
CONTROL
data type:
CSceneTreeControl
SceneTreeControl
IDD
_
PRIMITIVE
_
CONTROL
data type:
CPrimitiveControl
PrimitiveControl
IDD
_
XFORMINFO
_
CONTROL
XformInfoControl
data type:
CXformInfoControl
Listing 11.9 reminds us that in our implementations, a GUI container data type
(
CSceneTreeControl
) typically subclasses from the MFC
CDialog
class. At
label A, we are reminded that the
OnInitDialog()
function will be called during
the MFC
CDialog
creation. At label B, we see that the
CSceneTreeControl
class has an instance of
CXformInfoControl
and an instance of
CPrimitive
Search WWH ::
Custom Search