1 ////////////////////////////////////////////////////////////////////////////////
2 // Scorched3D (c) 2000-2009
4 // This file is part of Scorched3D.
6 // Scorched3D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // Scorched3D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with Scorched3D; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 ////////////////////////////////////////////////////////////////////////////////
21 #if !defined(AFX_GLWPANEL_H__6619410E_0A6B_459B_8A38_11024F49A6E3__INCLUDED_)
22 #define AFX_GLWPANEL_H__6619410E_0A6B_459B_8A38_11024F49A6E3__INCLUDED_
25 #include <GLW/GLWidget.h>
28 A container widget for other widgets.
29 Also controls how widgets are layed out.
31 class GLWPanel
: public GLWidget
43 AlignCenterLeftRight
= 128,
46 AlignCenterTopBottom
= 1024
58 GLWPanelEntry(GLWidget
*widget
, GLWCondition
*con
,
59 unsigned int flags
, float width
);
62 GLWCondition
*condition
;
70 GLWPanel(float x
= 0.0f
, float y
= 0.0f
,
71 float w
= 0.0f
, float h
= 0.0f
,
72 bool depressed
= false,
77 virtual void simulate(float frameTime
);
79 virtual void mouseDown(int button
, float x
, float y
, bool &skipRest
);
80 virtual void mouseUp(int button
, float x
, float y
, bool &skipRest
);
81 virtual void mouseDrag(int button
, float mx
, float my
, float x
, float y
, bool &skipRest
);
82 virtual void keyDown(char *buffer
, unsigned int keyState
,
83 KeyboardHistory::HistoryElement
*history
, int hisCount
,
85 virtual void mouseWheel(float x
, float y
, float z
, bool &skipRest
);
86 virtual void display();
89 virtual bool initFromXML(XMLNode
*node
);
91 virtual void layout();
93 virtual void setLayout(unsigned int layout
);
94 virtual unsigned int getLayout();
95 virtual void setGridWidth(unsigned int grid
);
96 virtual unsigned int getGridWidth();
98 GLWidget
*addWidget(GLWidget
*widget
, GLWCondition
*condition
= 0,
99 unsigned int flags
= 0,
101 std::list
<GLWPanelEntry
> &getWidgets() { return widgets_
; }
102 GLWidget
*getWidgetByName(const char *name
);
104 REGISTER_CLASS_HEADER(GLWPanel
);
107 bool &getDrawPanel() { return drawPanel_
; }
110 std::list
<GLWPanelEntry
> widgets_
;
114 unsigned int layout_
;
115 unsigned int gridWidth_
;
119 #endif // !defined(AFX_GLWPANEL_H__6619410E_0A6B_459B_8A38_11024F49A6E3__INCLUDED_)