Planeshift
pawstitle.h
Go to the documentation of this file.
1 /*
2 * pawstitle.h
3 *
4 * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #ifndef PAWS_TITLE_HEADER
21 #define PAWS_TITLE_HEADER
22 
23 #include "pawsbutton.h"
24 
29 class pawsTitle : public pawsWidget
30 {
31 private:
32  enum PAWS_TITLE_ALIGN
33  {
34  PTA_LEFT = 0,
35  PTA_CENTER,
36  PTA_RIGHT,
37 
38  PTA_COUNT
39  };
40 
41  struct pawsTitleButton
42  {
43  char widgetName[64];
44  pawsWidget* buttonWidget;
45  PAWS_TITLE_ALIGN align;
46  int offsetx;
47  int offsety;
48  };
49  csArray<pawsTitleButton> titleButtons;
50 
51  PAWS_TITLE_ALIGN titleAlign;
52  bool scaleWidth;
53  float width;
54  int height;
55  csString text;
56  int textOffsetx;
57  int textOffsety;
58  PAWS_TITLE_ALIGN textAlign;
59 
60  PAWS_TITLE_ALIGN GetAlign(const char* alignText);
61 
62 public:
63  pawsTitle(pawsWidget* parent, iDocumentNode* node);
64 
65  pawsTitle(const pawsTitle &origin);
66 
67  virtual ~pawsTitle();
68 
69  bool Setup(iDocumentNode* node);
70  bool PostSetup();
71  void SetWindowRect(const csRect &windowRect);
72  void Draw();
73 
74  void Resize() {}
75  void MoveDelta(int /*dx*/, int /*dy*/) {}
76  void MoveTo(int /*x*/, int /*y*/) {}
77 };
78 
81 #endif // PAWS_TITLE_HEADER
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
pawsTitle(pawsWidget *parent, iDocumentNode *node)
void Draw()
Draws the widget and all of it&#39;s children.
virtual ~pawsTitle()
bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
pawsWidget * parent
This widget&#39;s parent.
Definition: pawswidget.h:130
bool Setup(iDocumentNode *node)
Setup this widget.
void Resize()
Resize a widget based on it&#39;s parent&#39;s size.
Definition: pawstitle.h:74
void SetWindowRect(const csRect &windowRect)
void MoveDelta(int, int)
Move a widget by a delta amount.
Definition: pawstitle.h:75
void MoveTo(int, int)
Moves this widget and all of its children to a new screen location.
Definition: pawstitle.h:76