// $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 // For MMomentaryTextCommandState. #ifndef Taligent_TEXTMENUS #include #endif #ifndef TaligentSamples_SCRAMBLETEXTCOMMAND #include "ScrambleTextCommand.h" #endif 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); TCommandOn* command = new TScrambleTextCommand(); menu->AdoptLast(new TMomentaryMenuItem( new MMomentaryTextCommandState(view, command), new TTextLabel(TStandardText("Scramble")))); //- TSampleWindowProgram program(view, windowTitle, menu, menuTitle); program.Run(); return 0; }