1 | /*
|
---|
2 | =============================================================================
|
---|
3 | sqfield.c -- MIDAS-VII sequence display field functions
|
---|
4 | Version 9 -- 1989-11-16 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #define DEBUGIT 0
|
---|
9 |
|
---|
10 | #include "ram.h"
|
---|
11 |
|
---|
12 | #if DEBUGIT
|
---|
13 | short debugqf = 1;
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | struct curpak sq_flds = {
|
---|
17 |
|
---|
18 | stdctp5, /* curtype */
|
---|
19 | nokey, /* premove */
|
---|
20 | postcm, /* pstmove */
|
---|
21 | cxkstd, /* cx_key */
|
---|
22 | cykstd, /* cy_key */
|
---|
23 | smxupd, /* cx_upd */
|
---|
24 | sqyupd, /* cy_upd */
|
---|
25 | stopsm, /* xy_up */
|
---|
26 | nokey, /* xy_dn */
|
---|
27 | sqxkey, /* x_key */
|
---|
28 | sqekey, /* e_key */
|
---|
29 | sqmkey, /* m_key */
|
---|
30 | sqdkey, /* d_key */
|
---|
31 | nonf, /* not_fld */
|
---|
32 | (struct fet *)NULL, /* curfet */
|
---|
33 | sqboxes, /* csbp */
|
---|
34 | crate1, /* cratex */
|
---|
35 | crate1, /* cratey */
|
---|
36 | CT_SMTH, /* cmtype */
|
---|
37 | CTOX(2), /* cxval */
|
---|
38 | RTOY(DATAROW) /* cyval */
|
---|
39 | };
|
---|
40 |
|
---|
41 | /* |
---|
42 |
|
---|
43 | */
|
---|
44 |
|
---|
45 | /*
|
---|
46 | =============================================================================
|
---|
47 | sqmkey() -- M key processing for the sequence display
|
---|
48 | =============================================================================
|
---|
49 | */
|
---|
50 |
|
---|
51 | void sqmkey(void)
|
---|
52 | {
|
---|
53 | register int16_t nc;
|
---|
54 |
|
---|
55 | if (astat) {
|
---|
56 |
|
---|
57 | if (stccol EQ 48) {
|
---|
58 |
|
---|
59 | if (ss_ptsw EQ 0) {
|
---|
60 |
|
---|
61 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
---|
62 |
|
---|
63 | (*premove)(); /* handle PRE-MOVE functions */
|
---|
64 |
|
---|
65 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
---|
66 |
|
---|
67 | cvtime = syrate;
|
---|
68 | ncvwait = curhold;
|
---|
69 |
|
---|
70 | ss_sqsw = -1;
|
---|
71 | cmtype = nc;
|
---|
72 | cvwait = 1;
|
---|
73 | }
|
---|
74 |
|
---|
75 | } else
|
---|
76 | stdmkey();
|
---|
77 |
|
---|
78 | } else {
|
---|
79 |
|
---|
80 | if (stccol EQ 48) {
|
---|
81 |
|
---|
82 | ss_sqsw = 0;
|
---|
83 | cvwait = 1;
|
---|
84 | ncvwait = cvtime;
|
---|
85 | cmfirst = TRUE;
|
---|
86 |
|
---|
87 | if (ss_ptsw EQ 0)
|
---|
88 | (*xy_up)();
|
---|
89 |
|
---|
90 | (*pstmove)(); /* handle POST-MOVE functions */
|
---|
91 |
|
---|
92 | } else
|
---|
93 | stdmkey();
|
---|
94 | }
|
---|
95 | }
|
---|
96 |
|
---|
97 | /* |
---|
98 |
|
---|
99 | */
|
---|
100 |
|
---|
101 | /*
|
---|
102 | =============================================================================
|
---|
103 | sqekey() -- E key processing for the sequence display
|
---|
104 | =============================================================================
|
---|
105 | */
|
---|
106 |
|
---|
107 | void sqekey(void)
|
---|
108 | {
|
---|
109 | register int16_t nc;
|
---|
110 |
|
---|
111 | if (astat) {
|
---|
112 |
|
---|
113 | if (stccol EQ 48) {
|
---|
114 |
|
---|
115 | if (ss_ptsw EQ 0) {
|
---|
116 |
|
---|
117 | (*xy_dn)(); /* handle KEY_DOWN functions */
|
---|
118 |
|
---|
119 | (*premove)(); /* handle PRE-MOVE functions */
|
---|
120 |
|
---|
121 | nc = (*curtype)(); /* get new CURSOR TYPE wanted */
|
---|
122 |
|
---|
123 | cvtime = syrate;
|
---|
124 | ncvwait = curhold;
|
---|
125 |
|
---|
126 | ss_sqsw = 1;
|
---|
127 | cmtype = nc;
|
---|
128 | cvwait = 1;
|
---|
129 | }
|
---|
130 |
|
---|
131 | } else
|
---|
132 | select();
|
---|
133 |
|
---|
134 | } else {
|
---|
135 |
|
---|
136 | if (stccol EQ 48) {
|
---|
137 |
|
---|
138 | ss_sqsw = 0;
|
---|
139 | cvwait = 1;
|
---|
140 | ncvwait = cvtime;
|
---|
141 | cmfirst = TRUE;
|
---|
142 |
|
---|
143 | if (ss_ptsw EQ 0)
|
---|
144 | (*xy_up)();
|
---|
145 |
|
---|
146 | (*pstmove)(); /* handle POST-MOVE functions */
|
---|
147 |
|
---|
148 | } else
|
---|
149 | select();
|
---|
150 | }
|
---|
151 | }
|
---|
152 |
|
---|
153 | /* |
---|
154 |
|
---|
155 | */
|
---|
156 |
|
---|
157 | /*
|
---|
158 | =============================================================================
|
---|
159 | sqxkey() -- delete key handler
|
---|
160 | =============================================================================
|
---|
161 | */
|
---|
162 |
|
---|
163 | void sqxkey(void)
|
---|
164 | {
|
---|
165 | if (NOT astat)
|
---|
166 | return;
|
---|
167 |
|
---|
168 | if (inrange(stccol, 2, 4)) {
|
---|
169 |
|
---|
170 | memsetw(&seqbuf, 0, NSEQW);
|
---|
171 | memsetw(&seqtab[curslin], 0, NSEQW);
|
---|
172 | dsqlin(sqdebuf, curslin);
|
---|
173 | sqdeflg = TRUE;
|
---|
174 | dcursq();
|
---|
175 |
|
---|
176 | } else if (inrange(stccol, 12, 22)) {
|
---|
177 |
|
---|
178 | seqtab[curslin].seqact1 = 0;
|
---|
179 | seqtab[curslin].seqdat1 = 0;
|
---|
180 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
181 | dsqlin(sqdebuf, curslin);
|
---|
182 | sqdeflg = TRUE;
|
---|
183 | dcursq();
|
---|
184 |
|
---|
185 | } else if (inrange(stccol, 24, 34)) {
|
---|
186 |
|
---|
187 | seqtab[curslin].seqact2 = 0;
|
---|
188 | seqtab[curslin].seqdat2 = 0;
|
---|
189 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
190 | dsqlin(sqdebuf, curslin);
|
---|
191 | sqdeflg = TRUE;
|
---|
192 | dcursq();
|
---|
193 |
|
---|
194 | } else if (inrange(stccol, 36, 46)) {
|
---|
195 |
|
---|
196 | seqtab[curslin].seqact3 = 0;
|
---|
197 | seqtab[curslin].seqdat3 = 0;
|
---|
198 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
199 | dsqlin(sqdebuf, curslin);
|
---|
200 | sqdeflg = TRUE;
|
---|
201 | dcursq();
|
---|
202 | }
|
---|
203 | }
|
---|
204 |
|
---|
205 | /* |
---|
206 |
|
---|
207 | */
|
---|
208 |
|
---|
209 | /*
|
---|
210 | =============================================================================
|
---|
211 | sqfield() -- setup field routines for the sequence editor
|
---|
212 | =============================================================================
|
---|
213 | */
|
---|
214 |
|
---|
215 | void sqfield(void)
|
---|
216 | {
|
---|
217 |
|
---|
218 | #if DEBUGIT
|
---|
219 | if (debugsw AND debugqf)
|
---|
220 | printf("sqfield(): ENTRY\n");
|
---|
221 | #endif
|
---|
222 |
|
---|
223 | curset(&sq_flds);
|
---|
224 |
|
---|
225 | #if DEBUGIT
|
---|
226 | if (debugsw AND debugqf)
|
---|
227 | printf("sqfield(): EXIT\n");
|
---|
228 | #endif
|
---|
229 |
|
---|
230 | }
|
---|
231 |
|
---|