]> git.vomp.tv Git - vompclient.git/blob - wselectlist.h
German updates
[vompclient.git] / wselectlist.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef WSELECTLIST_H
22 #define WSELECTLIST_H
23
24 #include <stdio.h>
25 #include <string.h>
26
27 #include <vector>
28
29 #include "defines.h"
30 #include "boxx.h"
31
32 using namespace std;
33
34 typedef struct
35 {
36   char* text;
37   ULONG data;
38 } wsloption;
39
40 class WSelectList : public Boxx
41 {
42   public:
43     WSelectList();
44     ~WSelectList();
45     void clear();
46     void addColumn(int x);
47
48     void setNoLoop();
49     void setShowSelOption(bool set) { showseloption = set; };
50     int addOption(const char* text, ULONG data, int selected);
51     void draw();
52     void setBackgroundColour(Colour& colour);
53
54     void down();
55     void up();
56     void pageUp();
57     void pageDown();
58
59     int getTopOption();
60     int getNumOptions();
61     int getBottomOption();     // actually returns bottom + 1 i.e. the one just past display ?!
62     int getCurrentOption();
63     ULONG getCurrentOptionData();
64
65     void hintSetCurrent(int index);
66     void hintSetTop(int index);
67
68     virtual bool mouseMove(int x, int y);
69     virtual bool mouseLBDOWN(int x, int y);
70
71   private:
72     void drawOptionLine(char* text, int xpos, int ypos, Colour& colour);
73     int getMouseLine(int x, int y);
74
75     vector<wsloption> options;
76     UINT selectedOption;
77     int topOption;
78     UINT numOptionsDisplayable;
79     int columns[10];
80     int numColumns;
81     int noLoop;
82     bool showseloption;
83     
84     UINT gap;
85     Colour backgroundColour;
86 };
87
88 #endif