Crazy Eddie's GUI System 0.8.7
SectionSpecification.h
1/***********************************************************************
2 created: Mon Jun 13 2005
3 author: Paul D Turner <paul@cegui.org.uk>
4*************************************************************************/
5/***************************************************************************
6 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining
9 * a copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sublicense, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 ***************************************************************************/
27#ifndef _CEGUIFalSectionSpecification_h_
28#define _CEGUIFalSectionSpecification_h_
29
30#include "../Window.h"
31#include "../ColourRect.h"
32
33
34// Start of CEGUI namespace section
35namespace CEGUI
36{
37 // forward refs
38 class WidgetLookFeel;
39
47 class CEGUIEXPORT SectionSpecification :
48 public AllocatedObject<SectionSpecification>
49 {
50 public:
52
81 SectionSpecification(const String& owner, const String& sectionName,
82 const String& controlPropertySource,
83 const String& controlPropertyValue,
84 const String& controlPropertyWidget);
85
117 SectionSpecification(const String& owner, const String& sectionName,
118 const String& controlPropertySource,
119 const String& controlPropertyValue,
120 const String& controlPropertyWidget,
121 const ColourRect& cols);
122
133 void render(Window& srcWindow, const ColourRect* modcols = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
134
148 void render(Window& srcWindow, const Rectf& baseRect, const ColourRect* modcols = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
149
158
169 void setOwnerWidgetLookFeel(const String& owner);
170
178 const String& getSectionName() const;
189 void setSectionName(const String& name);
190
200
212
222
234 void setUsingOverrideColours(bool setting = true);
243
255
265
278
291
303 void setRenderControlValue(const String& value);
304
320
335 void setRenderControlWidget(const String& widget);
336
348 void writeXMLToStream(XMLSerializer& xml_stream) const;
349
350 protected:
361 void initColourRectForOverride(const Window& wnd, ColourRect& cr) const;
362
366 bool shouldBeDrawn(const Window& wnd) const;
367
368 private:
369 String d_owner;
370 String d_sectionName;
371 ColourRect d_coloursOverride;
372 bool d_usingColourOverride;
373 String d_colourPropertyName;
375 String d_renderControlProperty;
377 String d_renderControlValue;
379 String d_renderControlWidget;
380 };
381
382
383} // End of CEGUI namespace section
384
385
386#endif // end of guard _CEGUIFalSectionSpecification_h_
Definition: MemoryAllocatedObject.h:110
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:45
Class that represents a simple 'link' to an ImagerySection.
Definition: SectionSpecification.h:49
void setRenderControlPropertySource(const String &property)
Set the name of the property that controls whether to actually render this section.
void setOverrideColoursPropertySource(const String &property)
Set the name of the property where override colour values can be obtained.
const String & getOverrideColoursPropertySource() const
Get the name of the property where override colour values can be obtained.
const String & getRenderControlWidget() const
Get the widget what will be used as the source of the property named as the control property.
const ColourRect & getOverrideColours() const
Return the current override colours.
SectionSpecification(const String &owner, const String &sectionName, const String &controlPropertySource, const String &controlPropertyValue, const String &controlPropertyWidget)
Constructor.
const String & getRenderControlPropertySource() const
Get the name of the property that controls whether to actually render this section.
void writeXMLToStream(XMLSerializer &xml_stream) const
Writes an xml representation of this SectionSpecification to out_stream.
void setOwnerWidgetLookFeel(const String &owner)
Return the name of the WidgetLookFeel object containing the target section.
bool shouldBeDrawn(const Window &wnd) const
bool isUsingOverrideColours() const
return whether the use of override colours is enabled on this SectionSpecification.
void setRenderControlValue(const String &value)
Set the test value used when determining whether to render this section.
void render(Window &srcWindow, const ColourRect *modcols=0, const Rectf *clipper=0, bool clipToDisplay=false) const
Render the section specified by this SectionSpecification.
SectionSpecification(const String &owner, const String &sectionName, const String &controlPropertySource, const String &controlPropertyValue, const String &controlPropertyWidget, const ColourRect &cols)
Constructor.
const String & getRenderControlValue() const
Get the test value used when determining whether to render this section.
void setOverrideColours(const ColourRect &cols)
Set the override colours to be used by this SectionSpecification.
void initColourRectForOverride(const Window &wnd, ColourRect &cr) const
Helper method to initialise a ColourRect with appropriate values according to the way the section sep...
const String & getOwnerWidgetLookFeel() const
Return the name of the WidgetLookFeel object containing the target section.
void setSectionName(const String &name)
Return the name of the target ImagerySection.
void setUsingOverrideColours(bool setting=true)
Enable or disable the use of override colours for this section.
void setRenderControlWidget(const String &widget)
Set the widget what will be used as the source of the property named as the control property.
const String & getSectionName() const
Return the name of the target ImagerySection.
void render(Window &srcWindow, const Rectf &baseRect, const ColourRect *modcols=0, const Rectf *clipper=0, bool clipToDisplay=false) const
Render the section specified by this SectionSpecification.
String class used within the GUI system.
Definition: String.h:64
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
Class used to create XML Document.
Definition: XMLSerializer.h:87
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1