diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2012-09-07 15:14:04 +0300 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2012-09-07 15:14:04 +0300 |
commit | d4d16198c2924b1085258c0b6562b562c7df3c29 (patch) | |
tree | d160aabd972fee403621b84cf1fc7848e98d45b9 /helpbox.h |
geresh 0.6.3geresh-0.6.3upstream
Diffstat (limited to 'helpbox.h')
-rw-r--r-- | helpbox.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/helpbox.h b/helpbox.h new file mode 100644 index 0000000..0b2037c --- /dev/null +++ b/helpbox.h @@ -0,0 +1,51 @@ +#ifndef BDE_HELPBOX_H +#define BDE_HELPBOX_H + +#include "editbox.h" +#include "label.h" + +class Editor; + +class HelpBox : public EditBox { + + Editor *app; + Label statusmsg; + + int toc_first_line; + int toc_last_line; + std::vector<unistring> toc_items; + + struct Position { + CombinedLine top_line; + Point cursor; + }; + static std::vector<Position> positions_stack; + +public: + + HAS_ACTIONS_MAP(HelpBox, EditBox); + HAS_BINDINGS_MAP(HelpBox, EditBox); + + HelpBox(Editor *aApp, const EditBox &settings); + bool load_user_manual(); + void jump_to_topic(const char *topic); + + void exec(); + virtual bool handle_event(const Event &evt); + + INTERACTIVE void layout_windows(); + INTERACTIVE void refresh_and_center(); + void push_position(); + INTERACTIVE void pop_position(); + INTERACTIVE void move_to_toc(); + INTERACTIVE void jump_to_topic(); + +protected: + + void scan_toc(); + virtual void do_syntax_highlight(const unistring &str, + AttributeArray &attributes, int para_num); +}; + +#endif + |