def show(self, ev): for item in self.parent.children: if item.state == "show": if item == self: return document.remove(item.div) item.state = "hide" if self.state == "hide": left = ev.target.left top = ev.target.top + ev.target.height self.div = html.DIV(Class="ui-widget ui-menu-sublist", style=dict(position='absolute', left=left, top=top, zIndex=99)) for item in self.items: line = html.DIV(item[0], Class="ui-menu-subitem") if item[1] is not None: line.bind('click', item[1]) self.div <= line self.state = "show" self.div.style.borderWidth = "1px" document <= self.div else: document.remove(self.div) self.state = "hide"
def show(self, ev): for item in self.parent.children: if item.state == "show": if item == self: return document.remove(item.div) item.state = "hide" if self.state == "hide": left = ev.target.left top = ev.target.top+ev.target.height self.div = html.DIV(Class="ui-widget ui-menu-sublist", style=dict(position='absolute', left=left, top=top, zIndex=99)) for item in self.items: line = html.DIV(item[0], Class="ui-menu-subitem") if item[1] is not None: line.bind('click', item[1]) self.div <= line self.state = "show" self.div.style.borderWidth = "1px" document <= self.div else: document.remove(self.div) self.state = "hide"
def yes(self, ev): document.remove(self._div_shell) self.action_if_yes(self)
def cancel(self, ev): document.remove(self._div_shell)
def ok(self, ev): ix = self._div_shell.get(selector='SELECT')[0].selectedIndex document.remove(self._div_shell) self.action(self.options[ix])
def ok(self, ev): self.result = self._div_shell.get(selector='INPUT')[0].value self.action(self.result) document.remove(self._div_shell)
def no(self, ev): document.remove(self._div_shell) if self.action_if_no is not None: self.action_if_no(self)
def close(self): self.item.style.borderColor = '#FFF' document.remove(self.menu)
def leave(self, ev): for child in self.children: if child.state == 'show': document.remove(child.div) child.state = 'hide' self.active = False
def dialog_close(e): #del document[self._div_shell.id] document.remove(self)