File: CGUIEditWindow.h

package info (click to toggle)
irrlicht 1.7.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 32,124 kB
  • ctags: 44,051
  • sloc: cpp: 137,592; ansic: 3,232; makefile: 801; sh: 16; sed: 11
file content (79 lines) | stat: -rw-r--r-- 2,216 bytes parent folder | download | duplicates (2)
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
#ifndef __C_GUI_EDITOR_H_INCLUDED__
#define __C_GUI_EDITOR_H_INCLUDED__


#include "IGUIWindow.h"
#include "CGUIAttributeEditor.h"
//#include "IGUIStaticText.h"
#include "IGUIButton.h"
#include "irrArray.h"
#include "IAttributes.h"

namespace irr
{
namespace gui
{
	class CGUIEditWindow : public IGUIWindow
	{
	public:

		//! constructor
		CGUIEditWindow(IGUIEnvironment* environment, core::rect<s32> rectangle, IGUIElement *parent);

		//! destructor
		~CGUIEditWindow();

		//! this part draws the window
		virtual void draw();
		//! handles events
		virtual bool OnEvent(const SEvent &event);

		//! change selection
		virtual void setSelectedElement(IGUIElement *sel);

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

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

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

		CGUIAttributeEditor* getAttributeEditor() const;
		CGUIAttributeEditor* getOptionEditor() const;
		CGUIAttributeEditor* getEnvironmentEditor() const;

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

	private:


		// for dragging the window
		bool                    Dragging;
		bool                    IsDraggable;
		bool                    Resizing;
		core::position2d<s32>   DragStart;

		IGUIElement*            SelectedElement; // current selected element

		CGUIAttributeEditor*    AttribEditor;	// edits the current attribute
		CGUIAttributeEditor*    OptionEditor;	// edits the options for the window
		CGUIAttributeEditor*    EnvEditor;		// edits attributes for the environment
		IGUIButton*             ResizeButton;

	};

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

#endif // __C_GUI_EDITOR_H_INCLUDED__