A SERVICE OF

logo

// Insert the status bar and control bar into the frame
frame->Insert(*sb, TDecoratedFrame::Bottom);
frame->Insert(*cb, TDecoratedFrame::Top);
Once you’ e inserted the decorations into the frame, the last thingv
you have to do is set the main window to frame and set up the menu:
// Set the main window and its menu
SetMainWindow(frame);
GetMainWindow()->AssignMenu("COMMANDS");
Here’ a guide to where you can find more information on the topicss
Where to find
introduced in this step:
more information
Decorated frames are discussed in Chapter 6.
Status bars and control bars are discussed in Chapter 6.
Gadgets are discussed in Chapter 10.
Step 11: Moving to the Doc/View model
Step 11 introduces the Doc/View model of programming, which is
based on the principle of separating data from the interface for that
data. Essentially the data is encapsulated in a document object, which,
is derived from the TDocument class, and displayed on the screen and
manipulated by the user through a view object, which is derived from
the TView class.
Y u can find theo
The Doc/View model permits a greater degree of flexibility in how
source for Step 11 in
you present data than does a model that links data encapsulation and
the files
user interface into a single class. Using the Doc/View model, you can
STEP11.CPP,
STEP11.RC,
define a document class to contain any type of data, such as a simple
STEP11DV.CPP, and
text file, a database file, or in this tutorial, a line drawing. Y u cano
STEP11DV.RC in the
then create a number of different view classes, each one of which
directory
EXAMPLES\OWL\
displays the same data in a different manner or lets the user interact
TUTORIAL.
with that data in a different way.
For Step 11, however you’ll simply convert the application from its,
current model to the Doc/View model. The code from Step 11 will
look very different from the code from Step 10, but the running
application for Step 11 will look nearly identical to the application for
Step 10.
Chapter 2, Learning ObjectWindows
75