# Generated with Gui Editor by KaMeR1337 ; www.metin2mod.tk import ui import dbg import app, locale, uiToolTip, player, net, item, stringCommander, mouseModule, event def NumberToMoneyString(n) : if n <= 0 : return "0" return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), "") def SecondToDHM(time): second = int(time % 60) minute = int((time / 60) % 60) hour = int((time / 60) / 60) % 24 day = int(int((time / 60) / 60) / 24) text = "" if day > 0: text += str(day) + locale.DAY text += " " if hour > 0: text += str(hour) + locale.HOUR text += " " if minute > 0: text += str(minute) + locale.MINUTE text += " " if second > 0: text += str(second) +" "+ locale.SECOND return text class cipka(ui.Window): def __init__(self): ui.Window.__init__(self) self.czasek= {} self.BuildWindow() self.__ServerCommand_Build() for i in xrange(6): self.czasek[i] = app.GetGlobalTimeStamp() self.__ServerCommand_Build() self.typ1 = 0 self.xShopStart=self.yShopStart= 0 self.typ2 = 0 self.questi = 0 self.iteminfo = {} def __del__(self): ui.Window.__del__(self) def BuildWindow(self): self.hyperlinkItemTooltip = uiToolTip.magazynToolTip() self.hyperlinkItemTooltip.Hide() self.Board = ui.BoardWithTitleBar() self.Board.SetSize(642, 502) self.Board.SetCenterPosition() self.Board.AddFlag('movable') self.Board.AddFlag('float') self.Board.SetTitleName('Dom Aukcyjny') self.Board.SetCloseEvent(self.Close) self.__BuildKeyDict() self.comp = Component() self.gg = self.comp.ThinBoard(self.Board, FALSE, 19, 39, 141, 440-105, FALSE) self.gg2 = self.comp.ThinBoard(self.Board, FALSE, 19, 39+440-105+25+15-27, 141, 70+25, FALSE) self.dupa = self.comp.ThinBoard(self.Board, FALSE, 177, 429-16, 205, 52+16, FALSE) self.b = self.comp.ThinBoard(self.Board, FALSE, 177, 41, 446, 404, FALSE) self.b.Corners[1].Hide() self.b.Lines[3].SetPosition(202, 404-16) self.b.Lines[3].SetRenderingRect(0, 0, 13.4, 0) self.b2 = self.comp.ThinBoard(self.Board, FALSE, 177, 41, 446, 404, FALSE) self.b2.Corners[1].Hide() self.b2.Lines[3].SetPosition(202, 404-16) self.b2.Lines[3].SetRenderingRect(0, 0, 13.4, 0) self.dupa.Corners[0].Hide() self.dupa.Corners[2].Hide() self.txdd88 = self.comp.HorizontalBar(self.gg, 11, 11, 120-3) self.dupa.Lines[2].Hide() #self.dupa.Lines[1].SetPosition(205-16, 32) #self.dupa.Lines[1].SetRenderingRect(0, 0, 0, 0.7) #self.b.Lines[3].Hide() self.ceny = {} self.dupa.Hide() self.dupa.Show() #self.dupa.Lines[3].SetPosition(a[0], a[1]-50) self.func = vars(self) self.kat = "Nowe!!!", "Bronie", "Zbroje", "Tarcze", "Kolczyki", "Buty", "Naszyjniki", "Pasy", "Hełmy", "Bransolety", "Kostiumy i fryzury", "Inne" self.kat2 = "Dodaj Przedmiot", "Twoje Przemioty", "Licytowane", "Tarcjze", "Kolczyki", "Buty", "Naszyjniki", "Pasy", "Hełmy", "Branzolety", "Kostiumy i fryzury", "Inne" #self.func["a0"] = self.comp.Button(self.Board, 'btn769', '', 44, 109+27*i, self.btn769_func, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub') for i in xrange(12): self.func[self.kat[i]] = self.comp.Button(self.Board, self.kat[i], '', 44, 109-39+25*i, (lambda arg = i: self.btn769_func2(arg)), 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub') for i in xrange(3): self.func[self.kat2[i]] = self.comp.Button(self.Board, self.kat2[i], '', 44, 439-41+25*i, self.btn769_func, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub') self.slotbar_edit63, self.edit63 = self.comp.EditLine(self.Board, '', 530, 456, 85, 15, 15) self.slotbar_edit664, self.edit664 = self.comp.EditLine(self.Board, '', 412, 457, 85, 15, 15) self.wndMoney = self.comp.TextLine(self.slotbar_edit664, "::", 3, 2, self.comp.RGB(255, 255, 255)) self.wndtsm = self.comp.TextLine(self.slotbar_edit63, "", 3, 2, self.comp.RGB(255, 255, 255)) self.edit63.Hide() self.edit664.Hide() self.sdsd = self.comp.ExpandedImage(self.slotbar_edit664 , -18, -0, "d:/ymir work/ui/game/windows/money_icon.sub") self.sd2sd = self.comp.ExpandedImage(self.slotbar_edit63 , -18, -0, "sm.tga") i2 = 0 i3 = 0 self.slotbar_strona, self.strona = self.comp.EditLine(self.dupa, '', 50, 37, 85, 15, 15) self.strona.Hide() self.slotbar_stronatxt= self.comp.TextLine(self.slotbar_strona, "Strona 2/3", 7, 1, self.comp.RGB(244, 202, 22)) self.func["stronaminus"] = self.comp.Button(self.dupa, '', '', 50-15, 38, (lambda arg = i: self.podbijam(arg)), "d:/ymir work/ui/game/windows/btn_minus_up.sub", 'd:/ymir work/ui/game/windows/btn_minus_over.sub', 'd:/ymir work/ui/game/windows/btn_minus_down.sub') self.func["stronaplus"] = self.comp.Button(self.dupa, '', '', 50+90, 38, (lambda arg = i: self.podbijam(arg)), "d:/ymir work/ui/game/windows/btn_plus_up.sub", 'd:/ymir work/ui/game/windows/btn_plus_over.sub', 'd:/ymir work/ui/game/windows/btn_plus_down.sub') self.czasek= {} self.czasek[i] =None self.func["sss"] = self.comp.TextLine(self.txdd88, "Kategorie", (120-3)/2, 2, self.comp.RGB(244, 202, 22)) self.func["sss"].SetHorizontalAlignCenter() for i in xrange(6): self.func["itemtlo"+str(i)] = self.item(i, i2, i3) if i2 == 1: i2=0 i3+=1 else: i2 =1 self.koszt0.OnMouseLeftButtonUp = self.OnMouseLeftButtonDown0 self.koszt1.OnMouseLeftButtonUp = self.OnMouseLeftButtonDown1 self.koszt2.OnMouseLeftButtonUp = self.OnMouseLeftButtonDown2 self.koszt3.OnMouseLeftButtonUp = self.OnMouseLeftButtonDown3 self.koszt4.OnMouseLeftButtonUp = self.OnMouseLeftButtonDown4 self.koszt5.OnMouseLeftButtonUp = self.OnMouseLeftButtonDown5 self.asdasd() def item(self, i, i2, i3): print 15+(210*i2), 15+(118*i3) tlo = self.comp.Bar(self.b, FALSE, 15+(210*i2), 15+(128*i3), 200, 110, FALSE, 0x10aaaacc) self.func["itemslot"+str(i)] = ui.SlotWindow() self.func["itemslot"+str(i)].SetParent(tlo) self.func["itemslot"+str(i)].SetSize(32, 96) self.func["itemslot"+str(i)].SetPosition(5, 5) self.func["itemslot"+str(i)].AppendSlot(13, 0, 32, 1, 1) self.func["itemslot"+str(i)].AppendSlot(12, 0, 64, 1, 1) self.func["itemslot"+str(i)].AppendSlot(i, 0, 0, 32, 96) self.func["itemslot"+str(i)].SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0) #self.func["itemslot"+str(i)].SetOverInItemEvent(ui.__mem_func__(self.SlotItemUse)) #self.func["itemslot"+str(i)].SetOverOutItemEvent(ui.__mem_func__(self.SlotItemUse)) self.func["itemslot"+str(i)].SetOverInItemEvent(ui.__mem_func__(self.OverInSlot)) self.func["itemslot"+str(i)].SetOverOutItemEvent(ui.__mem_func__(self.OverOutSlot)) self.func["itemslot"+str(i)].RefreshSlot() self.func["itemslot"+str(i)].Show() self.czasek[i] = app.GetGlobalTimeStamp() self.func["top"+str(i)] = self.comp.HorizontalBar(tlo, 5+39, 7, 150-3) self.func["btn"+str(i)] = self.comp.Button(tlo, 'Licytuj', '', 5+39+5, 80, self.btn925_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub') self.func["btn2"+str(i)] = self.comp.Button(tlo, 'Informacje', '', 5+39+70+5, 80, self.info, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub') self.func["title"+str(i)] = self.comp.TextLine(self.func["top"+str(i)], 'Menu', (150-3)/2, 2, self.comp.RGB(244, 202, 22)) self.func["title"+str(i)].SetHorizontalAlignCenter() self.func["kasa"+str(i)], self.func["koszt"+str(i)] = self.comp.EditLine(tlo, "", 39+70, 29, 61, 15, 15) self.func["koszt"+str(i)].SetNumberMode() #self.func["icon"+str(i)] = self.comp.ExpandedImage(self.func["kasa"+str(i)] , -18, -0, "d:/ymir work/ui/game/windows/money_icon.sub") self.func["czas"+str(i)], self.edit664 = self.comp.EditLine(tlo, 'pozostało', 4+39+3, 29+26, 146, 15, 15) self.func["time"+str(i)] = self.comp.TextLine(self.func["czas"+str(i)], 'Cena :', 8, 2, None) self.func["cena"+str(i)] = self.comp.TextLine(tlo, 'Cena :', 4+39+3, 30, None) self.func["plus"+str(i)] = self.comp.Button(tlo, '', '', 39+70+61+7, 30, (lambda arg = i: self.podbijam(arg)), "d:/ymir work/ui/game/windows/btn_plus_up.sub", 'd:/ymir work/ui/game/windows/btn_plus_over.sub', 'd:/ymir work/ui/game/windows/btn_plus_down.sub') self.func["icon"+str(i)] = self.comp.Button(tlo, '', '', 39+70-18, 29, self.btn925_func, "d:/ymir work/ui/game/windows/money_icon.sub", 'd:/ymir work/ui/game/windows/money_icon.sub', 'd:/ymir work/ui/game/windows/money_icon.sub') self.func["icon"+str(i)].SetToolTipText("Yang", 0, 12) return tlo def asdasd(self): i = "dane" self.func["itemslot"+str(i)] = ui.SlotWindow() self.func["itemslot"+str(i)].SetParent(self.b2) self.func["itemslot"+str(i)].SetSize(32, 96) self.func["itemslot"+str(i)].SetPosition(15, 10) self.func["itemslot"+str(i)].AppendSlot(13, 0, 32, 1, 1) self.func["itemslot"+str(i)].AppendSlot(12, 0, 64, 1, 1) self.func["itemslot"+str(i)].AppendSlot(12345, 0, 0, 32, 96) self.func["itemslot"+str(i)].SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0) #self.func["itemslot"+str(i)].SetOverInItemEvent(ui.__mem_func__(self.SlotItemUse)) #self.func["itemslot"+str(i)].SetOverOutItemEvent(ui.__mem_func__(self.SlotItemUse)) self.func["itemslot"+str(i)].SetOverInItemEvent(ui.__mem_func__(self.OverInSlot)) self.func["itemslot"+str(i)].SetOverOutItemEvent(ui.__mem_func__(self.OverOutSlot)) self.func["itemslot"+str(i)].RefreshSlot() self.func["itemslot"+str(i)].Hide() self.func["top"+str(i)] = self.comp.HorizontalBar(self.b2, 54, 10, 380) self.func["title"+str(i)] = self.comp.TextLine(self.func["top"+str(i)], 'Menu', (380)/2, 2, self.comp.RGB(244, 202, 22)) self.func["title"+str(i)].SetHorizontalAlignCenter() self.topdane.Hide() self.func["txtczas"] = self.comp.TextLine(self.b2, 'Aktualna cena przedmiotu:', 53, 34, None) self.func["txtcena"] = self.comp.TextLine(self.b2, 'Pozostały czas do zakończenia aukcji:', 53, 59, None) self.func["txtkogo"] = self.comp.TextLine(self.b2, 'Właściciel przedmiotu:', 53, 84, None) self.func["cena"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'pozostało', 183, 34, 186, 15, 15) self.func["typ"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'tsm', 380, 33, 46, 15, 15) self.func["czas"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'pozostało', 231, 58, 196, 15, 15) self.func["kto"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'pozostało', 161, 84, 160, 15, 15) self.func["top2"+str(i)] = self.comp.HorizontalBar(self.b2, 15, 130, 400) self.func["pw"] = self.comp.Button(self.b2, "Szept", '', 342, 83, self.btn769_func, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub') self.b2.Hide() self.func["wruc"] = self.comp.Button(self.dupa, "<< Wróć", '', 14, 26, self.btn769_func, 'd:/ymir work/ui/public/xlarge_button_01.sub', 'd:/ymir work/ui/public/xlarge_button_02.sub', 'd:/ymir work/ui/public/xlarge_button_03.sub') self.wruc.Hide() for i in xrange(8): self.func["akto"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'pozostało', 16, 181+27*i, 100, 15, 15) self.func["akiedy"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'pozostało', 129, 181+27*i, 150, 15, 15) self.func["aile"+str(i)], self.edit664 = self.comp.EditLine(self.b2, 'pozostało', 291, 181+27*i, 120, 15, 15) self.edit664.Hide() pass def game(self): if self.gamepy: net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self.gamepy) pass def OnUpdate(self): USE_SHOP_LIMIT_RANGE = 1000 (x, y, z) = player.GetMainCharacterPosition() if self.Board.IsShow(): if abs(x - self.xShopStart) > USE_SHOP_LIMIT_RANGE or abs(y - self.yShopStart) > USE_SHOP_LIMIT_RANGE: self.Close() a = app.GetGlobalTimeStamp() money = player.GetElk() self.wndMoney.SetText(locale.NumberToMoneyString(money)) for i in xrange(6): if self.func["itemtlo"+str(i)].IsShow(): self.func["time"+str(i)].SetText(SecondToDHM(self.czasek[i]-a)) def dane(self, id, ile, cena, typ, czas, opis): self.itemslotdane.Show() self.topdane.Show() self.cenadane.Show() self.typdane.Show() self.czasdane.Show() self.ktodane.Show() self.top2dane.Show() self.pw.Show() self.b2.Show() self.b.Hide() self.wruc.Show() self.itemslotdane.SetItemSlot(12345, int(id), int(ile)) #self.func["itemtlo"+str(i)].Show() #self.func["koszt"+str(i)].SetText(NumberToMoneyString(int(cena))) self.czasek[12345] = app.GetGlobalTimeStamp() - int(czas) self.ceny[12345] = int(cena), opis self.iteminfo[12345]= id, ile, cena, typ, czas, opis item.SelectItem(int(id)) nazwa = item.GetItemName() self.titledane.SetText(nazwa) self.txtczas.Show() pass def btn769_func(self): self.menu() self.typ1 = "1" self.typ2 = "Bronie" event.QuestButtonClick(self.questi) pass def btn769_func2(self, dd): self.menu() self.typ1 = "1" self.typ2 = self.kat[dd] event.QuestButtonClick(self.questi) pass def btn925_func(self): import aukcja reload(aukcja) pass def info(self): self.menu() self.BINARY_ServerCommand_Run("Info 13049 139 102232 TSM 21223 item:13049:0:0:0:0:3:12:27:15:39:10:48:1:49:1:0:0:0:0") def tsmile(self, ile): self.wndtsm.SetText(NumberToMoneyString(int(ile))+" TSM") pass def podbijam(self, i): nr, id, ile, cena, typ, czas, opis = self.iteminfo[i] if typ == "Yang": a = self.func["koszt"+str(i)].GetText() a = a.replace('.', '') a = a.replace(' ', '') cenak = int(a) cenak2 = int(cena) if cenak >= cenak2: nowa = (cenak2 /100)*5 ddd = cenak + nowa self.func["koszt"+str(i)].SetText(NumberToMoneyString(ddd)) else: nowa = (cenak2 /100)*5 ddd = cenak2 + nowa self.func["koszt"+str(i)].SetText(NumberToMoneyString(ddd)) else: a = self.func["koszt"+str(i)].GetText() a = a.replace('.', '') a = a.replace(' ', '') cenak = int(a) cenak2 = int(cena) if cenak >= cenak2: cenak=+1 self.func["koszt"+str(i)].SetText(NumberToMoneyString(cenak)) else: cenak2=+1 self.func["koszt"+str(i)].SetText(NumberToMoneyString(cenak2)) def OverOutSlot(self): if 0 != self.hyperlinkItemTooltip: self.hyperlinkItemTooltip.HideToolTip() def OverInSlot(self, slotNumber): if mouseModule.mouseController.isAttached(): return if 0 == self.hyperlinkItemTooltip: return hyperlink = self.iteminfo[slotNumber][6] tokens = hyperlink.split(":") self.hyperlinkItemTooltip.SetHyperlinkItem(tokens) def __BuildKeyDict(self): onPressKeyDict = {} onPressKeyDict[app.DIK_F5] = lambda : self.OpenWindow() self.onPressKeyDict = onPressKeyDict def OnMouseLeftButtonDown0(self): a = self.koszt0.GetText() a = a.replace('.', '') a = a.replace(' ', '') self.koszt0.SetText(a) def OnMouseLeftButtonDown1(self): a = self.koszt1.GetText() a = a.replace('.', '') a = a.replace(' ', '') self.koszt1.SetText(a) def OnMouseLeftButtonDown2(self): a = self.koszt2.GetText() a = a.replace('.', '') a = a.replace(' ', '') self.koszt2.SetText(a) def OnMouseLeftButtonDown3(self): a = self.koszt3.GetText() a = a.replace('.', '') a = a.replace(' ', '') self.koszt3.SetText(a) def OnMouseLeftButtonDown4(self): a = self.koszt4.GetText() a = a.replace('.', '') a = a.replace(' ', '') self.koszt4.SetText(a) def OnMouseLeftButtonDown5(self): a = self.koszt5.GetText() a = a.replace('.', '') a = a.replace(' ', '') self.koszt5.SetText(a) def OnMouseLeftButtonDown6(self): print 7 def OnKeyDown(self, key): try: self.onPressKeyDict[key]() except KeyError: pass except: raise return TRUE def OpenWindow(self): if self.Board.IsShow(): self.Board.Hide() else: self.Board.Show() def menu(self): self.slotbar_strona.Hide() self.topdane.Hide() self.itemslotdane.Hide() self.txtczas.Hide() self.cenadane.Hide() self.typdane.Hide() self.czasdane.Hide() self.ktodane.Hide() self.top2dane.Hide() self.b2.Hide() self.pw.Hide() self.wruc.Hide() for i in xrange(6): self.func["itemtlo"+str(i)].Hide() def przedmiot(self, nr, id, ile, cena, typ, czas, opis): self.b.Show() for i in xrange(6): if not self.func["itemtlo"+str(i)].IsShow(): self.iteminfo[i] = nr, id, ile, cena, typ, czas, opis if int(ile) == 1: ile = "0" self.func["itemslot"+str(i)].SetItemSlot(i, int(id), int(ile)) self.func["itemtlo"+str(i)].Show() if typ == "TSM": self.func["icon"+str(i)].SetUpVisual("sm.tga") self.func["icon"+str(i)].SetOverVisual("sm.tga") self.func["icon"+str(i)].SetDownVisual("sm.tga") else: self.func["icon"+str(i)].SetUpVisual("d:/ymir work/ui/game/windows/money_icon.sub") self.func["icon"+str(i)].SetOverVisual("d:/ymir work/ui/game/windows/money_icon.sub") self.func["icon"+str(i)].SetDownVisual("d:/ymir work/ui/game/windows/money_icon.sub") self.func["icon"+str(i)].SetToolTipText(typ, 0, 12) self.func["koszt"+str(i)].SetText(NumberToMoneyString(int(cena))) self.czasek[int(i)] = app.GetGlobalTimeStamp() - int(czas) self.ceny[int(i)] = int(cena), opis item.SelectItem(int(id)) nazwa = item.GetItemName() self.func["title"+str(i)].SetText(nazwa) break pass def cmdchat(self, gamepy): self.gamepy = gamepy net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self) pass def Show2(self): self.Board.Show() self.Show() (self.xShopStart, self.yShopStart, z) = player.GetMainCharacterPosition() def __ServerCommand_Build(self): serverCommandList={ "open" : self.Show2, "additem" : self.przedmiot, "Info" : self.dane, "typ1" : self.typ1, "typ2" : self.typ2, "tsmile" : self.tsmile, "questid" : self.quest, "gamecmdchat" : self.game, } self.serverCommander=stringCommander.Analyzer() for serverCommandItem in serverCommandList.items(): self.serverCommander.SAFE_RegisterCallBack( serverCommandItem[0], serverCommandItem[1] ) def typ1(self): net.SendQuestInputStringPacket(str(self.typ1)) def typ2(self): net.SendQuestInputStringPacket(str(self.typ2)) def quest(self, id): self.questi = int(id) pass def BINARY_ServerCommand_Run(self, line): #dbg.TraceError(line) try: print str(line) return self.serverCommander.Run(line) except RuntimeError, msg: dbg.TraceError def Close(self): self.Board.Hide() class Component: def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual): button = ui.Button() if parent != None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(UpVisual) button.SetOverVisual(OverVisual) button.SetDownVisual(DownVisual) button.SetText(buttonName) #button.SetToolTipText(tooltipText) button.Show() button.SetEvent(func) return button def HorizontalBar(self, parent, x, y, width): bar = ui.HorizontalBar() if parent != None: bar.SetParent(parent) bar.SetPosition(x, y) bar.Create(width) bar.Show() return bar def line(self, parent, x, y, width, heigh): linia = ui.Line() linia.SetParent(parent) linia.SetSize(width, heigh) linia.SetPosition(x, y) linia.SetColor(0x40999999) linia.Show() return linia def Bar(self, parent, moveable, x, y, width, heigh, center, color): bar = ui.Bar() if parent != None: bar.SetParent(parent) if moveable == TRUE: bar.AddFlag('movable') bar.AddFlag('float') bar.SetColor(color) bar.SetSize(width, heigh) bar.SetPosition(x, y) if center == TRUE: bar.SetCenterPosition() bar.Show() return bar def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual): button = ui.ToggleButton() if parent != None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(UpVisual) button.SetOverVisual(OverVisual) button.SetDownVisual(DownVisual) button.SetText(buttonName) button.SetToolTipText(tooltipText) button.Show() button.SetToggleUpEvent(funcUp) button.SetToggleDownEvent(funcDown) return button def EditLine(self, parent, editlineText, x, y, width, heigh, max): SlotBar = ui.SlotBar() if parent != None: SlotBar.SetParent(parent) SlotBar.SetSize(width, heigh) SlotBar.SetPosition(x, y) SlotBar.Show() Value = ui.EditLine() Value.SetParent(SlotBar) Value.SetSize(width, heigh) Value.SetPosition(1, 1) Value.SetMax(max) Value.SetLimitWidth(width) Value.SetMultiLine() Value.SetText(editlineText) Value.Show() return SlotBar, Value def TextLine(self, parent, textlineText, x, y, color): textline = ui.TextLine() if parent != None: textline.SetParent(parent) textline.SetPosition(x, y) if color != None: textline.SetFontColor(color[0], color[1], color[2]) textline.SetText(textlineText) textline.Show() return textline def RGB(self, r, g, b): return (r*255, g*255, b*255) def SliderBar(self, parent, sliderPos, func, x, y): Slider = ui.SliderBar() if parent != None: Slider.SetParent(parent) Slider.SetPosition(x, y) Slider.SetSliderPos(sliderPos / 100) Slider.Show() Slider.SetEvent(func) return Slider def ExpandedImage(self, parent, x, y, img): image = ui.ExpandedImageBox() if parent != None: image.SetParent(parent) image.SetPosition(x, y) image.LoadImage(img) image.Show() return image def ComboBox(self, parent, text, x, y, width): combo = ui.ComboBox() if parent != None: combo.SetParent(parent) combo.SetPosition(x, y) combo.SetSize(width, 15) combo.SetCurrentItem(text) combo.Show() return combo def ThinBoard(self, parent, moveable, x, y, width, heigh, center): thin = ui.ThinBoard() if parent != None: thin.SetParent(parent) if moveable == TRUE: thin.AddFlag('movable') thin.AddFlag('float') thin.SetSize(width, heigh) thin.SetPosition(x, y) if center == TRUE: thin.SetCenterPosition() thin.Show() return thin def Gauge(self, parent, width, color, x, y): gauge = ui.Gauge() if parent != None: gauge.SetParent(parent) gauge.SetPosition(x, y) gauge.MakeGauge(width, color) gauge.Show() return gauge def ListBoxEx(self, parent, x, y, width, heigh): bar = ui.Bar() if parent != None: bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(width, heigh) bar.SetColor(0x77000000) bar.Show() ListBox=ui.ListBoxEx() ListBox.SetParent(bar) ListBox.SetPosition(0, 0) ListBox.SetSize(width, heigh) ListBox.Show() scroll = ui.ScrollBar() scroll.SetParent(ListBox) scroll.SetPosition(width-15, 0) scroll.SetScrollBarSize(heigh) scroll.Show() ListBox.SetScrollBar(scroll) return bar, ListBox a = cipka() a.Show() a.Show2()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question