1 // Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson 2 // This file is part of the "Irrlicht Engine". 3 // For conditions of distribution and use, see copyright notice in irrlicht.h 4 5 #ifndef __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__ 6 #define __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__ 7 8 #include "IGUIWindow.h" 9 #include "CGUIPanel.h" 10 #include "IGUIImage.h" 11 #include "EGUIEditTypes.h" 12 13 namespace irr 14 { 15 namespace gui 16 { 17 18 //! Texture cache browser 19 20 const u32 TEXTURE_BROWSER_TEXTURE_SELECTED = 0x5E1EC7ED; // custom event number for texture selected 21 22 class CGUITextureCacheBrowser : public IGUIWindow 23 { 24 public: 25 26 //! constructor 27 CGUITextureCacheBrowser(IGUIEnvironment* environment, s32 id=-1, IGUIElement *parent=0); 28 29 //! destructor 30 ~CGUITextureCacheBrowser(); 31 32 //! event handler 33 virtual bool OnEvent(const SEvent &event); 34 35 //! draws the element 36 virtual void draw(); 37 38 //! update absolute position 39 virtual void updateAbsolutePosition(); 40 41 //! this shoudln't be serialized, but this is included as it's an example getTypeName()42 virtual const c8* getTypeName() const { return "textureCacheBrowser"; } 43 44 //! Returns pointer to the close button getCloseButton()45 virtual IGUIButton* getCloseButton() const { return CloseButton; } 46 47 //! Returns pointer to the minimize button getMinimizeButton()48 virtual IGUIButton* getMinimizeButton() const { return 0;} 49 50 //! Returns pointer to the maximize button getMaximizeButton()51 virtual IGUIButton* getMaximizeButton() const { return 0;} 52 53 //! get draggable 54 virtual bool isDraggable() const; 55 56 //! get draggable 57 virtual void setDraggable(bool draggable); 58 59 //! not used 60 virtual core::rect<s32> getClientRect() const; setDrawBackground(bool draw)61 virtual void setDrawBackground(bool draw) { } getDrawBackground()62 virtual bool getDrawBackground() const { return true; } setDrawTitlebar(bool draw)63 virtual void setDrawTitlebar(bool draw) { } getDrawTitlebar()64 virtual bool getDrawTitlebar() const { return true; } 65 66 67 void setSelected(s32 index=-1); 68 69 private: 70 71 void updateImageList(); 72 73 core::array<IGUIImage*> Images; 74 core::position2d<s32> DragStart; 75 76 IGUIButton* CloseButton; 77 CGUIPanel* Panel; 78 s32 SelectedTexture; 79 bool Dragging; 80 bool IsDraggable; 81 }; 82 83 84 } // end namespace gui 85 } // end namespace irr 86 87 #endif 88 89