helpbox.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef BDE_HELPBOX_H
  2. #define BDE_HELPBOX_H
  3. #include "editbox.h"
  4. #include "label.h"
  5. class Editor;
  6. class HelpBox : public EditBox {
  7. Editor *app;
  8. Label statusmsg;
  9. int toc_first_line;
  10. int toc_last_line;
  11. std::vector<unistring> toc_items;
  12. struct Position {
  13. CombinedLine top_line;
  14. Point cursor;
  15. };
  16. static std::vector<Position> positions_stack;
  17. public:
  18. HAS_ACTIONS_MAP(HelpBox, EditBox);
  19. HAS_BINDINGS_MAP(HelpBox, EditBox);
  20. HelpBox(Editor *aApp, const EditBox &settings);
  21. bool load_user_manual();
  22. void jump_to_topic(const char *topic);
  23. void exec();
  24. virtual bool handle_event(const Event &evt);
  25. INTERACTIVE void layout_windows();
  26. INTERACTIVE void refresh_and_center();
  27. void push_position();
  28. INTERACTIVE void pop_position();
  29. INTERACTIVE void move_to_toc();
  30. INTERACTIVE void jump_to_topic();
  31. protected:
  32. void scan_toc();
  33. virtual void do_syntax_highlight(const unistring &str,
  34. AttributeArray &attributes, int para_num);
  35. };
  36. #endif