1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __C_GUI_WINDOW_H_INCLUDED__
6
#define __C_GUI_WINDOW_H_INCLUDED__
8
#include "IrrCompileConfig.h"
9
#ifdef _IRR_COMPILE_WITH_GUI_
11
#include "IGUIWindow.h"
19
class CGUIWindow : public IGUIWindow
24
CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
27
virtual ~CGUIWindow();
29
//! called if an event happened.
30
virtual bool OnEvent(const SEvent& event);
32
//! update absolute position
33
virtual void updateAbsolutePosition();
35
//! draws the element and its children
38
//! Returns pointer to the close button
39
virtual IGUIButton* getCloseButton() const;
41
//! Returns pointer to the minimize button
42
virtual IGUIButton* getMinimizeButton() const;
44
//! Returns pointer to the maximize button
45
virtual IGUIButton* getMaximizeButton() const;
47
//! Returns true if the window is draggable, false if not
48
virtual bool isDraggable() const;
50
//! Sets whether the window is draggable
51
virtual void setDraggable(bool draggable);
53
//! Set if the window background will be drawn
54
virtual void setDrawBackground(bool draw);
56
//! Get if the window background will be drawn
57
virtual bool getDrawBackground() const;
59
//! Set if the window titlebar will be drawn
60
//! Note: If the background is not drawn, then the titlebar is automatically also not drawn
61
virtual void setDrawTitlebar(bool draw);
63
//! Get if the window titlebar will be drawn
64
virtual bool getDrawTitlebar() const;
66
//! Returns the rectangle of the drawable area (without border and without titlebar)
67
virtual core::rect<s32> getClientRect() const;
69
//! Writes attributes of the element.
70
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
72
//! Reads attributes of the element
73
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
77
void updateClientRect();
78
void refreshSprites();
80
IGUIButton* CloseButton;
81
IGUIButton* MinButton;
82
IGUIButton* RestoreButton;
83
core::rect<s32> ClientRect;
84
video::SColor CurrentIconColor;
86
core::position2d<s32> DragStart;
87
bool Dragging, IsDraggable;
93
} // end namespace gui
94
} // end namespace irr
96
#endif // _IRR_COMPILE_WITH_GUI_