From d4d16198c2924b1085258c0b6562b562c7df3c29 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Fri, 7 Sep 2012 15:14:04 +0300 Subject: geresh 0.6.3 --- helpbox.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 helpbox.h (limited to 'helpbox.h') 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 toc_items; + + struct Position { + CombinedLine top_line; + Point cursor; + }; + static std::vector 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 + -- cgit v1.2.3