2009-01-27 05:23:36 -08:00
|
|
|
// Copyright (C) 2002-2009 Nikolaus Gebhardt
|
2007-05-20 11:03:49 -07:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __C_GUI_WINDOW_H_INCLUDED__
|
|
|
|
#define __C_GUI_WINDOW_H_INCLUDED__
|
|
|
|
|
2007-07-25 22:30:19 -07:00
|
|
|
#include "IrrCompileConfig.h"
|
|
|
|
#ifdef _IRR_COMPILE_WITH_GUI_
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
#include "IGUIWindow.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace gui
|
|
|
|
{
|
|
|
|
class IGUIButton;
|
|
|
|
|
|
|
|
class CGUIWindow : public IGUIWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
|
|
|
|
|
|
|
|
//! destructor
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual ~CGUIWindow();
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! called if an event happened.
|
2007-09-16 16:41:55 -07:00
|
|
|
virtual bool OnEvent(const SEvent& event);
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! update absolute position
|
|
|
|
virtual void updateAbsolutePosition();
|
|
|
|
|
|
|
|
//! draws the element and its children
|
|
|
|
virtual void draw();
|
|
|
|
|
|
|
|
//! Returns pointer to the close button
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual IGUIButton* getCloseButton() const;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! Returns pointer to the minimize button
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual IGUIButton* getMinimizeButton() const;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! Returns pointer to the maximize button
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual IGUIButton* getMaximizeButton() const;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
2009-05-04 17:09:53 -07:00
|
|
|
//! Returns true if the window is draggable, false if not
|
|
|
|
virtual bool isDraggable() const;
|
|
|
|
|
|
|
|
//! Sets whether the window is draggable
|
|
|
|
virtual void setDraggable(bool draggable);
|
|
|
|
|
2009-07-03 02:11:53 -07:00
|
|
|
//! Set if the window background will be drawn
|
|
|
|
virtual void setDrawBackground(bool draw);
|
|
|
|
|
|
|
|
//! Get if the window background will be drawn
|
|
|
|
virtual bool getDrawBackground() const;
|
|
|
|
|
|
|
|
//! Set if the window titlebar will be drawn
|
|
|
|
//! Note: If the background is not drawn, then the titlebar is automatically also not drawn
|
|
|
|
virtual void setDrawTitlebar(bool draw);
|
|
|
|
|
|
|
|
//! Get if the window titlebar will be drawn
|
|
|
|
virtual bool getDrawTitlebar() const;
|
|
|
|
|
2010-01-23 12:13:43 -08:00
|
|
|
//! Returns the rectangle of the drawable area (without border and without titlebar)
|
|
|
|
virtual core::rect<s32> getClientRect() const;
|
|
|
|
|
2009-07-03 02:11:53 -07:00
|
|
|
//! Writes attributes of the element.
|
|
|
|
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
|
|
|
|
|
|
|
|
//! Reads attributes of the element
|
|
|
|
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
protected:
|
|
|
|
|
2010-01-23 12:13:43 -08:00
|
|
|
void updateClientRect();
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
IGUIButton* CloseButton;
|
|
|
|
IGUIButton* MinButton;
|
|
|
|
IGUIButton* RestoreButton;
|
2010-01-23 12:13:43 -08:00
|
|
|
core::rect<s32> ClientRect;
|
2009-01-27 05:23:36 -08:00
|
|
|
|
|
|
|
core::position2d<s32> DragStart;
|
2009-05-04 17:09:53 -07:00
|
|
|
bool Dragging, IsDraggable;
|
2009-07-03 02:11:53 -07:00
|
|
|
bool DrawBackground;
|
|
|
|
bool DrawTitlebar;
|
2009-11-20 02:08:00 -08:00
|
|
|
bool IsActive;
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace gui
|
|
|
|
} // end namespace irr
|
|
|
|
|
2007-07-25 22:30:19 -07:00
|
|
|
#endif // _IRR_COMPILE_WITH_GUI_
|
2007-05-20 11:03:49 -07:00
|
|
|
|
2009-01-27 05:23:36 -08:00
|
|
|
#endif
|
2007-09-15 17:18:13 -07:00
|
|
|
|