aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h
blob: 108d4d64daa0fa6aa00fc529af2320e83db3a9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

#ifndef __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__
#define __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__

#include "IGUIWindow.h"
#include "CGUIPanel.h"
#include "IGUIImage.h"
#include "EGUIEditTypes.h"

namespace irr
{
namespace gui
{

	//! Texture cache browser

	const u32 TEXTURE_BROWSER_TEXTURE_SELECTED = 0x5E1EC7ED; // custom event number for texture selected

	class CGUITextureCacheBrowser : public IGUIWindow
	{
	public:

		//! constructor
		CGUITextureCacheBrowser(IGUIEnvironment* environment, s32 id=-1, IGUIElement *parent=0);

		//! destructor
		~CGUITextureCacheBrowser();

		//! event handler
		virtual bool OnEvent(const SEvent &event);

		//! draws the element
		virtual void draw();

		//! update absolute position
		virtual void updateAbsolutePosition();

		//! this shoudln't be serialized, but this is included as it's an example
		virtual const c8* getTypeName() const { return "textureCacheBrowser"; }

		//! Returns pointer to the close button
		virtual IGUIButton* getCloseButton() const { return CloseButton; }

		//! Returns pointer to the minimize button
		virtual IGUIButton* getMinimizeButton() const { return 0;}

		//! Returns pointer to the maximize button
		virtual IGUIButton* getMaximizeButton() const { return 0;}

		//! get draggable
		virtual bool isDraggable() const;

		//! get draggable
		virtual void setDraggable(bool draggable);

		//! not used
		virtual core::rect<s32> getClientRect() const;
        virtual void setDrawBackground(bool draw)  { }
		virtual bool getDrawBackground() const { return true; }
		virtual void setDrawTitlebar(bool draw) { }
		virtual bool getDrawTitlebar() const { return true; }


		void setSelected(s32 index=-1);

	private:

		void updateImageList();

		core::array<IGUIImage*> Images;
		core::position2d<s32> DragStart;

		IGUIButton* CloseButton;
		CGUIPanel*	Panel;
		s32 SelectedTexture;
		bool Dragging;
		bool IsDraggable;
	};


} // end namespace gui
} // end namespace irr

#endif