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_BUTTON_H_ 14 #define __DEMOWIN_BUTTON_H_ 15 16 struct Button : public MenuItem 17 { 18 Button(Window* window, CVec3 position, CVec2 size, ColorFunc _colorFunc = BlackLighter, VoidFuncP _func = DoNothingVoidP, void* _funcExtra = NULL) MenuItemButton19 : MenuItem(window, position, size), text(""), tex(NULL), colorFunc(_colorFunc), func(_func), funcExtra(_funcExtra) {} 20 21 Button(Window* window, CVec3 position, CVec2 size, const char* _text, ColorFunc _colorFunc = BlackLighter, VoidFuncP _func = DoNothingVoidP, void* _funcExtra = NULL) MenuItemButton22 : MenuItem(window, position, size), text(_text), tex(NULL), colorFunc(_colorFunc), func(_func), funcExtra(_funcExtra) {} 23 24 Button(Window* window, CVec3 position, CVec2 size, GX2Texture** _tex, ColorFunc _colorFunc = BlackLighter, VoidFuncP _func = DoNothingVoidP, void* _funcExtra = NULL) MenuItemButton25 : MenuItem(window, position, size), text(""), tex(_tex), colorFunc(_colorFunc), func(_func), funcExtra(_funcExtra) {} 26 27 static Button* Add(const Button& item); 28 29 bool Update(); 30 void Draw(); 31 void Reset(); 32 33 String<MAX_NAME_LENGTH> text; 34 GX2Texture** tex; 35 36 ColorFunc colorFunc; 37 38 VoidFuncP func; 39 void* funcExtra; 40 }; 41 42 #endif 43