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 #ifndef _GLWIconTable_h
22 #define _GLWIconTable_h
24 #include <GLW/GLWScrollWBackwards.h>
25 #include <GLW/GLWTextButton.h>
26 #include <GLW/GLWToolTip.h>
33 virtual void drawColumn(unsigned int id
, int row
, int column
, float x
, float y
, float w
) = 0;
34 virtual void rowSelected(unsigned int id
, int row
) = 0;
35 virtual void columnSelected(unsigned int id
, int col
) = 0;
36 virtual void rowChosen(unsigned int id
, int row
) = 0;
46 Column(const LangString
&name_
= LangString(), float width_
= 0.0f
) :
47 name(name_
), width(width_
)
55 GLWIconTable(float x
= 0.0f
, float y
= 0.0f
,
56 float w
= 0.0f
, float h
= 0.0f
,
57 std::list
<Column
> *columns
= 0,
58 float rowHeight
= 20.0f
);
59 virtual ~GLWIconTable();
61 void setItemCount(int items
);
62 int getItemCount() { return itemCount_
; }
64 void setHandler(GLWIconTableI
*handler
) { handler_
= handler
; }
65 int getSelected() { return selected_
; }
67 // Inhertied from GLWidget
69 virtual void simulate(float frameTime
);
70 virtual void mouseDown(int button
, float x
, float y
, bool &skipRest
);
71 virtual void mouseUp(int button
, float x
, float y
, bool &skipRest
);
72 virtual void mouseDrag(int button
, float mx
, float my
, float x
, float y
,
74 virtual void mouseWheel(float x
, float y
, float z
, bool &skipRest
);
77 virtual void buttonDown(unsigned int id
);
79 REGISTER_CLASS_HEADER(GLWIconTable
);
81 std::vector
<GLWTextButton
*> columns_
;
82 GLWScrollWBackwards scrollBar_
;
83 GLWIconTableI
*handler_
;
89 GLWIconTable(const GLWIconTable
&);
90 const GLWIconTable
& operator=(const GLWIconTable
&);
93 #endif // _GLWIconTable_h