//--------------------------------------------------------------------------- // // 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: Flex UI Chapter // FILE: notepad2.h // // VERSION 2.0 // // DESCRIPTION: // // An notepad application that uses a menu to perform file operations // and allows the user to select files from a list. // //--------------------------------------------------------------------------- #ifndef _NOTEPAD2_H_ #define _NOTEPAD2_H_ #include // For AppBase class. class Notepad2App : public ItemListenerInterface, public MenuAdapter, public AppBase { public: // // Constructor - initializes member data // Notepad2App(); // // Override SetAppContext to create the user interface for // the application. // virtual void SetAppContext(const TCHAR *context); // // Override MenuItemChosen to handle MenuEvents for the menu. // virtual void MenuItemChosen(MenuEvent& event); // // Override ItemStateChanged to handle ItemEvents for the list. // virtual void ItemStateChanged(ItemEvent& event ); // // Override Exit to destroy the user interface for // the application. // virtual void Exit(void); private: // // Helper function to create the UI for opening screen. // Result AttachNotepad2AppUI(void); // // Helper function to create the dialogs for the frame. // Result CreateDialogUI(const TCHAR *title, FlexDialog **dialog ); // // Class variables // FlexFrame *_notepad2AppMainFrame; FlexTextArea *_notepad2AppTextDisplay; FlexDialog *_notepad2AppSaveDialog; FlexDialog *_notepad2AppOpenDialog; Boolean _notepad2AppUIBuilt; // // Holds the id of the open dialog box // int8 _notepad2AppDialogOpen; enum { NOTEPAD2APP_NEW_MENU_ITEM = 0, NOTEPAD2APP_SAVE_MENU_ITEM = 1, NOTEPAD2APP_OPEN_MENU_ITEM = 2, NOTEPAD2APP_FRAME_GAP = 10, NOTEPAD2APP_LIST_ROWS = 4 }; }; // // A constant text menu for the application. // static const TCHAR *NOTEPAD2APP_MENU_ITEMS[3] = {_TEXT("New"), _TEXT("Save"), _TEXT("Open")}; #endif /* _NOTEPAD2_H_ */