m_have_foreground_color = 0;
m_have_shadow_color = 0;
+
+ m_nowrap = 0;
}
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);
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)
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();
from Components.Converter.Converter import Converter
from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
from Tools.Import import my_import
+
from Tools.XMLTools import elementsWithTag, mergeText
colorNames = dict()
guiObject.setPointer({"pointer": 0, "seek_pointer": 1}[attrib], ptr.__deref__(), pos)
elif attrib == 'shadowOffset':
guiObject.setShadowOffset(parsePosition(value))
+ elif attrib == 'noWrap':
+ guiObject.setNoWrap(1)
else:
raise "unsupported attribute " + attrib + "=" + value
except int:
return None, None
def readSkin(screen, skin, name, desktop):
+
myscreen, path = lookupScreen(name)
# otherwise try embedded skin
screen.additionalWidgets = [ ]
screen.renderer = [ ]
+ visited_components = set()
+
# now walk all widgets
for widget in elementsWithTag(myscreen.childNodes, "widget"):
# ok, we either have 1:1-mapped widgets ('old style'), or 1:n-mapped
wname = widget.getAttribute('name')
wsource = widget.getAttribute('source')
+
if wname is None and wsource is None:
print "widget has no name and no source!"
continue
if wname:
+ visited_components.add(wname)
+
# get corresponding 'gui' object
try:
attributes = screen[wname].skinAttributes = [ ]
raise SkinError("component with name '" + wname + "' was not found in skin of screen '" + name + "'!")
# assert screen[wname] is not Source
-
+
# and collect attributes for this
collectAttributes(attributes, widget, skin_path_prefix, ignore=['name'])
elif wsource:
screen.renderer.append(renderer)
+ from Components.GUIComponent import GUIComponent
+ nonvisited_components = [x for x in set(screen.keys()) - visited_components if isinstance(x, GUIComponent)]
+
+ assert not nonvisited_components, "the following components in %s don't have a skin entry: %s" % (name, ', '.join(nonvisited_components))
+
# now walk additional objects
for widget in elementsWithTag(myscreen.childNodes, lambda x: x != "widget"):
if widget.tagName == "applet":