-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathethalib.doc.txt
99 lines (65 loc) · 2.8 KB
/
ethalib.doc.txt
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
The EthaWin library is composed of many routines used to simulate a "graphical
user interface"...without the graphics. No docs are ready yet, but some
sample sources are included and here is a list of the main functions you will
use:
int Startup(makewin) /* setup screen, init vars, turn on mouse, etc... */
char makewin;
Reads in the ethawin config file, creates a screen, switches to it, and all
that stuff. It returns the path number of the window created. "makewin" is a
TRUE/FALSE thing. If "TRUE", make a new window to run off. If FALSE, use the
existing window.
TopText(wpath,left,title,right) /* display text on top line */
int wpath;
char *left,*title,*right;
Puts text on the top line of the screen.
LineInput(wpath,x,y,prompt,line,length)
int wpath,x,y;
char *prompt,*line;
int length;
Puts cursor at x/y location, displays prompt (if any), gets up to "length"
characters in variable "line".
int OpenFile(filename,mode)
char filename[];
int mode;
Opens file/device "filename" with "mode" access. Returns path to file. (Uses
OS9 system call open, and not fopen stuff.)
PopUp(wpath,title,x,y,w,h) /* pop-up shaded dialog box... */
int wpath;
char *title;
int x,y,w,h;
Pop up window with border. "title" is the title text, x/y is start position
and w/h is the width and height of the window.
PrintAt(wpath,x,y,text)
int wpath,x,y;
char *text;
Print "text" at x/y position.
Snooze(wpath)
int wpath;
Put this in to make program "sleep" if user isn't in current window. The
EthaWin library does this within it's own routines when waiting for menu
input, etc, but it might be useful elsewhere.
Wait(wpath)
int wpath;
Get a key or mouse click then return.
int YesNo(wpath,title) /* are you sure box */
int wpath;
char *title;
Displays a YES/NO box with "title" at the top (like "Quit?"). Returns TRUE if
yes, FALSE if no.
EndWin(wpath) /* kill overlay window */
int wpath;
Kills an overlay window, such as the one created by PopUp()
char CheckMenu(wpath,menu,option,ch,click)
int wpath,*menu,*option;
char *ch; /* pointer to character read, if any... */
char *click; /* returned status of mouse click */
Ah, the guts of the program! Call this routine in your main program loop. If
during the loop the user pulls down a menu and makes a choice by using hot
keys or mouse, this routine returns the "menu" number selected and "option"
selected from that. Else, it returns a "ch" character (if they selected one
that wasn't valid) and the TRUE/FALSE status of the mouse click. (ie, if this
routine is called and click is TRUE you might then check the mouse status to
see if they clicked on a hot spot on the screen.
I think that is most of it right now... Check the sample code for more info.
The only other crucial thing is knowing how to structure the menu text (see
..vars.c code) and link/compile them together.