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 | char* screeninputhelp(char* text, int screencalc, int filelistview, int flag) |
---|
12 | { |
---|
13 | int rcret = 0; |
---|
14 | struct skin* inputhelp = getscreen("inputhelp"); |
---|
15 | struct skin* grid = NULL; |
---|
16 | struct skin* grid1 = getscreennode(inputhelp, "grid1"); |
---|
17 | struct skin* grid2 = getscreennode(inputhelp, "grid2"); |
---|
18 | struct skin* inputbox = getscreennode(inputhelp, "inputbox"); |
---|
19 | char* tmpstr = NULL; |
---|
20 | |
---|
21 | grid1->hidden = NO; |
---|
22 | grid2->hidden = YES; |
---|
23 | grid = grid1; |
---|
24 | if(text != NULL && strlen(text) > 0) |
---|
25 | { |
---|
26 | inputbox->aktpage = strlen(text); |
---|
27 | } |
---|
28 | changeinput(inputbox, text); |
---|
29 | drawscreen(inputhelp, 0, flag); |
---|
30 | addscreenrc(inputhelp, grid); |
---|
31 | |
---|
32 | while(1) |
---|
33 | { |
---|
34 | rcret = waitrc(inputhelp, 0, 0); |
---|
35 | |
---|
36 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
37 | { |
---|
38 | tmpstr = ostrcat(tmpstr, text, 1, 0); |
---|
39 | break; |
---|
40 | } |
---|
41 | if(rcret == getrcconfigint("rcff", NULL)) |
---|
42 | inputboxright(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
43 | if(rcret == getrcconfigint("rcfr", NULL)) |
---|
44 | inputboxleft(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
45 | if(rcret == getrcconfigint("rc0", NULL)) |
---|
46 | inputhelpnum(inputhelp, inputbox, '0', screencalc, filelistview, flag); |
---|
47 | if(rcret == getrcconfigint("rc1", NULL)) |
---|
48 | inputhelpnum(inputhelp, inputbox, '1', screencalc, filelistview, flag); |
---|
49 | if(rcret == getrcconfigint("rc2", NULL)) |
---|
50 | inputhelpnum(inputhelp, inputbox, '2', screencalc, filelistview, flag); |
---|
51 | if(rcret == getrcconfigint("rc3", NULL)) |
---|
52 | inputhelpnum(inputhelp, inputbox, '3', screencalc, filelistview, flag); |
---|
53 | if(rcret == getrcconfigint("rc4", NULL)) |
---|
54 | inputhelpnum(inputhelp, inputbox, '4', screencalc, filelistview, flag); |
---|
55 | if(rcret == getrcconfigint("rc5", NULL)) |
---|
56 | inputhelpnum(inputhelp, inputbox, '5', screencalc, filelistview, flag); |
---|
57 | if(rcret == getrcconfigint("rc6", NULL)) |
---|
58 | inputhelpnum(inputhelp, inputbox, '6', screencalc, filelistview, flag); |
---|
59 | if(rcret == getrcconfigint("rc7", NULL)) |
---|
60 | inputhelpnum(inputhelp, inputbox, '7', screencalc, filelistview, flag); |
---|
61 | if(rcret == getrcconfigint("rc8", NULL)) |
---|
62 | inputhelpnum(inputhelp, inputbox, '8', screencalc, filelistview, flag); |
---|
63 | if(rcret == getrcconfigint("rc9", NULL)) |
---|
64 | inputhelpnum(inputhelp, inputbox, '9', screencalc, filelistview, flag); |
---|
65 | |
---|
66 | if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rcred", NULL) || rcret == getrcconfigint("rcgreen", NULL) || rcret == getrcconfigint("rcyellow", NULL) || rcret == getrcconfigint("rcblue", NULL)) |
---|
67 | { |
---|
68 | if(grid->select != NULL && grid->select->name != NULL) |
---|
69 | { |
---|
70 | if(rcret == getrcconfigint("rcgreen", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "ok") == 0)) |
---|
71 | { |
---|
72 | tmpstr = ostrcat(tmpstr, inputbox->input, 1, 0); |
---|
73 | break; |
---|
74 | } |
---|
75 | if(rcret == getrcconfigint("rcred", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "bs") == 0)) |
---|
76 | { |
---|
77 | inputboxfr(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
78 | continue; |
---|
79 | } |
---|
80 | if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "clear") == 0) |
---|
81 | { |
---|
82 | changeinput(inputbox, NULL); |
---|
83 | drawscreen(inputhelp, 0, flag); |
---|
84 | continue; |
---|
85 | } |
---|
86 | if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "left") == 0) |
---|
87 | { |
---|
88 | inputboxleft(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
89 | drawscreen(inputhelp, 0, flag); |
---|
90 | continue; |
---|
91 | } |
---|
92 | if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "right") == 0) |
---|
93 | { |
---|
94 | inputboxright(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
95 | drawscreen(inputhelp, 0, flag); |
---|
96 | continue; |
---|
97 | } |
---|
98 | if(rcret == getrcconfigint("rcblue", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "switch") == 0)) |
---|
99 | { |
---|
100 | if(grid1->hidden == YES) |
---|
101 | { |
---|
102 | delownerrc(inputhelp); |
---|
103 | grid = grid1; |
---|
104 | grid1->hidden = NO; |
---|
105 | grid2->hidden = YES; |
---|
106 | addscreenrc(inputhelp, grid); |
---|
107 | } |
---|
108 | else |
---|
109 | { |
---|
110 | delownerrc(inputhelp); |
---|
111 | grid = grid2; |
---|
112 | grid1->hidden = YES; |
---|
113 | grid2->hidden = NO; |
---|
114 | addscreenrc(inputhelp, grid); |
---|
115 | } |
---|
116 | drawscreen(inputhelp, 0, flag); |
---|
117 | continue; |
---|
118 | } |
---|
119 | if(rcret == getrcconfigint("rcyellow", NULL)) |
---|
120 | { |
---|
121 | inputboxff(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
122 | inputboxchar(inputhelp, inputbox, ' ', screencalc, filelistview, flag); |
---|
123 | drawscreen(inputhelp, 0, flag); |
---|
124 | continue; |
---|
125 | } |
---|
126 | |
---|
127 | inputboxff(inputhelp, inputbox, screencalc, filelistview, flag); |
---|
128 | inputboxchar(inputhelp, inputbox, grid->select->name[0], screencalc, filelistview, flag); |
---|
129 | } |
---|
130 | } |
---|
131 | } |
---|
132 | |
---|
133 | delownerrc(inputhelp); |
---|
134 | clearscreen(inputhelp); |
---|
135 | if(filelistview != 1000) |
---|
136 | drawscreen(skin, 0, flag); |
---|
137 | return tmpstr; |
---|
138 | } |
---|
139 | |
---|
140 | #endif |
---|