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