source: titan/titan/rcfunc.h @ 14751

Last change on this file since 14751 was 14751, checked in by nit, 12 years ago

[titan] add flag to createfilelist

File size: 29.0 KB
Line 
1#ifndef RCFUNC_H
2#define RCFUNC_H
3
4void progressbarright(struct skin* screen, struct skin* progressbar, int flag)
5{
6        debug(1000, "in");
7
8        if(progressbar != NULL)
9        {
10                if(progressbar->progresssize <= 100)
11                {
12                        progressbar->progresssize++;
13                        drawscreen(screen, flag);
14                }
15                else
16                        progressbar->progresssize = 100;
17        }
18
19        debug(1000, "out");
20}
21
22void progressbarleft(struct skin* screen, struct skin* progressbar, int flag)
23{
24        debug(1000, "in");
25
26        if(progressbar != NULL)
27        {
28                if(progressbar->progresssize > 0)
29                {
30                        progressbar->progresssize--;
31                        drawscreen(screen, flag);
32                }
33                else
34                        progressbar->progresssize = 0;
35        }
36
37        debug(1000, "out");
38}
39
40void filelistok(struct skin* screen, struct skin* filelist, int flag)
41{
42        debug(1000, "in");
43        struct skin* path = NULL;
44        char* tmp = NULL, *lastdir = NULL, *plastdir = NULL;
45        int inplen = 0;
46
47        if(filelist != NULL)
48        {
49                if(filelist->select != NULL && filelist->select->input != NULL)
50                {
51                        inplen = strlen(filelist->select->input);
52                        if(inplen >= 3 && filelist->select->input[inplen - 1] == '.' && filelist->select->input[inplen - 2] == '.' && filelist->select->input[inplen - 3] == '/')
53                        {
54                                lastdir = ostrcat(lastdir, filelist->select->input, 1, 0);
55                                lastdir[inplen - 3] = '\0';
56                                plastdir = strrchr(lastdir, '/');
57                                if(plastdir == NULL)
58                                        plastdir = lastdir;
59                                else
60                                        plastdir++;
61                        }
62
63                        filelist->aktline = 0;
64                        filelist->aktpage = 0;
65                        tmp = createpath(filelist->select->input, "");
66                        changeinput(filelist, tmp);
67                        free(tmp); tmp = NULL;
68
69                        tmp = malloc(strlen(filelist->name) + 5);
70                        if(tmp != NULL)
71                        {
72                                sprintf(tmp, "%s%s", filelist->name, "path");
73                                path = getscreennode(screen, tmp);
74                                free(tmp);
75                                if(path != status.skinerr)
76                                        changetext(path, filelist->input);
77                                delmarkedscreennodes(screen, FILELISTDELMARK);
78                                createfilelist(screen, filelist, 0);
79                                setlistboxselection(filelist, plastdir);
80                                free(lastdir); lastdir = NULL;
81                                drawscreen(screen, flag);
82                        }
83                        else
84                                err("no memory");
85                }
86        }
87        debug(1000, "out");
88}
89
90void helpbox(struct skin* screen, struct skin* node, int flag)
91{
92        if(node != NULL && flag == 0)
93        {
94                screenhelp(screen);
95                drawscreen(screen, flag);
96        }
97}
98
99void inputboxhelp(struct skin* screen, struct skin* inputbox, int flag)
100{
101        char* tmpstr = NULL;
102
103        if(inputbox != NULL && (inputbox->type & INPUTBOX) && flag == 0)
104        {
105                tmpstr = screeninputhelp(inputbox->input, flag);
106                changeinput(inputbox, tmpstr);
107                free(tmpstr); tmpstr = NULL;
108                drawscreen(screen, flag);
109        }
110}
111
112void inputboxchar(struct skin* screen, struct skin* inputbox, char zeichen, int flag)
113{
114        debug(1000, "in");
115        if(inputbox != NULL && inputbox->input != NULL)
116        {
117                if(strlen(inputbox->input) > 0)
118                {
119                        inputbox->input[inputbox->aktpage - 1] = zeichen;
120                        if(flag != 1)
121                                drawscreen(screen, flag);
122                }
123        }
124        debug(1000, "out");
125}
126
127void inputboxff(struct skin* screen, struct skin* inputbox, int flag)
128{
129        debug(1000, "in");
130        if(inputbox != NULL)
131        {
132                if(inputbox->input == NULL)
133                        changeinput(inputbox, "");
134                inputbox->aktpage = insertchar(&inputbox->input, '_', inputbox->aktpage);
135                drawscreen(screen, flag);
136        }
137        debug(1000, "out");
138}
139
140void inputboxfr(struct skin* screen, struct skin* inputbox, int flag)
141{
142        debug(1000, "in");
143        if(inputbox != NULL && inputbox->input != NULL)
144        {
145                inputbox->aktpage = delchar(&inputbox->input, inputbox->aktpage);
146                drawscreen(screen, flag);
147        }
148        debug(1000, "out");
149}
150
151void checkinputboxnumright(struct skin* inputbox)
152{
153        debug(1000, "in");
154        int count = 0;
155
156        if(inputbox != NULL && inputbox->input != NULL && (inputbox->type & INPUTBOXNUM))
157        {
158                while(isdigit(inputbox->input[inputbox->aktpage - 1]) == 0)
159                {
160                        inputbox->aktpage++;
161                        if(inputbox->input[inputbox->aktpage - 1] == '\0')
162                        {
163                                count++;
164                                inputbox->aktpage = 0;
165                        }
166                        if(count > 1)
167                        {
168                                inputbox->aktpage = strlen(inputbox->input) + 1;
169                                break;
170                        }
171                }
172        }
173        debug(1000, "out");
174}
175
176void checkinputboxnumleft(struct skin* inputbox)
177{
178        debug(1000, "in");
179        int count = 0;
180
181        if(inputbox != NULL && inputbox->input != NULL && (inputbox->type & INPUTBOXNUM))
182        {
183                while(isdigit(inputbox->input[inputbox->aktpage - 1]) == 0)
184                {
185                        inputbox->aktpage--;
186                        if(inputbox->aktpage < 0)
187                        {
188                                count++;
189                                inputbox->aktpage = strlen(inputbox->input);
190                        }
191                        if(count > 1)
192                        {
193                                inputbox->aktpage = strlen(inputbox->input) + 1;
194                                break;
195                        }
196                }
197        }
198        debug(1000, "out");
199}
200
201void inputboxright(struct skin* screen, struct skin* inputbox, int flag)
202{
203        debug(1000, "in");
204
205        if(inputbox != NULL && inputbox->input != NULL)
206        {
207                inputbox->aktpage++;
208                if(inputbox->aktpage >= strlen(inputbox->input) + 1) inputbox->aktpage = 1;
209
210                checkinputboxnumright(inputbox);
211                drawscreen(screen, flag);
212        }
213        debug(1000, "out");
214}
215
216void inputboxleft(struct skin* screen, struct skin* inputbox, int flag)
217{
218        debug(1000, "in");
219
220        if(inputbox != NULL && inputbox->input != NULL)
221        {
222                inputbox->aktpage--;
223                if(inputbox->aktpage < 1) inputbox->aktpage = strlen(inputbox->input);
224
225                checkinputboxnumleft(inputbox);
226                drawscreen(screen, flag);
227        }
228        debug(1000, "out");
229}
230
231void inputbox0(struct skin* screen, struct skin* inputbox, int flag)
232{
233        if(inputbox != NULL && inputbox->input != NULL)
234        {
235                int aktpage = inputbox->aktpage - 1;
236
237                if(inputbox->type & INPUTBOX)
238                {
239                        if(inputbox->input[aktpage] == '0')
240                                inputboxchar(screen, inputbox, ' ', flag);
241                        else if(inputbox->input[aktpage] == ' ')
242                                inputboxchar(screen, inputbox, '#', flag);
243                        else if(inputbox->input[aktpage] == '#')
244                                inputboxchar(screen, inputbox, '*', flag);
245                        else if(inputbox->input[aktpage] == '*')
246                                inputboxchar(screen, inputbox, '_', flag);
247                        else
248                                inputboxchar(screen, inputbox, '0', flag);
249                }
250                else
251                {
252                        inputboxchar(screen, inputbox, '0', 1);
253                        inputboxright(screen, inputbox, flag);
254                }
255        }
256}
257
258void inputbox1(struct skin* screen, struct skin* inputbox, int flag)
259{
260        if(inputbox != NULL && inputbox->input != NULL)
261        {
262                int aktpage = inputbox->aktpage - 1;
263
264                if(inputbox->type & INPUTBOX)
265                {
266                        if(inputbox->input[aktpage] == '1')
267                                inputboxchar(screen, inputbox, '.', flag);
268                        else if(inputbox->input[aktpage] == '.')
269                                inputboxchar(screen, inputbox, ',', flag);
270                        else if(inputbox->input[aktpage] == ',')
271                                inputboxchar(screen, inputbox, '?', flag);
272                        else if(inputbox->input[aktpage] == '?')
273                                inputboxchar(screen, inputbox, '!', flag);
274                        else if(inputbox->input[aktpage] == '!')
275                                inputboxchar(screen, inputbox, '\'', flag);
276                        else if(inputbox->input[aktpage] == '\'')
277                                inputboxchar(screen, inputbox, '-', flag);
278                        else if(inputbox->input[aktpage] == '-')
279                                inputboxchar(screen, inputbox, '(', flag);
280                        else if(inputbox->input[aktpage] == '(')
281                                inputboxchar(screen, inputbox, ')', flag);
282                        else if(inputbox->input[aktpage] == ')')
283                                inputboxchar(screen, inputbox, '@', flag);
284                        else if(inputbox->input[aktpage] == '@')
285                                inputboxchar(screen, inputbox, '/', flag);
286                        else if(inputbox->input[aktpage] == '/')
287                                inputboxchar(screen, inputbox, ':', flag);
288                        else
289                                inputboxchar(screen, inputbox, '1', flag);
290                }
291                else
292                {
293                        inputboxchar(screen, inputbox, '1', 1);
294                        inputboxright(screen, inputbox, flag);
295                }
296        }
297}
298
299void inputbox2(struct skin* screen, struct skin* inputbox, int flag)
300{
301        if(inputbox != NULL && inputbox->input != NULL)
302        {
303                int aktpage = inputbox->aktpage - 1;
304
305                if(inputbox->type & INPUTBOX)
306                {
307                        if(inputbox->input[aktpage] == '2')
308                                inputboxchar(screen, inputbox, 'a', flag);
309                        else if(inputbox->input[aktpage] == 'a')
310                                inputboxchar(screen, inputbox, 'b', flag);
311                        else if(inputbox->input[aktpage] == 'b')
312                                inputboxchar(screen, inputbox, 'c', flag);
313                        else if(inputbox->input[aktpage] == 'c')
314                                inputboxchar(screen, inputbox, 'A', flag);
315                        else if(inputbox->input[aktpage] == 'A')
316                                inputboxchar(screen, inputbox, 'B', flag);
317                        else if(inputbox->input[aktpage] == 'B')
318                                inputboxchar(screen, inputbox, 'C', flag);
319                        else
320                                inputboxchar(screen, inputbox, '2', flag);
321                }
322                else
323                {
324                        inputboxchar(screen, inputbox, '2', 1);
325                        inputboxright(screen, inputbox, flag);
326                }
327        }
328}
329
330void inputbox3(struct skin* screen, struct skin* inputbox, int flag)
331{
332        if(inputbox != NULL && inputbox->input != NULL)
333        {
334                int aktpage = inputbox->aktpage - 1;
335
336                if(inputbox->type & INPUTBOX)
337                {
338                        if(inputbox->input[aktpage] == '3')
339                                inputboxchar(screen, inputbox, 'd', flag);
340                        else if(inputbox->input[aktpage] == 'd')
341                                inputboxchar(screen, inputbox, 'e', flag);
342                        else if(inputbox->input[aktpage] == 'e')
343                                inputboxchar(screen, inputbox, 'f', flag);
344                        else if(inputbox->input[aktpage] == 'f')
345                                inputboxchar(screen, inputbox, 'D', flag);
346                        else if(inputbox->input[aktpage] == 'D')
347                                inputboxchar(screen, inputbox, 'E', flag);
348                        else if(inputbox->input[aktpage] == 'E')
349                                inputboxchar(screen, inputbox, 'F', flag);
350                        else
351                                inputboxchar(screen, inputbox, '3', flag);
352                }
353                else
354                {
355                        inputboxchar(screen, inputbox, '3', 1);
356                        inputboxright(screen, inputbox, flag);
357                }
358        }
359}
360
361void inputbox4(struct skin* screen, struct skin* inputbox, int flag)
362{
363        if(inputbox != NULL && inputbox->input != NULL)
364        {
365                int aktpage = inputbox->aktpage - 1;
366
367                if(inputbox->type & INPUTBOX)
368                {
369                        if(inputbox->input[aktpage] == '4')
370                                inputboxchar(screen, inputbox, 'g', flag);
371                        else if(inputbox->input[aktpage] == 'g')
372                                inputboxchar(screen, inputbox, 'h', flag);
373                        else if(inputbox->input[aktpage] == 'h')
374                                inputboxchar(screen, inputbox, 'i', flag);
375                        else if(inputbox->input[aktpage] == 'i')
376                                inputboxchar(screen, inputbox, 'G', flag);
377                        else if(inputbox->input[aktpage] == 'G')
378                                inputboxchar(screen, inputbox, 'H', flag);
379                        else if(inputbox->input[aktpage] == 'H')
380                                inputboxchar(screen, inputbox, 'I', flag);
381                        else
382                                inputboxchar(screen, inputbox, '4', flag);
383                }
384                else
385                {
386                        inputboxchar(screen, inputbox, '4', 1);
387                        inputboxright(screen, inputbox, flag);
388                }
389        }
390}
391
392void inputbox5(struct skin* screen, struct skin* inputbox, int flag)
393{
394        if(inputbox != NULL && inputbox->input != NULL)
395        {
396                int aktpage = inputbox->aktpage - 1;
397
398                if(inputbox->type & INPUTBOX)
399                {
400                        if(inputbox->input[aktpage] == '5')
401                                inputboxchar(screen, inputbox, 'j', flag);
402                        else if(inputbox->input[aktpage] == 'j')
403                                inputboxchar(screen, inputbox, 'k', flag);
404                        else if(inputbox->input[aktpage] == 'k')
405                                inputboxchar(screen, inputbox, 'l', flag);
406                        else if(inputbox->input[aktpage] == 'l')
407                                inputboxchar(screen, inputbox, 'J', flag);
408                        else if(inputbox->input[aktpage] == 'J')
409                                inputboxchar(screen, inputbox, 'K', flag);
410                        else if(inputbox->input[aktpage] == 'K')
411                                inputboxchar(screen, inputbox, 'L', flag);
412                        else
413                                inputboxchar(screen, inputbox, '5', flag);
414                }
415                else
416                {
417                        inputboxchar(screen, inputbox, '5', 1);
418                        inputboxright(screen, inputbox, flag);
419                }
420
421        }
422}
423
424void inputbox6(struct skin* screen, struct skin* inputbox, int flag)
425{
426        if(inputbox != NULL && inputbox->input != NULL)
427        {
428                int aktpage = inputbox->aktpage - 1;
429
430                if(inputbox->type & INPUTBOX)
431                {
432                        if(inputbox->input[aktpage] == '6')
433                                inputboxchar(screen, inputbox, 'm', flag);
434                        else if(inputbox->input[aktpage] == 'm')
435                                inputboxchar(screen, inputbox, 'n', flag);
436                        else if(inputbox->input[aktpage] == 'n')
437                                inputboxchar(screen, inputbox, 'o', flag);
438                        else if(inputbox->input[aktpage] == 'o')
439                                inputboxchar(screen, inputbox, 'M', flag);
440                        else if(inputbox->input[aktpage] == 'M')
441                                inputboxchar(screen, inputbox, 'N', flag);
442                        else if(inputbox->input[aktpage] == 'N')
443                                inputboxchar(screen, inputbox, 'O', flag);
444                        else
445                                inputboxchar(screen, inputbox, '6', flag);
446                }
447                else
448                {
449                        inputboxchar(screen, inputbox, '6', 1);
450                        inputboxright(screen, inputbox, flag);
451                }
452        }
453}
454
455void inputbox7(struct skin* screen, struct skin* inputbox, int flag)
456{
457        if(inputbox != NULL && inputbox->input != NULL)
458        {
459                int aktpage = inputbox->aktpage - 1;
460
461                if(inputbox->type & INPUTBOX)
462                {
463                        if(inputbox->input[aktpage] == '7')
464                                inputboxchar(screen, inputbox, 'p', flag);
465                        else if(inputbox->input[aktpage] == 'p')
466                                inputboxchar(screen, inputbox, 'q', flag);
467                        else if(inputbox->input[aktpage] == 'q')
468                                inputboxchar(screen, inputbox, 'r', flag);
469                        else if(inputbox->input[aktpage] == 'r')
470                                inputboxchar(screen, inputbox, 's', flag);
471                        else if(inputbox->input[aktpage] == 's')
472                                inputboxchar(screen, inputbox, 'P', flag);
473                        else if(inputbox->input[aktpage] == 'P')
474                                inputboxchar(screen, inputbox, 'Q', flag);
475                        else if(inputbox->input[aktpage] == 'Q')
476                                inputboxchar(screen, inputbox, 'R', flag);
477                        else if(inputbox->input[aktpage] == 'R')
478                                inputboxchar(screen, inputbox, 'S', flag);
479                        else
480                                inputboxchar(screen, inputbox, '7', flag);
481                }
482                else
483                {
484                        inputboxchar(screen, inputbox, '7', 1);
485                        inputboxright(screen, inputbox, flag);
486                }
487        }
488}
489
490void inputbox8(struct skin* screen, struct skin* inputbox, int flag)
491{
492        if(inputbox != NULL && inputbox->input != NULL)
493        {
494                int aktpage = inputbox->aktpage - 1;
495
496                if(inputbox->type & INPUTBOX)
497                {
498                        if(inputbox->input[aktpage] == '8')
499                                inputboxchar(screen, inputbox, 't', flag);
500                        else if(inputbox->input[aktpage] == 't')
501                                inputboxchar(screen, inputbox, 'u', flag);
502                        else if(inputbox->input[aktpage] == 'u')
503                                inputboxchar(screen, inputbox, 'v', flag);
504                        else if(inputbox->input[aktpage] == 'v')
505                                inputboxchar(screen, inputbox, 'T', flag);
506                        else if(inputbox->input[aktpage] == 'T')
507                                inputboxchar(screen, inputbox, 'U', flag);
508                        else if(inputbox->input[aktpage] == 'U')
509                                inputboxchar(screen, inputbox, 'V', flag);
510                        else
511                                inputboxchar(screen, inputbox, '8', flag);
512                }
513                else
514                {
515                        inputboxchar(screen, inputbox, '8', 1);
516                        inputboxright(screen, inputbox, flag);
517                }
518        }
519}
520
521void inputbox9(struct skin* screen, struct skin* inputbox, int flag)
522{
523        if(inputbox != NULL && inputbox->input != NULL)
524        {
525                int aktpage = inputbox->aktpage - 1;
526
527                if(inputbox->type & INPUTBOX)
528                {
529                        if(inputbox->input[aktpage] == '9')
530                                inputboxchar(screen, inputbox, 'w', flag);
531                        else if(inputbox->input[aktpage] == 'w')
532                                inputboxchar(screen, inputbox, 'x', flag);
533                        else if(inputbox->input[aktpage] == 'x')
534                                inputboxchar(screen, inputbox, 'y', flag);
535                        else if(inputbox->input[aktpage] == 'y')
536                                inputboxchar(screen, inputbox, 'z', flag);
537                        else if(inputbox->input[aktpage] == 'z')
538                                inputboxchar(screen, inputbox, 'W', flag);
539                        else if(inputbox->input[aktpage] == 'W')
540                                inputboxchar(screen, inputbox, 'X', flag);
541                        else if(inputbox->input[aktpage] == 'X')
542                                inputboxchar(screen, inputbox, 'Y', flag);
543                        else if(inputbox->input[aktpage] == 'Y')
544                                inputboxchar(screen, inputbox, 'Z', flag);
545                        else
546                                inputboxchar(screen, inputbox, '9', flag);
547                }
548                else
549                {
550                        inputboxchar(screen, inputbox, '9', 1);
551                        inputboxright(screen, inputbox, flag);
552                }
553        }
554}
555
556void choiceboxleft(struct skin* screen, struct skin* choicebox, int flag)
557{
558        debug(1000, "in");
559        if(choicebox != NULL)
560        {
561                if(choicebox->aktpage <= 1)
562                        choicebox->aktpage = choicebox->linecount;
563                else
564                        choicebox->aktpage--;
565                drawscreen(screen, flag);
566        }
567        debug(1000, "out");
568}
569
570void choiceboxright(struct skin* screen, struct skin* choicebox, int flag)
571{
572        debug(1000, "in");
573        if(choicebox != NULL)
574        {
575                if(choicebox->aktpage >= choicebox->linecount)
576                        choicebox->aktpage = 1;
577                else
578                {
579                        if(choicebox->aktpage < 1) choicebox->aktpage = 1;
580                        choicebox->aktpage++;
581                }
582                drawscreen(screen, flag);
583        }
584        debug(1000, "out");
585}
586
587void griddown(struct skin* screen, struct skin* grid, int flag)
588{
589        debug(1000, "in");
590        int end = 0, br = 0, mark = 0;
591        struct skin* node = NULL;
592
593        if(grid != NULL)
594        {
595                if(grid->select != NULL && grid->gridcol == 0)
596                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
597
598                node = grid->select;
599                while(node != NULL)
600                {
601                        if(node->next == NULL && node != grid->select && ((node->type & GRIDBR))) break;
602                        if(node->next == NULL || node->deaktivcol != -1 || node->hidden == YES || (node->parentpointer != grid && ostrcmp(node->parent, grid->name) != 0))
603                        {
604                                node = node->next;
605                                if(node == NULL && mark == 0)
606                                {
607                                        //go to the first cell
608                                        node = grid->next;
609                                        mark = 1;
610                                        grid->aktline = 1;
611                                }
612                                continue;
613                        }
614
615                        if((node->type & GRIDBR) && node != grid->select) br++;
616                        if(br > 1)
617                        {
618                                grid->aktline--;
619                                break;
620                        }
621
622                        if(br > 0)
623                        {
624                                end = node->posx + node->width;
625                                if(end <= grid->gridcol)
626                                {
627                                        grid->aktline++;
628                                        node = node->next;
629                                        continue;
630                                }
631                                break;
632                        }
633
634                        grid->aktline++;
635                        node = node->next;
636                }
637
638                grid->aktpage = -1;
639                if(grid->aktline > grid->linecount || grid->aktline < 1)
640                        grid->aktline = grid->linecount;
641
642                if(grid->select != NULL) delscreenrc(screen, grid->select);
643                drawscreen(screen, flag);
644        }
645
646        debug(1000, "out");
647}
648
649void gridup(struct skin* screen, struct skin* grid, int flag)
650{
651        debug(1000, "in");
652        int start = 0, br = 0, mark = 0;
653        struct skin* node = NULL, *tmpnode = NULL;;
654
655        if(grid != NULL)
656        {
657                if(grid->select != NULL && grid->gridcol == 0)
658                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
659
660                node = grid->select;
661                while(node != NULL)
662                {
663               
664                        if(node->prev == NULL || node->prev == grid || node->deaktivcol != -1 || node->hidden == YES || (node->prev->parentpointer != grid && ostrcmp(node->prev->parent, grid->name) != 0))
665                        {
666                                if(br > 0 && (node->type & GRIDBR) && !(node->deaktivcol != -1 || node->hidden == YES)) break;
667
668                                node = node->prev;
669                                if(node == grid && mark == 0)
670                                {
671                                        while(node != NULL)
672                                        {
673                                                if(node->parentpointer == grid || ostrcmp(node->parent, grid->name) == 0)
674                                                        tmpnode = node;
675                                                node = node->next;
676                                        }
677                                        if(tmpnode == NULL) break;
678                                        node = tmpnode;
679                                        grid->aktline = grid->linecount;
680                                        if(br == 0) br++;
681                                }
682                                continue;
683                        }
684
685                        if(br > 1)
686                        {
687                                grid->aktline++;
688                                break;
689                        }
690
691                        if(br > 0)
692                        {
693                                start = node->posx;
694                                if(start > grid->gridcol)
695                                {
696                                        grid->aktline--;
697                                        node = node->prev;
698                                        continue;
699                                }
700                                break;
701                        }
702
703                        if(node->type & GRIDBR) br++;
704
705                        grid->aktline--;
706                        node = node->prev;
707                }
708
709                grid->aktpage = -1;
710                if(grid->aktline < 1 || grid->aktline > grid->linecount)
711                        grid->aktline = 1;
712
713                if(grid->select != NULL) delscreenrc(screen, grid->select);
714                drawscreen(screen, flag);
715        }
716
717        debug(1000, "out");
718}
719
720void gridleft(struct skin* screen, struct skin* grid, int flag)
721{
722        debug(1000, "in");
723        struct skin* node = NULL;
724
725        if(grid != NULL)
726        {
727                node = grid->select;
728                if(node != NULL && (node->type & GRIDBR))
729                {
730                        grid->aktpage = -1;
731                        while(node != NULL)
732                        {
733                                if(node->parentpointer == grid || ostrcmp(node->parent, grid->name) == 0)
734                                {
735                                        if(node->next == NULL || (node->next->type & GRIDBR))
736                                                break;
737                                        else
738                                                grid->aktline++;
739                                }
740                                node = node->next;
741                        }
742                }
743                else
744                {
745                        grid->aktpage = -1;
746                        grid->aktline--;
747                        if(grid->aktline < 1) grid->aktline = 1;
748                }
749
750                if(grid->select != NULL) delscreenrc(screen, grid->select);
751                drawscreen(screen, flag);
752                if(grid->select != NULL)
753                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
754        }
755        debug(1000, "out");
756}
757
758void gridright(struct skin* screen, struct skin* grid, int flag)
759{
760        debug(1000, "in");
761        struct skin* node = NULL;
762
763        if(grid != NULL)
764        {
765                node = grid->select;
766                if((node != NULL && node->next != NULL && (node->next->type & GRIDBR)) || grid->aktline == grid->linecount)
767                {
768                        grid->aktpage = -1;
769                        while(node != NULL)
770                        {
771                                if(node->parentpointer == grid || ostrcmp(node->parent, grid->name) == 0)
772                                {
773                                        if(node == NULL || (node->type & GRIDBR))
774                                                break;
775                                        else
776                                                grid->aktline--;
777                                }
778                                node = node->prev;
779                        }
780                }
781                else
782                {
783                        grid->aktpage = -1;
784                        if(grid->aktline <= grid->linecount)
785                                grid->aktline++;
786                        if(grid->aktline > grid->linecount)
787                                grid->aktline = grid->linecount;
788                }
789
790                if(grid->select != NULL) delscreenrc(screen, grid->select);
791                drawscreen(screen, flag);
792                if(grid->select != NULL)
793                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
794        }
795        debug(1000, "out");
796}
797
798void gridchup(struct skin* screen, struct skin* grid, int flag)
799{
800        debug(1000, "in");
801
802        if(grid != NULL)
803        {
804                grid->aktline = -1;
805                grid->aktpage--;
806                if(grid->aktpage < 1)
807                        grid->aktpage = 1;
808
809                drawscreen(screen, flag);
810                if(grid->select != NULL)
811                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
812        }
813
814        debug(1000, "out");
815}
816
817void gridchdown(struct skin* screen, struct skin* grid, int flag)
818{
819        debug(1000, "in");
820
821        if(grid != NULL)
822        {
823                grid->aktline = -1;
824                grid->aktpage++;
825                if(grid->aktpage > grid->pagecount)
826                {
827                        grid->aktpage = grid->pagecount;
828                        grid->aktline = -2;
829                }
830
831                drawscreen(screen, flag);
832                if(grid->select != NULL)
833                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
834        }
835
836        debug(1000, "out");
837}
838
839
840void listboxleft(struct skin* screen, struct skin* listbox, int flag)
841{
842        debug(1000, "in");
843
844        if(listbox != NULL)
845        {
846                listbox->aktline = -1;
847                listbox->aktpage--;
848                if(listbox->aktpage < 1)
849                        listbox->aktpage = 1;
850
851                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
852                drawscreen(screen, flag);
853        }
854
855        debug(1000, "out");
856}
857
858void listboxright(struct skin* screen, struct skin* listbox, int flag)
859{
860        debug(1000, "in");
861
862        if(listbox != NULL)
863        {
864                listbox->aktline = -1;
865                listbox->aktpage++;
866                if(listbox->aktpage > listbox->pagecount)
867                {
868                        listbox->aktpage = listbox->pagecount;
869                        listbox->aktline = -2;
870                }
871
872                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
873                drawscreen(screen, flag);
874        }
875
876        debug(1000, "out");
877}
878
879void listboxup(struct skin* screen, struct skin* listbox, int flag)
880{
881        debug(1000, "in");
882
883        if(listbox != NULL)
884        {
885                listbox->aktpage = -1;
886                listbox->aktline--;
887                if(listbox->aktline < 1)
888                        listbox->aktline = listbox->linecount;
889
890                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
891                drawscreen(screen, flag);
892        }
893        debug(1000, "out");
894}
895
896void listboxdown(struct skin* screen, struct skin* listbox, int flag)
897{
898        debug(1000, "in");
899
900        if(listbox != NULL)
901        {
902                listbox->aktpage = -1;
903                if(listbox->aktline <= listbox->linecount)
904                        listbox->aktline++;
905                if(listbox->aktline > listbox->linecount)
906                        listbox->aktline = 1;
907
908                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
909                drawscreen(screen, flag);
910        }
911        debug(1000, "out");
912}
913
914void textboxup(struct skin* screen, struct skin* textbox, int flag)
915{
916        debug(1000, "in");
917        if(textbox != NULL)
918        {
919                if(textbox->aktpage > 1)
920                {
921                        textbox->aktpage--;
922                        drawscreen(screen, flag);
923                }
924        }
925        debug(1000, "out");
926}
927
928void textboxdown(struct skin* screen, struct skin* textbox, int flag)
929{
930        debug(1000, "in");
931        if(textbox != NULL)
932        {
933                if(textbox->aktpage < textbox->pagecount)
934                {
935                        textbox->aktpage++;
936                        drawscreen(screen, flag);
937                }
938        }
939        debug(1000, "out");
940}
941
942int addscreenrc(struct skin* screen, struct skin* node)
943{
944        debug(1000, "in");
945
946        if(node == NULL)
947        {
948                debug(1000, "out -> NULL detect");
949                return 1;
950        }
951
952        if(node->type & GRID)
953        {
954                addrc(getrcconfigint("rcright", NULL), gridright, screen, node);
955                addrc(getrcconfigint("rcleft", NULL), gridleft, screen, node);
956                addrc(getrcconfigint("rcup", NULL), gridup, screen, node);
957                addrc(getrcconfigint("rcdown", NULL), griddown, screen, node);
958                addrc(getrcconfigint("rcchup", NULL), gridchup, screen, node);
959                addrc(getrcconfigint("rcchdown", NULL), gridchdown, screen, node);
960                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
961        }
962        else if(node->type & LISTBOX)
963        {
964                addrc(getrcconfigint("rcup", NULL), listboxup, screen, node);
965                addrc(getrcconfigint("rcdown", NULL), listboxdown, screen, node);
966                addrc(getrcconfigint("rcright", NULL), listboxright, screen, node);
967                addrc(getrcconfigint("rcleft", NULL), listboxleft, screen, node);
968                addrc(getrcconfigint("rcchup", NULL), listboxright, screen, node);
969                addrc(getrcconfigint("rcchdown", NULL), listboxleft, screen, node);
970                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
971        }
972        else if(node->type & CHOICEBOX)
973        {
974                addrc(getrcconfigint("rcleft", NULL), choiceboxleft, screen, node);
975                addrc(getrcconfigint("rcright", NULL), choiceboxright, screen, node);
976                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
977        }
978        else if((node->type & INPUTBOX) || (node->type & INPUTBOXNUM))
979        {
980                addrc(getrcconfigint("rc0", NULL), inputbox0, screen, node);
981                addrc(getrcconfigint("rc1", NULL), inputbox1, screen, node);
982                addrc(getrcconfigint("rc2", NULL), inputbox2, screen, node);
983                addrc(getrcconfigint("rc3", NULL), inputbox3, screen, node);
984                addrc(getrcconfigint("rc4", NULL), inputbox4, screen, node);
985                addrc(getrcconfigint("rc5", NULL), inputbox5, screen, node);
986                addrc(getrcconfigint("rc6", NULL), inputbox6, screen, node);
987                addrc(getrcconfigint("rc7", NULL), inputbox7, screen, node);
988                addrc(getrcconfigint("rc8", NULL), inputbox8, screen, node);
989                addrc(getrcconfigint("rc9", NULL), inputbox9, screen, node);
990                addrc(getrcconfigint("rcright", NULL), inputboxright, screen, node);
991                addrc(getrcconfigint("rcleft", NULL), inputboxleft, screen, node);
992                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
993                if(node->type & INPUTBOX) addrc(getrcconfigint("rcff", NULL), inputboxff, screen, node);
994                if(node->type & INPUTBOX) addrc(getrcconfigint("rcfr", NULL), inputboxfr, screen, node);
995                if(node->type & INPUTBOX) addrc(getrcconfigint("rctext", NULL), inputboxhelp, screen, node);
996        }
997        else if(node->type & TEXTBOX)
998        {
999                addrc(getrcconfigint("rcup", NULL), textboxup, screen, node);
1000                addrc(getrcconfigint("rcdown", NULL), textboxdown, screen, node);
1001                addrc(getrcconfigint("rcchup", NULL), textboxup, screen, node);
1002                addrc(getrcconfigint("rcchdown", NULL), textboxdown, screen, node);
1003                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
1004        }
1005        else if(node->type & FILELIST)
1006        {
1007                addrc(getrcconfigint("rcup", NULL), listboxup, screen, node);
1008                addrc(getrcconfigint("rcdown", NULL), listboxdown, screen, node);
1009                addrc(getrcconfigint("rcright", NULL), listboxright, screen, node);
1010                addrc(getrcconfigint("rcleft", NULL), listboxleft, screen, node);
1011                addrc(getrcconfigint("rcok", NULL), filelistok, screen, node);
1012                addrc(getrcconfigint("rcchup", NULL), listboxright, screen, node);
1013                addrc(getrcconfigint("rcchdown", NULL), listboxleft, screen, node);
1014                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
1015        }
1016        else if(node->type & PROGRESSBAR)
1017        {
1018                addrc(getrcconfigint("rcleft", NULL), progressbarleft, screen, node);
1019                addrc(getrcconfigint("rcright", NULL), progressbarright, screen, node);
1020                addrc(getrcconfigint("rchelp", NULL), helpbox, screen, node);
1021        }
1022
1023        debug(1000, "out");
1024        return 0;
1025}
1026
1027int delscreenrc(struct skin* screen, struct skin* node)
1028{
1029        debug(1000, "in");
1030
1031        if(node == NULL)
1032        {
1033                debug(1000, "out -> NULL detect");
1034                return 1;
1035        }
1036
1037        if(node->type & GRID)
1038        {
1039                delrc(getrcconfigint("rcright", NULL), screen, node);
1040                delrc(getrcconfigint("rcleft", NULL), screen, node);
1041                delrc(getrcconfigint("rcup", NULL), screen, node);
1042                delrc(getrcconfigint("rcdown", NULL), screen, node);
1043                delrc(getrcconfigint("rcchup", NULL), screen, node);
1044                delrc(getrcconfigint("rcchdown", NULL), screen, node);
1045                delrc(getrcconfigint("rchelp", NULL), screen, node);
1046        }
1047        if(node->type & LISTBOX)
1048        {
1049                delrc(getrcconfigint("rcup", NULL), screen, node);
1050                delrc(getrcconfigint("rcdown", NULL), screen, node);
1051                delrc(getrcconfigint("rcright", NULL), screen, node);
1052                delrc(getrcconfigint("rcleft", NULL), screen, node);
1053                delrc(getrcconfigint("rcchup", NULL), screen, node);
1054                delrc(getrcconfigint("rcchdown", NULL), screen, node);
1055                delrc(getrcconfigint("rchelp", NULL), screen, node);
1056        }
1057        else if(node->type & CHOICEBOX)
1058        {
1059                delrc(getrcconfigint("rcleft", NULL), screen, node);
1060                delrc(getrcconfigint("rcright", NULL), screen, node);
1061                delrc(getrcconfigint("rchelp", NULL), screen, node);
1062        }
1063        else if((node->type & INPUTBOX) || (node->type & INPUTBOXNUM))
1064        {
1065                delrc(getrcconfigint("rc0", NULL), screen, node);
1066                delrc(getrcconfigint("rc1", NULL), screen, node);
1067                delrc(getrcconfigint("rc2", NULL), screen, node);
1068                delrc(getrcconfigint("rc3", NULL), screen, node);
1069                delrc(getrcconfigint("rc4", NULL), screen, node);
1070                delrc(getrcconfigint("rc5", NULL), screen, node);
1071                delrc(getrcconfigint("rc6", NULL), screen, node);
1072                delrc(getrcconfigint("rc7", NULL), screen, node);
1073                delrc(getrcconfigint("rc8", NULL), screen, node);
1074                delrc(getrcconfigint("rc9", NULL), screen, node);
1075                delrc(getrcconfigint("rcright", NULL), screen, node);
1076                delrc(getrcconfigint("rcleft", NULL), screen, node);
1077                delrc(getrcconfigint("rchelp", NULL), screen, node);
1078                if(node->type & INPUTBOX) delrc(getrcconfigint("rcff", NULL), screen, node);
1079                if(node->type & INPUTBOX) delrc(getrcconfigint("rcfr", NULL), screen, node);
1080                if(node->type & INPUTBOX) delrc(getrcconfigint("rchelp", NULL), screen, node);
1081        }
1082        else if(node->type & TEXTBOX)
1083        {
1084                delrc(getrcconfigint("rcup", NULL), screen, node);
1085                delrc(getrcconfigint("rcdown", NULL), screen, node);
1086                delrc(getrcconfigint("rcchup", NULL), screen, node);
1087                delrc(getrcconfigint("rcchdown", NULL), screen, node);
1088                delrc(getrcconfigint("rchelp", NULL), screen, node);
1089        }
1090        else if(node->type & FILELIST)
1091        {
1092                delrc(getrcconfigint("rcup", NULL), screen, node);
1093                delrc(getrcconfigint("rcdown", NULL), screen, node);
1094                delrc(getrcconfigint("rcright", NULL), screen, node);
1095                delrc(getrcconfigint("rcleft", NULL), screen, node);
1096                delrc(getrcconfigint("rcok", NULL), screen, node);
1097                delrc(getrcconfigint("rcchup", NULL), screen, node);
1098                delrc(getrcconfigint("rcchdown", NULL), screen, node);
1099                delrc(getrcconfigint("rchelp", NULL), screen, node);
1100        }
1101        else if(node->type & PROGRESSBAR)
1102        {
1103                delrc(getrcconfigint("rcleft", NULL), screen, node);
1104                delrc(getrcconfigint("rcright", NULL), screen, node);
1105                delrc(getrcconfigint("rchelp", NULL), screen, node);
1106        }
1107
1108        debug(1000, "out");
1109        return 0;
1110}
1111
1112#endif
Note: See TracBrowser for help on using the repository browser.