//--------------------------------------------------------------------------- // // Geoworks (R) application software and GEOS (R) operating system // software copyright (C) 1990-1998 Geoworks. All rights reserved. // United States Patents 5327529, 5237651, and 5438662. U.K. Patents // 0375703 and 0631677. German Patents P3854269.2-08 and // 69307728.1-08. French Patents 0375703 and 0631677. Other // international patents pending. // // This software is the confidential and proprietary information of // Geoworks ("Confidential Information"). You shall not disclose // such Confidential Information and shall use it only in accordance // with the terms of the license agreement you entered into with // Geoworks. // // // PROJECT: GEOS-SC documentation // MODULE: Tutorial chapter // FILE: tutsamp.h // // VERSION: 2.2 // // DESCRIPTION: // This is a simple "Hello World" application. // //--------------------------------------------------------------------------- // // This is to avoid multiple inclusions of this file // #ifndef _TUTSAMPAPP_H_ #define _TUTSAMPAPP_H_ #include //for UI objects (FlexFrame, etc.) #include //for AppBase class #include //for ActionListenerInterface class #include //for ResidentApplication class class TutorialApp : public ActionListenerInterface, public AppBase { public: TutorialApp(void); // SetAppContext is overridden to build the UI. virtual void SetAppContext(const TCHAR *context); // GetAppContext is overridden to save the application state. virtual TCHAR *GetAppContext(void); // ActionPerformed is overridden to intercept button presses. virtual void ActionPerformed(ActionEvent& event); // Exit is overridden to clean up when the application quits. virtual void Exit(void); private: // Helper function to create our UI. Result BuildUI(void); // Flag to let us know if we have already built our UI. Boolean _builtUI; // This label says, "Hello World!" // We keep its pointer handy so that code can // reference it to make it appear and disappear. FlexLabel *_helloworldLabel; // We keep a pointer to this object // so that we can delete it // when shutting down the application's UI. VerticalFlowLayout *_layout; }; // // Strings that are not user-visible // const TCHAR *const TUTSAMP_APP_NAME = _TEXT("tutsamp"); // Subclass of ResidentApplication to register the app with the system. class TutorialSampResidentApplication : public ResidentApplication { public: TutorialSampResidentApplication() : ResidentApplication(TUTSAMP_APP_NAME) {}; virtual AppBase *CreateAppBase(void) { return new TutorialApp; } }; static TutorialSampResidentApplication tutsampApp; #endif // _TUTSAMPAPP_H_