chiark / gitweb /
Import upstream version 5.3.
[mup] / mup / mupmate / Help.H
CommitLineData
fac14bbe
MW
1/* Copyright (c) 2006 by Arkkra Enterprises */
2/* All rights reserved */
3
4#ifndef _HELP_H_
5#define _HELP_H_
6
7// Classes for Help menu item off of main toolbar
8
9#include <FL/Fl_Double_Window.H>
10#include <FL/Fl_Multiline_Output.H>
11#include <FL/Fl_Help_View.H>
12#include <FL/Fl_Return_Button.H>
13#include <FL/Fl_Text_Display.H>
14#include <FL/filename.H>
15#include "Config.H"
16
17
18// Class for window to let user browse the HTML version of Mup User's Guide
19
20class Uguide_browser : Fl_Double_Window {
21
22friend class Help;
23
24public:
25 Uguide_browser(void);
26 ~Uguide_browser(void);
27
28 // User can change font/size preference. This callback notifies
29 // of such changes, so we can adjust the output accordingly
30 static void font_change_cb(void * data, Fl_Font font, unsigned char size);
31
32 // Load the User's Guide top level index.html file
33 void load_uguide(void);
34
35private:
36 void font_change(Fl_Font font, unsigned char size);
37
38 // On Windows, Fl_Help_View doesn't seem to properly follow relative
39 // URLs, so we use the link() callback to prepend the proper directory.
40 static const char * resolve_link(Fl_Widget *, const char * uri);
41
42 Fl_Help_View *browser_p;
43 Font_change_registration * font_change_reg_p;
44 bool loaded;
45};
46
47
48// Class to give first time user some hints.
49
50class StartupHints : Fl_Double_Window {
51
52friend class Help;
53
54public:
55 StartupHints(void);
56 ~StartupHints(void);
57
58 static void OK_cb(Fl_Widget *, void * data);
59 // User can change font/size preference. This callback notifies
60 // of such changes, so we can adjust the output accordingly
61 static void font_change_cb(void * data, Fl_Font font, unsigned char size);
62private:
63 void OK(void);
64 void font_change(Fl_Font font, unsigned char size);
65
66 Font_change_registration * font_change_reg_p;
67 Fl_Text_Display * text_p; // The text of the hints
68 Fl_Return_Button * OK_p;
69};
70
71
72// Class for "About" window
73
74class About_dialog : Fl_Double_Window {
75
76friend class Help;
77
78public:
79 About_dialog(void);
80 ~About_dialog(void);
81
82 static void OK_cb(Fl_Widget *, void * data);
83
84private:
85 void OK(void);
86
87 Fl_Multiline_Output * message_p;
88 Fl_Return_Button * ok_p;
89};
90
91
92// Class for Help menu item from main toolbar
93
94class Help {
95public:
96 Help(void);
97 ~Help(void);
98
99 static void Uguide_cb(Fl_Widget *, void * data);
100 static void Startup_Hints_cb(Fl_Widget *, void * data);
101 static void About_cb(Fl_Widget *, void * data);
102
103private:
104 void Uguide(void);
105 void Startup_Hints(void);
106 void About(void);
107
108 About_dialog * about_p;
109 StartupHints * startup_hints_p;
110 Uguide_browser * uguide_p;
111};
112
113#endif