// $Revision: 1.3 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_SAMPLEWINDOWPROGRAM #include "SampleWindowProgram.h" #endif #ifndef Taligent_TEXTMODEL #include #endif #ifndef Taligent_TEXTVIEW #include #endif #ifndef Taligent_TEXTMENUS #include #endif // Note you must call TMenu::SetControlLayout, it will not default for you. // If you forget, your menu will not layout properly. int main(int argc, char* argv[]) { TSimpleTextStore store(TStandardText("Some initial sample text to edit.")); TSimpleTextView* view = new TSimpleTextView(&store); view->SetAllocatedArea(TGArea(TGRect(TGPoint::kOrigin, TGPoint(250, 150)))); TStandardText windowTitle(argv[0]); TStandardText menuTitle = windowTitle + TStandardText(" Menus"); TMenu* menu = new TMenu(); menu->SetControlLayout(MControl::kTopToBottom); menu->SetItemLayout(MControl::kLeftToRight); TTextMenu textMenu(view); textMenu.AddTextMenus(*menu); TSampleWindowProgram program(view, windowTitle, menu, menuTitle); program.Run(); return 0; }