/* * Class TimeEditor is a subclass of FullTextEditor with specializeded * keyboard and mouse handlers to meet the requirements of the time preferences * display. See TimePrefsBrowser for further discussion of these requirements. * See FullTextEditor for documentation on all of the inherited text editing * functions, most of which will not be specialized. */ #ifndef timeprefedIncluded #define timeprefedIncluded #include <441/include/std-macros.h> #include <441/include/fulltexteditor.h> const char TABCHAR = ' '; const char RTNCHAR = ' '; class TimeEditor : public FullTextEditor { public: TimeEditor(int rows, int cols); /* * Construct with the given number or rows and columns. */ protected: virtual void Handle(Event& e); /* * Handle the given event per the specialized requirements of a * TimeEditor. Viz., turn on editing cursor when left mouse is * clicked, turn off cursor when mouse leaves. More such specialized * requrirements may be added to suit Bill's fancy. See comments in .c * file for further implementation details of specialized event handling. */ virtual void HandleChar(char c); /* * Handle the given char per specialized requrements. Viz., if it's a tab, * move to next column, same row. If it's a return, move to next row, same * column. */ bool LocalHandleChar(char c); /* * Return true if the given char is handled entirely locally. Return false * if given char is not handled locally or partially handled locally. A * true return means TextEditor::HandleChar should not be called, false * return means it should be. */ void HandleTab(); /* * Implement special handling of a tab char. */ void HandleReturn(); /* * Implement special handling of a return char. */ }; #endif