1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
/*
Cadabra: a field-theory motivated computer algebra system.
Copyright (C) 2001-2011 Kasper Peeters <kasper.peeters@aei.mpg.de>
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef help_hh__
#define help_hh__
#include <string>
#include <vector>
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/uimanager.h>
#include "widgets.hh"
/// The help browser window is separate from the main window.
class CadabraHelp : public Gtk::Window {
public:
CadabraHelp();
enum objtype_t { t_none=0, t_property=1, t_algorithm=2, t_texcommand=3 };
void on_help_context_link(CadabraHelp::objtype_t, std::string);
void on_help_close();
virtual bool on_configure_event(GdkEventConfigure *);
void display_help(objtype_t, const std::string& obj);
void display_help();
std::string texify(const std::string& str) const;
virtual bool on_key_press_event(GdkEventKey *);
std::vector<std::pair<objtype_t, std::string> > history;
int history_pos;
private:
virtual bool on_delete_event(GdkEventAny*);
void on_back();
void on_forward();
Gtk::VBox topbox;
Gtk::HBox *buttonbox;
Gtk::Label relatedlabel;
Gtk::HBox navbox;
Gtk::Button back, forward;
Glib::RefPtr<Gtk::ActionGroup> actiongroup;
Glib::RefPtr<Gtk::UIManager> uimanager;
Gtk::ScrolledWindow scroll;
Gtk::VBox scrollbox;
Glib::RefPtr<Gtk::TextBuffer> textbuf;
Glib::RefPtr<TeXBuffer> texbuf;
TeXView *texview;
};
#endif
|