summaryrefslogtreecommitdiff
path: root/support/brief-t/latexh.cb
blob: c2041f4bd45401c888ac3f5dd3b52e827e1438bf (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*/
/*                                                                     */
/*        P†l Hedne 1990                                               */
/*                                                                     */
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*/
#include "dialog.h"
extern MathModus;

/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 	 */
/* 																						 ; 	 */
/* 																						 ; 	 */
/* 																						 ; 	 */
/* 																						 ; 	 */
/* 																						 ; 	 */
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 	 */
/* (macro _init																				 */
/* 	((int help_id) 																		 */
/* 	 (string text) 																		 */
/* 	 (global help_id) 																	 */
/* 	 (= help_id (create_buffer "Help menu" "latex.mnu" 1))					 */
/* 	 (sprintf text "Help ID = %d" help_id) 										 */
/* 	 (message text)																		 */
/* 	)																							 */
/* )																								 */
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; */
/* 																									; */
/*   -1	DIALOG_INIT 	  The dialog manager has just been invoked				; */
/*   -2	DIALOG_ENTER_FIELD  The cursor has just entered a non-list field		; */
/*   -3	DIALOG_ENTER_LIST   The cursor has just entered a l						; */
/*   -4	DIALOG_ALTER_LIST   The current item in a list has just been changed ; */
/*   -5	DIALOG_ALTER_MENU   The current item in a menu has just been changed ; */
/*   -5	DIALOG_MOVE_MENU (Same as DIALOG_ALTER_ME 									; */
/*   -6	DIALOG_PICK_MENU The user has just selected a menu button with Enter ; */
/*   -7	DIALOG_EXIT_FIELD   The cursor has just left a non-list field			; */
/*   -8	DIALOG_EXIT_LIST The cursor has just left a l								;	*/
/*   -9	DIALOG_TERM 	  The dialog manager is exit									;	*/
/*   -10 DIALOG_ESCAPE	  The user has just pressed Esc to exit all levels 	; */
/*   -11 DIALOG_F10	  The user has just pressed F10 to save a dialog box		; */
/*   -12 DIALOG_GREY_MINUS   The user has just pressed the keypad minus key	; */
/*   -13 DIALOG_CREATE_MENU  A menu buffer has just been made current			; */
/*   -14 DIALOG_CREATE_DBOX  A dialog box data buffe									; */
/* 																									; */
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; */

pro_help (...)
{
	int event, line, retval, exe_sw;

	string text, macro_name;

	global macro_name, exe_sw;

	get_parm (0, event);
	get_parm (1, line);
	get_parm (2, text);

	switch (event)
		{
		case DIALOG_INIT:
			{
			retval = TRUE;
			/* 				  (message "DIALOG INIT")									 */
			}
		case DIALOG_ENTER_FIELD:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_ENTER_FIELD") 						 */
			}
		case DIALOG_ENTER_LIST:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_ENTER_LIST")							 */
			}
		case DIALOG_ALTER_LIST:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_ALTER_LIST")							 */
			}
		case DIALOG_ALTER_MENU:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_ALTER_MENU")							 */
			}
		case DIALOG_MOVE_MENU:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_MOVE_MENU")							 */
			}
		case DIALOG_PICK_MENU:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_PICK_MENU")							 */
			macro_name = substr (text, index (text, ";") + 1);
			_dialog_esc ();
			exe_sw = 1;
			}
		case DIALOG_EXIT_FIELD:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_EXIT_FIELD")							 */
			}
		case DIALOG_EXIT_LIST:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_EXIT_LIST")							 */
			}
		case DIALOG_TERM:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_TERM")									 */
			}
		case DIALOG_ESCAPE:
			{
			exe_sw = 0;
			retval = TRUE;
			/* 				  (message "DIALOG_ESCAPE")								 */
			}
		case DIALOG_F10:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_F10")									 */
			}
		case DIALOG_GREY_MINUS:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_GREY_MINUS")							 */
			}
		case DIALOG_CREATE_MENU:
			{
			retval = TRUE;
			/* 				  (message "DIALOG_CREATE_MENU") 						 */
			}
			/* default																			 */
		default:
			{
			beep ();
			/* 					(message "Illegal key") 								 */
			}
		}
	returns retval;
}

/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 	 */
latex_help (...)
{
	string file, title, msg, action;

	title = "LaTex help";
	msg = "Press ESC to continue, ENTER to pick";
	file = "latex.mnu";
	if (MathModus == 1)
		file = "latexmat.mnu";
	action = "pro_help";
	/* 	  (_process_menu lx by rx ty title msg filename buf_id action fast) */
	_process_menu (10, 5, 10, 5, title, msg, file, NULL, action, 1);
	/* 		(_process_menu 10 15 70 5 title msg NULL help_id action 1)		 */
	if (exe_sw == 1)
		execute_macro (macro_name);
}
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 	 */
string gen_help (...)
{
   string parameter,file, title, msg, action;
   int buf_key,line;

	title = "";
	msg = "Press ESC to continue, ENTER to pick";
	file = "";
	action = "pro_help";
   get_parm (0, file);
   title=file; 
  	exe_sw=0;
   if (get_parm (1, buf_key))
   	_process_menu(10,5,10,5,title,msg,NULL,buf_key,action,1,line,parameter);
   else
    	_process_menu (10,5,10,5,title,msg,file,NULL,action,1,line,parameter);
   if (exe_sw == 1)
  		execute_macro (macro_name);
   return(parameter);
}