/*---------------------------------------------------------------------------* Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __DEMOWIN_COMBO_BOX_H_ #define __DEMOWIN_COMBO_BOX_H_ // The numbers 0 through 20, just for simplicity extern SubComboBasic<10> basicNums[]; extern SubCombo* basicNumList[]; const int COMBOBOX_COUNT = 10; struct ComboBox : public MenuItem { ComboBox(Window* window, CVec3 position, CVec2 size, SubCombo** _data, int _count, int* _target, VoidFuncP _func = DoNothingVoidP, void* _funcExtra = NULL) : 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) {} static ComboBox* Add(const ComboBox& item); bool CursorOver(); bool Update(); void Draw(); void Reset(); SubCombo** data; int count; int over; int pos; int* target; VoidFuncP func; void* funcExtra; bool flipped; ScrollBar bar; }; #endif