aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-03-01 17:38:13 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-03-01 17:38:13 +0000
commita1a9522c1bf4d5e785dd92bc9321420d4c8a90f2 (patch)
treeabedc19fbf055d9062ea79486c530078f8b51ae9 /lib
parentf41b32acf318e07ea16e8f5be28e84261b13d8e2 (diff)
downloadenigma2-a1a9522c1bf4d5e785dd92bc9321420d4c8a90f2.tar.gz
enigma2-a1a9522c1bf4d5e785dd92bc9321420d4c8a90f2.zip
add support for non-wrapping labels, add debug assert for incomplete skins
Diffstat (limited to 'lib')
-rw-r--r--lib/gui/elabel.cpp16
-rw-r--r--lib/gui/elabel.h2
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/gui/elabel.cpp b/lib/gui/elabel.cpp
index f64adb2d..6e53c851 100644
--- a/lib/gui/elabel.cpp
+++ b/lib/gui/elabel.cpp
@@ -15,6 +15,8 @@ eLabel::eLabel(eWidget *parent, int markedPos): eWidget(parent)
m_have_foreground_color = 0;
m_have_shadow_color = 0;
+
+ m_nowrap = 0;
}
int eLabel::event(int event, void *data, void *data2)
@@ -89,7 +91,8 @@ int eLabel::event(int event, void *data, void *data2)
else if (m_halign == alignBlock)
flags |= gPainter::RT_HALIGN_BLOCK;
- flags |= gPainter::RT_WRAP;
+ if (!m_nowrap)
+ flags |= gPainter::RT_WRAP;
/* if we don't have shadow, m_shadow_offset will be 0,0 */
painter.renderText(eRect(-m_shadow_offset.x(), -m_shadow_offset.y(), size().width(), size().height()), m_text, flags);
@@ -180,6 +183,15 @@ void eLabel::setShadowOffset(const ePoint &offset)
m_shadow_offset = offset;
}
+void eLabel::setNoWrap(int nowrap)
+{
+ if (m_nowrap != nowrap)
+ {
+ m_nowrap = nowrap;
+ invalidate();
+ }
+}
+
void eLabel::clearForegroundColor()
{
if (m_have_foreground_color)
@@ -194,7 +206,7 @@ eSize eLabel::calculateSize()
ePtr<eTextPara> p = new eTextPara(eRect(0, 0, size().width(), size().height()));
p->setFont(m_font);
- p->renderString(m_text.empty()?0:m_text.c_str(), RS_WRAP);
+ p->renderString(m_text.empty()?0:m_text.c_str(), m_nowrap ? 0 : RS_WRAP);
eRect bbox = p->getBoundBox();
return bbox.size();
diff --git a/lib/gui/elabel.h b/lib/gui/elabel.h
index 84b2c5e4..84995ecc 100644
--- a/lib/gui/elabel.h
+++ b/lib/gui/elabel.h
@@ -28,6 +28,7 @@ public:
void setForegroundColor(const gRGB &col);
void setShadowColor(const gRGB &col);
void setShadowOffset(const ePoint &offset);
+ void setNoWrap(int nowrap);
void clearForegroundColor();
eSize calculateSize();
@@ -41,6 +42,7 @@ private:
int m_have_foreground_color, m_have_shadow_color;
gRGB m_foreground_color, m_shadow_color;
ePoint m_shadow_offset;
+ int m_nowrap;
enum eLabelEvent
{