source: titan/titan/dirsort.h @ 40087

Last change on this file since 40087 was 27932, checked in by obi, 10 years ago

fix dirsort translate

File size: 1.6 KB
Line 
1#ifndef DIRSORT_H
2#define DIRSORT_H
3
4int screendirsort()
5{
6        int tmpsort = 0;
7        int rcret = 0;
8
9        struct skin* dirsort = getscreen("dirsort");
10        struct skin* listbox = getscreennode(dirsort, "listbox");
11        struct skin* alpha = getscreennode(dirsort, "alpha");
12        struct skin* reversealpha = getscreennode(dirsort, "reversealpha");
13        struct skin* size = getscreennode(dirsort, "size");
14        struct skin* reversesize = getscreennode(dirsort, "reversesize");
15        struct skin* date = getscreennode(dirsort, "date");
16        struct skin* reversedate = getscreennode(dirsort, "reversedate");
17       
18        addchoicebox(alpha, "0", "");
19        addchoicebox(reversealpha, "1", "");
20        addchoicebox(size, "2", "");
21        addchoicebox(reversesize, "3", "");
22        addchoicebox(date, "4", "");
23        addchoicebox(reversedate, "5", "");
24
25        drawscreen(dirsort, 0, 0);
26        addscreenrc(dirsort, listbox);
27
28        while(1)
29        {
30                rcret = waitrc(dirsort, 0, 0);
31
32                if(rcret == getrcconfigint("rcexit", NULL)) break;
33                if(rcret == getrcconfigint("rcok", NULL))
34                {
35                        if(listbox->select != NULL)
36                        {
37                                if(!ostrncmp("alpha", listbox->select->name, 5))
38                                        tmpsort = 0;
39                                else if(!ostrncmp("reversealpha", listbox->select->name, 12))
40                                        tmpsort = 1;
41                                else if(!ostrncmp("size", listbox->select->name, 4))
42                                        tmpsort = 2;
43                                else if(!ostrncmp("reversesize", listbox->select->name, 11))
44                                        tmpsort = 3;
45                                else if(!ostrncmp("date", listbox->select->name, 4))
46                                        tmpsort = 4;
47                                else if(!ostrncmp("reversedate", listbox->select->name, 11))
48                                        tmpsort = 5;
49                        }
50                        break;
51                }
52        }
53       
54        delownerrc(dirsort);
55        clearscreen(dirsort);
56        return tmpsort;
57}
58
59#endif
Note: See TracBrowser for help on using the repository browser.