.. _program_listing_file__tmp_ws_src_log_view_include_log_view_panels_help_panel.h: Program Listing for File help_panel.h ===================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/log_view/include/log_view/panels/help_panel.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef LOG_VIEW_HELP_PANEL_H_ #define LOG_VIEW_HELP_PANEL_H_ #include #include #include namespace log_view { struct HelpText { int line; std::string key; std::string description; }; class HelpPanel : public PanelInterface { public: HelpPanel(int height, int width, int y, int x); virtual ~HelpPanel() {} virtual void refresh(); virtual void resize(int height, int width, int y, int x); virtual bool handleMouse(const MEVENT& event) { return !hidden(); } virtual bool handleKey(int key); protected: virtual bool canNavigate() const { return !hidden(); } void printKeybinding(const HelpText& text); std::vector keys_; size_t longest_key_ = 0; size_t longest_line_ = 0; }; typedef std::shared_ptr HelpPanelPtr; } // namespace log_view #endif // LOG_VIEW_HELP_PANEL_H_