Planeshift
pawsborder.h
Go to the documentation of this file.
1 /*
2  * pawsborder.h - Author: Andrew Craig
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 // pawsborder.h: interface for the pawsBorder class.
20 //
22 
23 #ifndef PAWS_BORDER_HEADER
24 #define PAWS_BORDER_HEADER
25 
26 #include <ivideo/graph2d.h>
27 #include <csgeom/csrectrg.h>
28 #include "pawswidget.h"
29 
34 // Function Declarations
37 void DrawBumpFrame(iGraphics2D* graphics2D,
38  pawsWidget* widget,
39  csRect frame, int flags);
40 
42 
43 
44 // A list of the border image positions
46 {
56 };
57 
58 
64 {
66  csString name;
67 
70 };
71 
79 {
80 public:
81  pawsBorder(const char* styleName);
82  pawsBorder(const pawsBorder &origin);
83  ~pawsBorder();
84 
85  void SetParent(pawsWidget* parent);
86  void Draw();
92  void UseBorder(const char* style);
93 
95  void JustTitle()
96  {
97  justTitle = true;
98  }
99 
100  void Hide()
101  {
102  draw = false;
103  }
104  void Show()
105  {
106  draw = true;
107  }
108  csRect GetRect();
109 
110  void SetTitle(const char* t, bool shadow = true);
111  void SetTitleImage(iPawsImage* drawable)
112  {
113  titleImage = drawable; // This will take delete responsibility
114  }
115  void SetTitleAlign(int al)
116  {
117  align = al;
118  }
119 
121  {
122  return titleImage;
123  }
124  const char* GetTitle()
125  {
126  return title;
127  }
128 
129 protected:
130 
131  void DrawTitle(csRect &frame);
132  void DrawFrame(csRect frame);
133 
134  csRect frame;
136 
137  csRef<iPawsImage> borderImages[PAWS_BORDER_MAX];
138 
140  csString title;
142  csRef<iPawsImage> titleImage;
144  int align;
145 
147  bool draw;
148  bool justTitle;
149  int style;
151 };
152 
155 #endif
156 
157 
const char * GetTitle()
Definition: pawsborder.h:124
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
bool usingGraphics
Definition: pawsborder.h:146
Defines the images that make the border up.
Definition: pawsborder.h:63
csRect frame
Definition: pawsborder.h:134
void DrawBumpFrame(iGraphics2D *graphics2D, pawsWidget *widget, csRect frame, int flags)
BorderPositions
Definition: pawsborder.h:45
void Hide()
Definition: pawsborder.h:100
csRef< iPawsImage > titleImage
Title bar image.
Definition: pawsborder.h:142
void JustTitle()
Draws just the title bar.
Definition: pawsborder.h:95
void Show()
Definition: pawsborder.h:104
bool justTitle
Definition: pawsborder.h:148
pawsWidget * parent
Definition: pawsborder.h:135
int align
Alignment of title text.
Definition: pawsborder.h:144
void SetTitleImage(iPawsImage *drawable)
Definition: pawsborder.h:111
iPawsImage * GetTitleImage()
Definition: pawsborder.h:120
csString descriptions[PAWS_BORDER_MAX]
The image resources for each of the border areas.
Definition: pawsborder.h:69
This is a class that draws the border around a widget.
Definition: pawsborder.h:78
void SetTitleAlign(int al)
Definition: pawsborder.h:115
csString title
Title bar text.
Definition: pawsborder.h:140
bool shadowFont
Definition: pawsborder.h:150
csString name
The name of this border style.
Definition: pawsborder.h:66