1 /*---------------------------------------------------------------------------*
2 
3   Copyright (C) Nintendo.  All rights reserved.
4 
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law.  They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 #ifndef __DEMOWIN_COMBO_BOX_H_
14 #define __DEMOWIN_COMBO_BOX_H_
15 
16     // The numbers 0 through 20, just for simplicity
17 extern SubComboBasic<10> basicNums[];
18 extern SubCombo* basicNumList[];
19 
20 const int COMBOBOX_COUNT = 10;
21 
22 struct ComboBox : public MenuItem
23 {
24     ComboBox(Window* window, CVec3 position, CVec2 size, SubCombo** _data, int _count, int* _target, VoidFuncP _func = DoNothingVoidP, void* _funcExtra = NULL)
MenuItemComboBox25         : MenuItem(window, position, size), data(_data), count(_count), over(-1), pos(0), target(_target), func(_func), funcExtra(_funcExtra), flipped(false), bar(window, CVec3(size.x / 2 - SCROLLBAR_WIDTH / 2, size.y * -5.5, position.z + 0.55), CVec2(SCROLLBAR_WIDTH, size.y * COMBOBOX_COUNT), 0, COMBOBOX_COUNT) {}
26 
27     static ComboBox* Add(const ComboBox& item);
28 
29     bool CursorOver();
30     bool Update();
31     void Draw();
32     void Reset();
33 
34     SubCombo** data;
35     int count;
36 
37     int over;
38     int pos;
39 
40     int* target;
41 
42     VoidFuncP func;
43     void* funcExtra;
44 
45     bool flipped;
46 
47     ScrollBar bar;
48 };
49 
50 #endif
51