source: titan/titan/listbox.h @ 15345

Last change on this file since 15345 was 8605, checked in by nit, 13 years ago

[titan] fixes in avsettings, videomodescreen, miniplayer

File size: 1.4 KB
Line 
1#ifndef LISTBOX_H
2#define LISTBOX_H
3
4int setlistboxselection(struct skin* listbox, char* childname)
5{
6        debug(1000, "in");
7        struct skin* child = NULL;
8        int count = 0;
9
10        if(listbox == NULL || childname == NULL)
11        {
12                debug(1000, "out -> NULL detect");
13                return 1;
14        }
15
16        listbox->aktpage = -1;
17        listbox->aktline = 1;
18
19        child = listbox->next;
20        while(child != NULL)
21        {
22                if(child->parentpointer == NULL)
23                {
24                        if(child->parent == NULL)
25                        {
26                                child = child->next;
27                                continue;
28                        }
29                        else if(ostrcmp(child->parent, listbox->name) != 0 || child->hidden == YES || child->deaktivcol > -1)
30                        {
31                                child = child->next;
32                                continue;
33                        }
34                }
35                else if(child->parentpointer != listbox || child->hidden == YES || child->deaktivcol > -1)
36                {
37                        child = child->next;
38                        continue;
39                }
40
41                count++;
42                if(ostrcmp(child->name, childname) == 0)
43                {
44                        listbox->aktpage = -1;
45                        listbox->aktline = count;
46                        break;
47                }
48
49                child = child->next;
50        }
51
52        debug(1000, "out");
53        return 0;
54}
55
56struct skin* addlistbox(struct skin* screen, struct skin* listbox, struct skin* last, int del)
57{
58        struct skin* node = NULL;
59
60        node = addscreennode(screen, NULL, last);
61        if(node != NULL)
62        {
63                node->bordercol = listbox->bordercol;
64                node->width = 100;
65                node->prozwidth = 1;
66                node->height = listbox->fontsize + 2;
67                node->parentpointer = listbox;
68                node->del = del;
69                node->deaktivcol = -1;
70        }
71
72        return node;
73}
74
75#endif
Note: See TracBrowser for help on using the repository browser.