25 #define MAX_DEBUG_LABEL_LEN 32
28 #define YUILogComponent "ui"
31 #include "YUISymbols.h"
47 , isHeading( isHeading )
48 , isOutputField( isOutputField )
49 , useBoldFont( false )
68 YUI_CHECK_NEW( priv );
92 return priv->isHeading;
98 return priv->isOutputField;
104 return priv->useBoldFont;
110 priv->useBoldFont = bold;
116 return priv->autoWrap;
158 propSet.
add(
YProperty( YUIProperty_Label, YStringProperty ) );
159 propSet.
add(
YProperty( YUIProperty_Value, YStringProperty ) );
160 propSet.
add(
YProperty( YUIProperty_Text, YStringProperty ) );
202 string label =
text();
204 if ( label.size() > MAX_DEBUG_LABEL_LEN )
206 label.resize( MAX_DEBUG_LABEL_LEN );
207 label.append(
"..." );
210 for ( string::size_type i=0; i < label.size(); i++ )
212 if ( label[i] ==
'\n' ) label[i] =
' ';
213 if ( label[i] ==
'\"' ) label[i] =
' ';
224 if ( priv->isHeading )
return "YLabel_Heading";
225 else if ( priv->isOutputField )
return "YLabel_OutputField";
226 else return "YLabel";
A window in the desktop environment.
int layoutPass() const
Return the number of the current layout pass: 0: No layout going on right now 1: First pass 2: Second...
void requestMultiPassLayout()
Request multiple passes of the layout engine.
bool isHeading() const
Return 'true' if this is a Heading widget, i.e., it should display its text in a bold and/or larger f...
virtual const YPropertySet & propertySet()
Return this class's property set.
virtual std::string debugLabel() const
Returns a descriptive label of this widget instance for debugging.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual void setUseBoldFont(bool bold=true)
Switch bold font on or off.
virtual void setText(const std::string &newText)
Set the text the widget displays.
bool isOutputField() const
Return 'true' if this is an OutputField widget, i.e., it should display its text similar to an InputF...
bool autoWrap() const
Return 'true' if automatic word wrapping is enabled.
virtual void setAutoWrap(bool autoWrap=true)
Enable or disable automatic word wrapping.
int layoutPass()
Convenience method for the parent dialog's layoutPass(): Return the number of the current layout pass...
std::string text() const
Return the text the widget displays.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
bool useBoldFont() const
Return 'true' if a bold font should be used.
virtual ~YLabel()
Destructor.
YLabel(YWidget *parent, const std::string &text, bool isHeading=false, bool isOutputField=false)
Constructor.
A set of properties to check names and types against.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
void add(const YProperty &prop)
Add a property to this property set.
Transport class for the value of simple properties.
std::string stringVal() const
Methods to get the value of this property.
YPropertyType type() const
Returns the type of this property value.
Class for widget properties.
YLabelPrivate(const string &text, bool isHeading, bool isOutputField)
Constructor.