/**** * * Class EditMenu is the companion view to the Edit model class. The EditMenu * window is an InterViews PullDownMenu. * * Classes NewMenuItem, OpenMenuItem, SaveMenuItem, SaveAsMenuItem, * PrintMenuItem, and QuitMenuItem specialize InterViews MenuItem to define the * items on the EditMenu window. * */ #ifndef editmenuIncluded #define editmenuIncluded #include "edit.h" #include "view.h" #include class EditMenu : public View { public: EditMenu(Name* n, Edit* e); /* * Construct this with the given name as the pulldown label. The given * Edit is the companion model. */ ~EditMenu(); /* * Deep destruct this by deleting all of its items. */ virtual void Compose(); /* * Compose this by inserting each of its six menu items -- New, Open, Save, * SaveAs, Print, and Quit -- into the pulldown menu window. */ protected: Edit* e; // Companion model (downcast version of this->m) PulldownMenu* pm; // For convenience, downcast version of this->w }; class UndoMenuItem : public MenuItem { public: UndoMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Undo model * function. */ Edit* e; // The compnion model }; class RedoMenuItem : public MenuItem { public: RedoMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Redo model * function. */ Edit* e; // The compnion model }; class RepeatMenuItem : public MenuItem { public: RepeatMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Repeat model * function. */ Edit* e; // The compnion model }; class CutMenuItem : public MenuItem { public: CutMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Cut model * function. */ Edit* e; // The compnion model }; class CopyMenuItem : public MenuItem { public: CopyMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Copy model * function. */ Edit* e; // The compnion model }; class PasteMenuItem : public MenuItem { public: PasteMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Paste model * function. */ /** * Data members. */ Edit* e; // The compnion model (downcast copy of this->m) PulldownMenu* pm; // The window (Downcast copy of this->w) }; class EditDeleteMenuItem : public MenuItem { public: EditDeleteMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the Delete model * function. */ /** * Data members. */ Edit* e; // The compnion model (downcast copy of this->m) PulldownMenu* pm; // The window (Downcast copy of this->w) }; class SelectAllMenuItem : public MenuItem { public: SelectAllMenuItem(Edit* e); /* * Construct this with the given Edit model. */ protected: virtual void Do(); /* * Respond to the selection of this menu item by calling the SelectAll * model function. */ /** * Data members. */ Edit* e; // The compnion model (downcast copy of this->m) PulldownMenu* pm; // The window (Downcast copy of this->w) }; #endif