1 | #ifndef INPUTHELP_H |
---|
2 | #define INPUTHELP_H |
---|
3 | |
---|
4 | void inputhelpnum(struct skin* inputhelp, struct skin* inputbox, char num, int screencalc, int filelistview, int flag) |
---|
5 | { |
---|
6 | inputboxff(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
7 | inputboxchar(inputhelp, inputbox, num, screencalc, filelistview, flag); |
---|
8 | drawscreen(inputhelp, screencalc, flag); |
---|
9 | } |
---|
10 | |
---|
11 | void translateinputhelp(struct skin* inputhelp, int flag) |
---|
12 | { |
---|
13 | struct skin* sup2grid1 = getscreennode(inputhelp, "sup2grid1"); |
---|
14 | struct skin* sup2grid2 = getscreennode(inputhelp, "sup2grid2"); |
---|
15 | |
---|
16 | struct skin* sup3grid1 = getscreennode(inputhelp, "sup3grid1"); |
---|
17 | struct skin* sup3grid2 = getscreennode(inputhelp, "sup3grid2"); |
---|
18 | |
---|
19 | struct skin* eurogrid1 = getscreennode(inputhelp, "eurogrid1"); |
---|
20 | struct skin* eurogrid2 = getscreennode(inputhelp, "eurogrid2"); |
---|
21 | |
---|
22 | struct skin* microgrid1 = getscreennode(inputhelp, "microgrid1"); |
---|
23 | struct skin* microgrid2 = getscreennode(inputhelp, "microgrid2"); |
---|
24 | |
---|
25 | struct skin* deggrid1 = getscreennode(inputhelp, "deggrid1"); |
---|
26 | struct skin* deggrid2 = getscreennode(inputhelp, "deggrid2"); |
---|
27 | |
---|
28 | struct skin* acutegrid1 = getscreennode(inputhelp, "acutegrid1"); |
---|
29 | struct skin* acutegrid2 = getscreennode(inputhelp, "acutegrid2"); |
---|
30 | |
---|
31 | struct skin* quotegrid1 = getscreennode(inputhelp, "quotegrid1"); |
---|
32 | struct skin* quotegrid2 = getscreennode(inputhelp, "quotegrid2"); |
---|
33 | |
---|
34 | struct skin* sectiongrid1 = getscreennode(inputhelp, "sectiongrid1"); |
---|
35 | struct skin* sectiongrid2 = getscreennode(inputhelp, "sectiongrid2"); |
---|
36 | |
---|
37 | struct skin* backslashgrid1 = getscreennode(inputhelp, "backslashgrid1"); |
---|
38 | struct skin* backslashgrid2 = getscreennode(inputhelp, "backslashgrid2"); |
---|
39 | |
---|
40 | struct skin* szliggrid1 = getscreennode(inputhelp, "szliggrid1"); |
---|
41 | struct skin* szliggrid2 = getscreennode(inputhelp, "szliggrid2"); |
---|
42 | |
---|
43 | changetext(sup2grid1, "²"); |
---|
44 | changetext(sup2grid2, "²"); |
---|
45 | |
---|
46 | changetext(sup3grid1, "³"); |
---|
47 | changetext(sup3grid2, "³"); |
---|
48 | |
---|
49 | changetext(eurogrid1, "€"); |
---|
50 | changetext(eurogrid2, "€"); |
---|
51 | |
---|
52 | changetext(microgrid1, "µ"); |
---|
53 | changetext(microgrid2, "µ"); |
---|
54 | |
---|
55 | changetext(deggrid1, "°"); |
---|
56 | changetext(deggrid2, "°"); |
---|
57 | |
---|
58 | changetext(acutegrid1, "´"); |
---|
59 | changetext(acutegrid2, "´"); |
---|
60 | |
---|
61 | changetext(quotegrid1, "\""); |
---|
62 | changetext(quotegrid2, "\""); |
---|
63 | |
---|
64 | changetext(sectiongrid1, "§"); |
---|
65 | changetext(sectiongrid2, "§"); |
---|
66 | |
---|
67 | changetext(backslashgrid1, "\\"); |
---|
68 | changetext(backslashgrid2, "\\"); |
---|
69 | |
---|
70 | changetext(szliggrid1, "ß"); |
---|
71 | changetext(szliggrid2, "ß"); |
---|
72 | |
---|
73 | drawscreen(inputhelp, 0, flag); |
---|
74 | } |
---|
75 | |
---|
76 | char* screeninputhelp(char* text, int screencalc, int filelistview, int flag) |
---|
77 | { |
---|
78 | int rcret = 0; |
---|
79 | struct skin* inputhelp = getscreen("inputhelp"); |
---|
80 | struct skin* grid = NULL; |
---|
81 | struct skin* grid1 = getscreennode(inputhelp, "grid1"); |
---|
82 | struct skin* grid2 = getscreennode(inputhelp, "grid2"); |
---|
83 | struct skin* inputbox = getscreennode(inputhelp, "inputbox"); |
---|
84 | |
---|
85 | char* tmpstr = NULL; |
---|
86 | |
---|
87 | grid1->hidden = NO; |
---|
88 | grid2->hidden = YES; |
---|
89 | grid = grid1; |
---|
90 | if(text != NULL && strlen(text) > 0) |
---|
91 | { |
---|
92 | inputbox->aktpage = strlen(text); |
---|
93 | } |
---|
94 | changeinput(inputbox, text); |
---|
95 | drawscreen(inputhelp, 0, flag); |
---|
96 | addscreenrc(inputhelp, grid); |
---|
97 | |
---|
98 | //translateinputhelp(inputhelp, flag); |
---|
99 | |
---|
100 | while(1) |
---|
101 | { |
---|
102 | rcret = waitrc(inputhelp, 0, 0); |
---|
103 | |
---|
104 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
105 | { |
---|
106 | tmpstr = ostrcat(tmpstr, text, 1, 0); |
---|
107 | break; |
---|
108 | } |
---|
109 | if(rcret == getrcconfigint("rcff", NULL)) |
---|
110 | inputboxright(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
111 | if(rcret == getrcconfigint("rcfr", NULL)) |
---|
112 | inputboxleft(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
113 | if(rcret == getrcconfigint("rc0", NULL)) |
---|
114 | inputhelpnum(inputhelp, inputbox, '0', screencalc, filelistview, flag); |
---|
115 | if(rcret == getrcconfigint("rc1", NULL)) |
---|
116 | inputhelpnum(inputhelp, inputbox, '1', screencalc, filelistview, flag); |
---|
117 | if(rcret == getrcconfigint("rc2", NULL)) |
---|
118 | inputhelpnum(inputhelp, inputbox, '2', screencalc, filelistview, flag); |
---|
119 | if(rcret == getrcconfigint("rc3", NULL)) |
---|
120 | inputhelpnum(inputhelp, inputbox, '3', screencalc, filelistview, flag); |
---|
121 | if(rcret == getrcconfigint("rc4", NULL)) |
---|
122 | inputhelpnum(inputhelp, inputbox, '4', screencalc, filelistview, flag); |
---|
123 | if(rcret == getrcconfigint("rc5", NULL)) |
---|
124 | inputhelpnum(inputhelp, inputbox, '5', screencalc, filelistview, flag); |
---|
125 | if(rcret == getrcconfigint("rc6", NULL)) |
---|
126 | inputhelpnum(inputhelp, inputbox, '6', screencalc, filelistview, flag); |
---|
127 | if(rcret == getrcconfigint("rc7", NULL)) |
---|
128 | inputhelpnum(inputhelp, inputbox, '7', screencalc, filelistview, flag); |
---|
129 | if(rcret == getrcconfigint("rc8", NULL)) |
---|
130 | inputhelpnum(inputhelp, inputbox, '8', screencalc, filelistview, flag); |
---|
131 | if(rcret == getrcconfigint("rc9", NULL)) |
---|
132 | inputhelpnum(inputhelp, inputbox, '9', screencalc, filelistview, flag); |
---|
133 | |
---|
134 | if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rcred", NULL) || rcret == getrcconfigint("rcgreen", NULL) || rcret == getrcconfigint("rcyellow", NULL) || rcret == getrcconfigint("rcblue", NULL)) |
---|
135 | { |
---|
136 | if(grid->select != NULL && grid->select->name != NULL) |
---|
137 | { |
---|
138 | if(rcret == getrcconfigint("rcgreen", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "ok") == 0)) |
---|
139 | { |
---|
140 | tmpstr = ostrcat(tmpstr, inputbox->input, 1, 0); |
---|
141 | break; |
---|
142 | } |
---|
143 | if(rcret == getrcconfigint("rcred", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "bs") == 0)) |
---|
144 | { |
---|
145 | inputboxfr(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
146 | continue; |
---|
147 | } |
---|
148 | if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "clear") == 0) |
---|
149 | { |
---|
150 | changeinput(inputbox, NULL); |
---|
151 | drawscreen(inputhelp, 0, flag); |
---|
152 | continue; |
---|
153 | } |
---|
154 | if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "left") == 0) |
---|
155 | { |
---|
156 | inputboxleft(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
157 | drawscreen(inputhelp, 0, flag); |
---|
158 | continue; |
---|
159 | } |
---|
160 | if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "right") == 0) |
---|
161 | { |
---|
162 | inputboxright(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
163 | drawscreen(inputhelp, 0, flag); |
---|
164 | continue; |
---|
165 | } |
---|
166 | if(rcret == getrcconfigint("rcblue", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "switch") == 0)) |
---|
167 | { |
---|
168 | if(grid1->hidden == YES) |
---|
169 | { |
---|
170 | delownerrc(inputhelp); |
---|
171 | grid = grid1; |
---|
172 | grid1->hidden = NO; |
---|
173 | grid2->hidden = YES; |
---|
174 | addscreenrc(inputhelp, grid); |
---|
175 | } |
---|
176 | else |
---|
177 | { |
---|
178 | delownerrc(inputhelp); |
---|
179 | grid = grid2; |
---|
180 | grid1->hidden = YES; |
---|
181 | grid2->hidden = NO; |
---|
182 | addscreenrc(inputhelp, grid); |
---|
183 | } |
---|
184 | drawscreen(inputhelp, 0, flag); |
---|
185 | //translateinputhelp(inputhelp, flag); |
---|
186 | continue; |
---|
187 | } |
---|
188 | if(rcret == getrcconfigint("rcyellow", NULL)) |
---|
189 | { |
---|
190 | inputboxff(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
191 | inputboxchar(inputhelp, inputbox, ' ', screencalc, filelistview, flag); |
---|
192 | drawscreen(inputhelp, 0, flag); |
---|
193 | continue; |
---|
194 | } |
---|
195 | |
---|
196 | inputboxff(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
197 | inputboxchar(inputhelp, inputbox, grid->select->name[0], screencalc, filelistview, flag); |
---|
198 | } |
---|
199 | } |
---|
200 | } |
---|
201 | |
---|
202 | delownerrc(inputhelp); |
---|
203 | clearscreen(inputhelp); |
---|
204 | if(filelistview != 1000) |
---|
205 | drawscreen(skin, 0, flag); |
---|
206 | return tmpstr; |
---|
207 | } |
---|
208 | |
---|
209 | #endif |
---|