Sets the submenus to Nil.
Controls the creation of the main view. TStandardCanvasView is constructed from a TGUIBundle pointer. The bundle is aliased, not owned.
Initializing submenus
// Copyright (C) 1995 Taligent, Inc. All rights reserved.
TSubMenuItem *TMarsPresenter::gToolSubMenuItem = NIL;
TSubMenuItem *TMarsPresenter::gColorSubMenuItem = NIL;
TSubMenuItem *TMarsPresenter::gPenSubMenuItem = NIL;
TSubMenuItem *TMarsPresenter::gTextSubMenuItem = NIL;
Version information
VersionDefinitionsMacro (TMarsPresenter, kOriginalVersion);
DynamicCastDefinitionsMacroOne (TMarsPresenter,TGUIPresenter);
Constructor
TMarsPresenter::TMarsPresenter (const TGUIBundle& bundle)
: TGUIPresenter(bundle), fCanvasView(NIL)
{
}
Destructor
TMarsPresenter::~TMarsPresenter()
{
// don't delete fCanvasView (just hanging onto a reference)
}
SetCanvasView
void
TMarsPresenter::SetCanvasView(TCanvasView* canvasView)
{
fCanvasView = canvasView;
}
Creating the main view
TView* TMarsPresenter::HandleCreateMainView (TGUIBundle* theBundleToAlias) const
{
// Create and return a TStandardCanvasView on top of a TScrollingView
TCanvasView *contentView = new TStandardCanvasView (theBundleToAlias);
contentView->SetAllocatedArea (TGArea(TGRect(0.,0.,500.,400.)));
::NonConst((TMarsPresenter*)this)->SetCanvasView(contentView);
// put everything into a scrolling view
TScrollingView* scrollingView = new TScrollingView(TScrollingView::kBothScrollbars);
scrollingView->AdoptViewToScroll(contentView);
scrollingView->SetAllocatedArea (TGArea(TGRect(0.,0.,350.,300.)));
return scrollingView;
}
Activating the menu
void TMarsPresenter::HandleMenuActivate (TMenu& theMainMenu)
{
TGUIPresenter::HandleMenuActivate(theMainMenu);
TMomentaryMenuItem* popup;
TDeleterFor<TArchive>theArchive = TArchive::CopyArchiveForSharedLibrary();
}
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.