import ui, dbg, app, constInfo, wndMgr, grp, player, net, grpImage, time, event class Dialog1(ui.Window): def __init__(self): ui.Window.__init__(self) self.BuildWindow() def __del__(self): ui.Window.__del__(self) def BuildWindow(self): self.Board = ui.BoardWithTitleBar() self.Board.SetSize(650, 300) self.Board.SetCenterPosition() self.Board.AddFlag('movable') self.Board.AddFlag('float') self.Board.SetTitleName('Calendarul Evenimentelor') self.Board.SetCloseEvent(self.Close) #self.Board.Show() self.__BuildKeyDict() self.comp = Component() b = self.Board ##Ora eveniment h1 = '|cff42dff4|h20:30' h2 = '|cff42dff4|h21:30' h3 = '|cff42dff4|h22:00' h4 = '|cff42dff4|h16:30' h5 = '|cff42dff4|h17:30' h6 = '|cff42dff4|h18:00' h7 = '|cff42dff4|h22:30' ##Nume event ev1 = '|cff6BFF33|hOX' ev2 = '|cff6BFF33|hHide' ev3 = '|cff6BFF33|hTanaka' ev4 = '|cff6BFF33|hPVP' ##Numar de runde r0 = '|cffff4444|hInactiv' r1 = '|cffffa500|h1' r2 = '|cff42dff4|h2' r3 = '|cffff7f50|h3' ## Culori info ## galben = |cffffa500|h ## cian = |cff42dff4|h ## rosu = |cffff4444|h ## verde = |cff6BFF33|h ## mov = |cffff7f50|h ## blue = |cff3B5998|h self.hData = self.comp.ComboBox(b, '|cffffa500|hZiua', 23, 35, 70) self.Start1 = self.comp.ComboBox(b, '|cff42dff4|hOra', 108, 35, 70)#1 galben self.Start2 = self.comp.ComboBox(b, '|cff42dff4|hOra', 458, 35, 70)#2 cian self.Event1 = self.comp.ComboBox(b, '|cff6BFF33|hEveniment', 193, 35, 70)#1 galben self.Event2 = self.comp.ComboBox(b, '|cff6BFF33|hEveniment', 373, 35, 70)#2 cian self.Runde1 = self.comp.ComboBox(b, '|cffff7f50|hNumar runde', 288, 35, 70)#1 galben self.Runde2 = self.comp.ComboBox(b, '|cffff7f50|hNumar runde', 543, 35, 70)#2 cian self.desc = self.comp.TextLine(b, '|cffffa500|h==Acest calendar prezinta o lista de eventuri, cu titlu informativ.==', 200, 260) self.desc1 = self.comp.TextLine(b, '|cffffa500|h==Eventurile prezentate, pot diferi ca ora si sustinere.==', 200, 270) self.desc2 = self.comp.TextLine(b, '|cff42dff4|h**Echipa Metin2NumeServer**', 250, 280) self.lun = self.comp.ComboBox(b, '|cff3B5998|hLuni', 23, 72, 70) # galben self.mar = self.comp.ComboBox(b, '|cff3B5998|hMarti', 23, 99, 70) # galben self.mie = self.comp.ComboBox(b, '|cff3B5998|hMiercuri', 23, 126, 70) # galben self.joi = self.comp.ComboBox(b, '|cff3B5998|hJoi', 23, 153, 70) # galben self.vin = self.comp.ComboBox(b, '|cff3B5998|hVineri', 23, 180, 70) # galben self.sam = self.comp.ComboBox(b, '|cff3B5998|hSambata', 23, 207, 70) # galben self.dum = self.comp.ComboBox(b, '|cffff4444|hDuminica', 23, 234, 70) # rosu self.ev1_ora_lun = self.comp.ComboBox(b, h1, 108, 72, 70) self.ev1_ora_mar = self.comp.ComboBox(b, h1, 108, 99, 70) self.ev1_ora_mie = self.comp.ComboBox(b, h1, 108, 126, 70) self.ev1_ora_joi = self.comp.ComboBox(b, h1, 108, 153, 70) self.ev1_ora_vin = self.comp.ComboBox(b, h1, 108, 180, 70) self.ev1_ora_sam = self.comp.ComboBox(b, h1, 108, 207, 70) self.ev1_ora_dum = self.comp.ComboBox(b, h1, 108, 234, 70) ## event1 self.ev1_lun = self.comp.ComboBox(b, ev1, 193, 72, 70) self.ev1_mar = self.comp.ComboBox(b, ev3, 193, 99, 70) self.ev1_mie = self.comp.ComboBox(b, ev1, 193, 126, 70) self.ev1_joi = self.comp.ComboBox(b, ev3, 193, 153, 70) self.ev1_vin = self.comp.ComboBox(b, ev2, 193, 180, 70) self.ev1_sam = self.comp.ComboBox(b, ev1, 193, 207, 70) self.ev1_dum = self.comp.ComboBox(b, ev1, 193, 234, 70) ## Numar runde ev1 self.ev1_n1_runde = self.comp.ComboBox(b, r1, 288, 72, 70) self.ev1_n2_runde = self.comp.ComboBox(b, r1, 288, 99, 70) self.ev1_n3_runde = self.comp.ComboBox(b, r1, 288, 126, 70) self.ev1_n4_runde = self.comp.ComboBox(b, r0, 288, 153, 70) self.ev1_n5_runde = self.comp.ComboBox(b, r1, 288, 180, 70) self.ev1_n6_runde = self.comp.ComboBox(b, r1, 288, 207, 70) self.ev1_n7_runde = self.comp.ComboBox(b, r2, 288, 234, 70) ## event 2 self.ev2_lun = self.comp.ComboBox(b, ev1, 373, 72, 70) self.ev2_mar = self.comp.ComboBox(b, ev3, 373, 99, 70) self.ev2_mie = self.comp.ComboBox(b, ev1, 373, 126, 70) self.ev2_joi = self.comp.ComboBox(b, ev3, 373, 153, 70) self.ev2_vin = self.comp.ComboBox(b, ev2, 373, 180, 70) self.ev2_sam = self.comp.ComboBox(b, ev1, 373, 207, 70) self.ev2_dum = self.comp.ComboBox(b, ev4, 373, 234, 70) ## Setari ora ev2 self.ev2_ora_lun = self.comp.ComboBox(b, h1, 458, 72, 70) self.ev2_ora_mar = self.comp.ComboBox(b, h1, 458, 99, 70) self.ev2_ora_mie = self.comp.ComboBox(b, h1, 458, 126, 70) self.ev2_ora_joi = self.comp.ComboBox(b, h1, 458, 153, 70) self.ev2_ora_vin = self.comp.ComboBox(b, h1, 458, 180, 70) self.ev2_ora_sam = self.comp.ComboBox(b, h1, 458, 207, 70) self.ev2_ora_dum = self.comp.ComboBox(b, h2, 458, 234, 70) ## Numar runde ev2 self.ev2_n1_runde = self.comp.ComboBox(b, r1, 543, 72, 70) self.ev2_n2_runde = self.comp.ComboBox(b, r1, 543, 99, 70) self.ev2_n3_runde = self.comp.ComboBox(b, r1, 543, 126, 70) self.ev2_n4_runde = self.comp.ComboBox(b, r0, 543, 153, 70) self.ev2_n5_runde = self.comp.ComboBox(b, r1, 543, 180, 70) self.ev2_n6_runde = self.comp.ComboBox(b, r1, 543, 207, 70) self.ev2_n7_runde = self.comp.ComboBox(b, r1, 543, 234, 70) def __BuildKeyDict(self): onPressKeyDict = {} onPressKeyDict[app.DIK_X] = lambda : self.OpenWindow() self.onPressKeyDict = onPressKeyDict 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 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 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 TextLine(self, parent, textlineText, x, y): textline = ui.TextLine() if parent != None: textline.SetParent(parent) textline.SetPosition(x, y) textline.SetText(textlineText) textline.Show() return textline 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 Dialog1().Show()