MyGUI  3.2.1
MyGUI_IBItemInfo.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_ITEM_INFO_H__
00008 #define __MYGUI_ITEM_INFO_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 
00012 namespace MyGUI
00013 {
00014 
00015     // структура информации об отображении элемента
00017     struct MYGUI_EXPORT IBDrawItemInfo
00018     {
00019 
00020         IBDrawItemInfo() :
00021             index(ITEM_NONE),
00022             update(false),
00023             select(false),
00024             active(false),
00025             drag(false),
00026             drop_accept(false),
00027             drop_refuse(false)
00028         {
00029         }
00030 
00031         IBDrawItemInfo(size_t _index, size_t _select, size_t _active, size_t _accept, size_t _refuse, bool _update, bool _drag) :
00032             index(_index),
00033             update(_update),
00034             select(_index == _select),
00035             active(_index == _active),
00036             drag(_drag),
00037             drop_accept(_index == _accept),
00038             drop_refuse(_index == _refuse)
00039         {
00040         }
00041 
00043         size_t index;
00045         bool update;
00047         bool select;
00049         bool active;
00051         bool drag;
00053         bool drop_accept;
00055         bool drop_refuse;
00056     };
00057 
00058     struct MYGUI_EXPORT IBNotifyItemData
00059     {
00060         enum NotifyItem
00061         {
00062             MousePressed,
00063             MouseReleased,
00064             KeyPressed,
00065             KeyReleased
00066         };
00067 
00068         IBNotifyItemData(size_t _index, NotifyItem _notify, int _x, int _y, MouseButton _id) :
00069             index(_index),
00070             notify(_notify),
00071             x(_x),
00072             y(_y),
00073             id(_id),
00074             code(KeyCode::None),
00075             key(0)
00076         {
00077         }
00078 
00079         IBNotifyItemData(size_t _index, NotifyItem _notify, KeyCode _code, Char _key) :
00080             index(_index),
00081             notify(_notify),
00082             x(0),
00083             y(0),
00084             id(MouseButton::None),
00085             code(_code),
00086             key(_key)
00087         {
00088         }
00089 
00090         IBNotifyItemData(size_t _index, NotifyItem _notify, KeyCode _code) :
00091             index(_index),
00092             notify(_notify),
00093             x(0),
00094             y(0),
00095             id(MouseButton::None),
00096             code(_code),
00097             key(KeyCode::None)
00098         {
00099         }
00100 
00102         size_t index;
00104         NotifyItem notify;
00106         int x;
00108         int y;
00110         MouseButton id;
00112         KeyCode code;
00114         Char key;
00115     };
00116 
00117 } // namespace MyGUI
00118 
00119 #endif // __MYGUI_ITEM_INFO_H__