// $Revision: 1.4 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef Taligent_HELLOWORLDVIEW #include "HelloWorldView.h" #endif #ifndef Taligent_HELLOWORLDMODEL #include "HelloWorldModel.h" #endif #ifndef Taligent_TEXTDISPLAY #include #endif MCollectibleDefinitionsMacro(THelloWorldView, kOriginalVersion); THelloWorldView::THelloWorldView(TGUIBundle* bundle) : TDocumentComponentView(bundle) { } // This is called by the MCollectibleDefinitionsMacro, so it has to exist, // even though it is a private method, and views aren't supposed to be // copyable. THelloWorldView::THelloWorldView(const THelloWorldView& other) : TDocumentComponentView(other) { } THelloWorldView::~THelloWorldView() { } void THelloWorldView::DrawContents(TGrafPort& port) const { TGArea area; GetBounds(area); port.Draw(area, TFillBundle(TRGBColor(1.0, 1.0, 1.0))); TStandardText text("No model available."); if (GetGUIBundle()) { const TModelPointerTo model(GetModelReference()); model->GetText(text); } TTextDisplay display(text); display.SetOrigin(TGPoint(10, 50)); display.Draw(port); } THelloWorldView::THelloWorldView() : TDocumentComponentView() { }