# way of having refcounted objects. So it must be in python.)
#
# It could be possible that you're calling deleteGUIscreen trough a call of
- # a PSignal. For example, you could try to call session.close() in response
+ # a PSignal. For example, you could try to call screen.doClose() in response
# to a Button::click. This will fail. (It wouldn't work anyway, as you would
# remove a dialog while running it. It never worked - enigma1 just set a
# per-mainloop variable on eWidget::close() to leave the exec()...)
if (i != colorcache.end())
return i->second;
gLookup &n=colorcache.insert(std::pair<fntColorCacheKey,gLookup>(key,gLookup())).first->second;
- eDebug("[FONT] creating new font color cache entry %02x%02x%02x%02x .. %02x%02x%02x%02x", start.a, start.r, start.g, start.b,
- end.a, end.r, end.g, end.b);
+// eDebug("[FONT] creating new font color cache entry %02x%02x%02x%02x .. %02x%02x%02x%02x", start.a, start.r, start.g, start.b,
+// end.a, end.r, end.g, end.b);
n.build(16, pal, start, end);
- for (int i=0; i<16; i++)
- eDebugNoNewLine("%02x|%02x%02x%02x%02x ", (int)n.lookup[i], pal.data[n.lookup[i]].a, pal.data[n.lookup[i]].r, pal.data[n.lookup[i]].g, pal.data[n.lookup[i]].b);
- eDebug("");
+// for (int i=0; i<16; i++)
+// eDebugNoNewLine("%02x|%02x%02x%02x%02x ", (int)n.lookup[i], pal.data[n.lookup[i]].a, pal.data[n.lookup[i]].r, pal.data[n.lookup[i]].g, pal.data[n.lookup[i]].b);
+// eDebug("");
return n;
}
// for debugging use:
- #define SYNC_PAINT
+// #define SYNC_PAINT
#include <unistd.h>
#ifndef SYNC_PAINT
#include <pthread.h>
if (!getStyle(style))
{
const eSize &new_size = *static_cast<eSize*>(data);
- eDebug("eWindow::evtWillChangeSize to %d %d", new_size.width(), new_size.height());
+// eDebug("eWindow::evtWillChangeSize to %d %d", new_size.width(), new_size.height());
style->handleNewSize(this, new_size);
}
break;
void eWindowStyleSimple::handleNewSize(eWindow *wnd, const eSize &size)
{
- eDebug("handle new size: %d x %d", size.width(), size.height());
+// eDebug("handle new size: %d x %d", size.width(), size.height());
eWidget *child = wnd->child();
# do global
screens["global"](components)
-# test our screens
-components["$001"] = screens["testDialog"]()
-
-#print "*** classes:"
-#dump(screens)
-#
-#print "*** instances:"
-#dump(components)
-
# display
class OutputDevice:
self.delayTimer.timeout.get().append(self.processDelay)
self.currentDialog = None
+
+ self.dialogStack = [ ]
def processDelay(self):
self.currentDialog.doClose()
del self.currentDialog
del self.currentWindow
- self.open(screens["testDialog"]())
-
+ if len(self.dialogStack):
+ (self.currentDialog, self.currentWindow) = self.dialogStack.pop()
+ self.currentWindow.show()
+
def open(self, screen):
+ if self.currentDialog:
+ self.dialogStack.append((self.currentDialog, self.currentWindow))
+ self.currentWindow.hide()
+
self.currentDialog = screen
screen.session = self
session = Session()
session.desktop = getDesktop()
- session.open(screens["clockDisplay"](components["clock"]))
-# session.open(screens["testDialog"]())
+# session.open(screens["clockDisplay"](components["clock"]))
+ session.open(screens["testDialog"]())
# simple reason for this helper function: we want to call the currently
# active "okbutton", even when we changed the dialog
selection[1]()
def goMain(self):
-# self.close(0)
- self["title"].setText("you selected the main menu!");
+ self.session.open(screens["mainMenu"]())
def goEmu(self):
# self.close(1)
- self["title"].setText("EMUs ARE ILLEGAL AND NOT SUPPORTED!");
+ self["title"].setText("EMUs ARE ILLEGAL AND NOT SUPPORTED!")
def goTimeshift(self):
# self.close(2)
- self["title"].setText("JUST PRESS THE YELLOW BUTTON!");
+ self["title"].setText("JUST PRESS THE YELLOW BUTTON!")
def goHDTV(self):
# self.close(3)
- self["title"].setText("HDTV GREEN FLASHES: ENABLED");
+ self["title"].setText("HDTV GREEN FLASHES: ENABLED")
+
+ def goClock(self):
+ self.session.open(screens["clockDisplay"](Clock()))
def __init__(self):
GUISkin.__init__(self)
("MAIN MENU", self.goMain),
("EMU SETUP", self.goEmu),
("TIMESHIFT SETUP", self.goTimeshift),
- ("HDTV PIP CONFIG", self.goHDTV)
+ ("HDTV PIP CONFIG", self.goHDTV),
+ ("wie spaet ists?!", self.goClock)
])
-
-class MainMenu(Screen):
+class mainMenu(Screen):
def __init__(self):
GUISkin.__init__(self)
- self["ok"] = Button("ok")
- self["ok"].onClick = [ self.close ]
+ self["title"] = Header("this is the\nMAIN MENU !!!");
+ self["okbutton"] = Button("ok")
+ self["okbutton"].onClick = [ self.close ]
# a clock display dialog
class clockDisplay(Screen):
def okbutton(self):
- print "clockDisplay close"
-
self.session.close()
def __init__(self, clock):
self["okbutton"] = b
self["title"] = Header("clock dialog: here you see the current uhrzeit!")
-# defined screens
+# defined screens (evtl. kann man sich das sparen, ich seh den sinn gerade nicht mehr)
screens = {
"global": doGlobal,
"testDialog": testDialog,
- "clockDisplay": clockDisplay }
+ "clockDisplay": clockDisplay ,
+ "mainMenu": mainMenu }
"""
<skin>
<screen name="testDialog">
- <widget name="okbutton" position="10,120" size="280,40" />
+ <widget name="okbutton" position="10,190" size="280,50" />
<widget name="title" position="10,10" size="280,20" />
- <widget name="menu" position="10,30" size="280,90" />
+ <widget name="menu" position="10,30" size="280,140" />
</screen>
<screen name="clockDisplay" position="300,100" size="300,300">
<widget name="okbutton" position="10,10" size="280,40" />
<widget name="title" position="10,120" size="280,50" />
<widget name="theClock" position="10,60" size="280,50" />
</screen>
+ <screen name="mainMenu" position="300,100" size="300,300">
+ <widget name="title" position="10,10" size="280,80" />
+ <widget name="okbutton" position="10,190" size="280,50" />
+ </screen>
</skin>
""")
if x.getAttribute('name') == name:
myscreen = x
- assert myscreen != None, "no skin for screen " + name + " found!"
-
- print "ok, found screen.."
+ assert myscreen != None, "no skin for screen '" + name + "' found!"
# now walk all widgets
for widget in myscreen.getElementsByTagName("widget"):
- name = widget.getAttribute('name')
- if name == None:
+ wname = widget.getAttribute('name')
+ if wname == None:
print "widget has no name!"
continue
# get corresponding gui object
- guiObject = screen.data[name]["instance"]
+ try:
+ guiObject = screen.data[wname]["instance"]
+ except:
+ raise str("component with name '" + wname + "' was not found in skin of screen '" + name + "'!")
+
applyAttributes(guiObject, widget)