Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
00001 //-*-c++-*- 00002 #ifndef INCLUDED_HelpControl_h_ 00003 #define INCLUDED_HelpControl_h_ 00004 00005 #include "NullControl.h" 00006 00007 //! Recurses through the menu system and outputs the name and description of each item 00008 class HelpControl : public NullControl{ 00009 public: 00010 //!< constructor 00011 HelpControl(ControlBase* r, unsigned int depth=-1U) 00012 : NullControl("Help","Recurses through the menu system and outputs the name and description of each item"), 00013 maxDepth(depth), root(r) 00014 {} 00015 00016 //! displays global Controller commands (hardcoded as strings, will need updates) as well as recursing the menu system (dynamic) 00017 virtual ControlBase * activate(MotionManager::MC_ID disp_id, Socket * gui); 00018 00019 //! displays the menu items of @a r and their descriptions, recursing on submenus 00020 /*! @a prefix is what should be displayed before each menu item (like a bullet point) 00021 * this is itself prefixed by 2 spaces for each level of recursion. Word wrapping 00022 * is performed to maintain the clean indenting */ 00023 void report(ControlBase* r, const std::string& prefix, unsigned int max_depth); 00024 00025 //! sets #maxDepth 00026 void setReportDepth(unsigned int depth) { maxDepth=depth; } 00027 00028 //! gets #maxDepth 00029 unsigned int getReportDepth() const { return maxDepth; } 00030 00031 protected: 00032 static const unsigned int term_width=80; //!< number of character to word wrap the display 00033 00034 unsigned int maxDepth; //!< default maximum recursion depth for reporting from activation 00035 00036 ControlBase * root; //!< stores root node to begin recursion (this item is not displayed) 00037 00038 private: 00039 HelpControl(const HelpControl&); //!< don't call 00040 HelpControl operator=(const HelpControl&); //!< don't call 00041 }; 00042 00043 /*! @file 00044 * @brief Describes HelpControl, which recurses through the menu system and outputs the name and description of each item 00045 * @author ejt (Creator) 00046 * 00047 * $Author: ejt $ 00048 * $Name: tekkotsu-2_0 $ 00049 * $Revision: 1.5 $ 00050 * $State: Exp $ 00051 * $Date: 2004/01/19 22:03:58 $ 00052 */ 00053 00054 #endif
Tekkotsu v2.0 |
Generated Wed Jan 21 03:20:28 2004 by Doxygen 1.3.4 |