def __init__(self, value="", **params): self.ev_manager = params['ev_manager'] self.ev_manager.register_listener(self) self.highs_table = config.current_highs self.score = params['score'] self.data = params['data'] title = gui.Label("New High Score!") main = gui.Table() self.gui_form = gui.Form() main.tr() main.td(gui.Label("Please enter your name:")) main.tr() self.name_field = gui.Input(value=value, name='player_name') main.td(self.name_field) main.tr() submit_button = gui.Button("Submit") main.td(submit_button) submit_button.connect(gui.CLICK, self.submit, None) submit_button.connect(gui.CLOSE, self.close, None) gui.Dialog.__init__(self, title, main) self.ev_manager.post(FreezeCards())
def __init__(self, **params): title = gui.Label("Settings") self.value = gui.Form() self.container = gui.Container() table = gui.Table() table.tr() self.sensors_img = gui.Image(p('icons/sensors.jpg')) table.td(self.sensors_img, cellspan=3) spacer = gui.Image(p('icons/choose_port.png')) self.box = gui.ScrollArea(spacer) table.tr() table.td(self.box, style={'border': 1}) table.tr() table.td(self.build_background_select(), style={ 'padding_top': 10, 'padding_bottom': 10 }) save = gui.Button('Save') save.connect(gui.CLICK, self.send, gui.CHANGE) table.tr() table.td(save, align=1) self.container.add(table, 0, 0) self.init_ports() gui.Dialog.__init__(self, title, self.container)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.engine = None self._data = '' self._count = 1 self.focused = False self.tr() self.chatMsg = gui.Input(size=52, focusable=False) self.chatMsg.connect(gui.KEYDOWN, self.lkey) self.td(self.chatMsg) self.tr() self.chatList = gui.List(width=480, height=170) self.td(self.chatList) self.tr() class Hack(gui.Spacer): def resize(self, width=None, height=None): #self.chatListBox.set_vertical_scroll(65535) return 1, 1 self.td(Hack(1, 1))
def __init__(self, engine, **params): gui.Container.__init__(self, **params) self.engine = engine self.value = gui.Form() # item editor state self.itemNum = None # dialogs # menu title self.tTitle = gui.Table(width=272, height=32) self.tTitle.tr() self.tTitle.td(gui.Label("NPC Editor", name='npcTitle', color=UI_FONT_COLOR)) # content self.tContent = gui.Table(width=272, height=123) self.tContent.tr() self.tContent.tr() self.tContent.td(gui.Label('Name:', color=UI_FONT_COLOR), colspan=2) self.tContent.tr() self.tContent.td(gui.Input('', size=26, name='inpNpcName'), colspan=2, valign=-1) self.tContent.tr() self.tContent.td(gui.Label('Behaviour:', color=UI_FONT_COLOR), colspan=2) self.tContent.tr() e = gui.Select(name='selBehaviour') e.add('Attack on sight', 0) e.add('Attack when attacked', 1) e.add('Friendly', 2) e.add('Shopkeeper', 3) e.add('Guard', 4) e.value = 0 e.connect(gui.CHANGE, self.updateType, None) self.tContent.td(e, colspan=2) # data input self.tData = gui.Table(width=272, height=75) # bottom buttons self.tBottom = gui.Table(width=272, height=200) self.tBottom.tr() self.saveButton = gui.Button("Add NPC", width=100, height=40) self.saveButton .connect(gui.CLICK, self.saveNPC, None) self.tBottom.td(self.saveButton) e = gui.Button("Cancel", width=100, height=40) e.connect(gui.CLICK, self.cancel, None) self.tBottom.td(e) self.add(self.tTitle, 0, 0) self.add(self.tContent, 0, 100) self.add(self.tData, 0, 255) self.add(self.tBottom, 0, 368)
def __init__(self, bckg = "None"): self.bckg = bckg title = gui.Label("Set background") self.value = gui.Form() self.container = gui.Container() table = gui.Table() table.tr() table.td(self.build_background_select(), style={'padding_top': 10, 'padding_bottom': 10}) save = gui.Button('Save') save.connect(gui.CLICK, self.send, gui.CHANGE) table.tr() table.td(save, align=1) save_config = gui.Button('Save current configuration') save_config.connect(gui.CLICK, self.file_dialog_open, SAVE_CONFIG_EVENT) load_config = gui.Button('Load robot\'s configuration') load_config.connect(gui.CLICK, self.file_dialog_open, LOAD_CONFIG_EVENT) table.tr() table.td(save_config) table.tr() table.td(load_config) self.container.add(table, 0, 0) gui.Dialog.__init__(self, title, self.container)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.tr() self.td(gui.Label("Map ID: ", color=UI_FONT_COLOR), colspan=2) self.tr() self.inpMapID = gui.Input('', size=8, name='inpWarpMapID') self.td(self.inpMapID, colspan=2) # used for selecting the map mapDialog = MapSelectorDialog(self.inpMapID) self.tr() e = gui.Button('Choose map...') e.connect(gui.CLICK, mapDialog.openDialog, None) self.td(e, colspan=2) self.tr() self.td(gui.Spacer(10, 20)) self.tr() self.td(gui.Label("Warp-To Position", color=UI_FONT_COLOR), colspan=2) self.tr() self.td(gui.Label("X: ", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpWarpX")) self.tr() self.td(gui.Label("Y: ", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpWarpY"))
def __init__(self, bckg="None"): self.bckg = bckg title = gui.Label("Set background") self.value = gui.Form() self.container = gui.Container() table = gui.Table() table.tr() table.td(self.build_background_select(), style={ 'padding_top': 10, 'padding_bottom': 10 }) save = gui.Button('Save') save.connect(gui.CLICK, self.send, gui.CHANGE) table.tr() table.td(save, align=1) self.container.add(table, 0, 0) gui.Dialog.__init__(self, title, self.container)
def __init__(self, bckg="None", port=None, **params): self.bckg = bckg self.port = port title = gui.Label("Setting sensor for port %d" % int(self.port)) self.value = gui.Form() self.container = gui.Container() table = gui.Table() table.tr() self.sensors_img = gui.Image(p('icons/sensors.jpg')) table.td(self.sensors_img, cellspan=3) spacer = gui.Spacer(200, 100) self.box = gui.ScrollArea(spacer) table.tr() table.td(self.box, style={'border': 1}) save = gui.Button('Save') save.connect(gui.CLICK, self.send, gui.CHANGE) table.tr() table.td(save, align=1) self.container.add(table, 0, 0) self.init_ports() self.change() gui.Dialog.__init__(self, title, self.container)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.tr() self.td(gui.Label("Map Name:", color=UI_FONT_COLOR)) self.td(gui.Input("", size=16, name="inpMapName")) self.tr() self.td(gui.Label("Warp Up:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapUp")) self.tr() self.td(gui.Label("Warp Down:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapDown")) self.tr() self.td(gui.Label("Warp Left:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapLeft")) self.tr() self.td(gui.Label("Warp Right:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapRight")) self.loadProperties()
def __init__(self,settings, **params): # The framework GUI is just basically a HTML-like table # There are 2 columns right-aligned on the screen gui.Table.__init__(self,**params) self.form=gui.Form() fg = (255,255,255) # "Toggle menu" self.tr() self.td(gui.Label("F1: Toggle Menu",color=(255,0,0)),align=1,colspan=2) for slider in sliders: # "Slider title" self.tr() self.td(gui.Label(slider['text'],color=fg),align=1,colspan=2) # Create the slider self.tr() e = gui.HSlider(getattr(settings, slider['name']),slider['min'],slider['max'],size=20,width=100,height=16,name=slider['name']) self.td(e,colspan=2,align=1) # Add each of the checkboxes. for text, variable in checkboxes: self.tr() if variable == None: # Checkboxes that have no variable (i.e., None) are just labels. self.td(gui.Label(text, color=fg), align=1, colspan=2) else: # Add the label and then the switch/checkbox self.td(gui.Label(text, color=fg), align=1) self.td(gui.Switch(value=getattr(settings, variable),name=variable))
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() # item information self.itemNum = 0 self.itemVal = 0 # dialogs openItemDialog = OpenItemDialog(self) self.tr() e = gui.Button("Open item...", width=100) e.connect(gui.CLICK, openItemDialog.openDialog, None) self.td(e) self.tr() self.td(gui.Spacer(10, 20)) self.tr() self.td( gui.Label('Select an item to spawn', color=UI_FONT_COLOR, name='lblItemName')) self.tr() self.td(gui.Spacer(10, 80))
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.engine = None def btnLogin(btn): self.engine.doLogin() def btnRegister(btn): g.gameState = MENU_REGISTER if g.tcpConn is None: g.gameEngine.initConnection() self.tr() self.td(gui.Input(name="username", value="Username")) self.tr() self.td(gui.Password(name="password", value="password")) self.tr() self.td(gui.Spacer(0, 30)) self.tr() btn = gui.Button("Login", width=120) btn.connect(gui.CLICK, btnLogin, None) self.td(btn) self.tr() self.td(gui.Spacer(0, 5)) self.tr() btn = gui.Button("Register", width=120) btn.connect(gui.CLICK, btnRegister, None) self.td(btn)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.engine = None def btnNextClass(btn): self.engine.classIndex += 1 self.engine.updateClassSelection() def btnPrevClass(btn): self.engine.classIndex -= 1 self.engine.updateClassSelection() def btnCreateChar(btn): self.engine.createCharacter() def btnCancel(btn): g.gameState = MENU_CHAR self.tr() self.lblCharName = gui.Label(_('Character Name'), color=(255, 255, 255)) self.td(self.lblCharName, colspan=3, valign=1) self.tr() self.inpCharName = gui.Input(name='inpCharName', value='') self.td(self.inpCharName, colspan=3) self.tr() self.lblClassName = gui.Label(_('CLASS NAME'), color=(255, 255, 255)) self.td(self.lblClassName, colspan=3, valign=1) self.tr() btn = gui.Button(_("Previous"), width=160, height=40) btn.connect(gui.CLICK, btnPrevClass, None) self.td(btn) self.td(gui.Spacer(300, 160)) btn = gui.Button(_("Next"), width=160, height=40) btn.connect(gui.CLICK, btnNextClass, None) self.td(btn) self.tr() self.td(gui.Spacer(0, 0)) self.btnSelChar = gui.Button(_("Create Character"), width=160, height=30) self.btnSelChar.connect(gui.CLICK, btnCreateChar, None) self.td(self.btnSelChar) self.td(gui.Spacer(0, 0)) self.tr() self.td(gui.Spacer(0, 20)) self.tr() self.td(gui.Spacer(0, 0)) btn = gui.Button("Cancel", width=160, height=30) btn.connect(gui.CLICK, btnCancel, None) self.td(btn) self.td(gui.Spacer(0, 0))
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.engine = None def btnNextChar(btn): self.engine.charIndex += 1 self.engine.updateCharSelection() def btnPrevChar(btn): self.engine.charIndex -= 1 self.engine.updateCharSelection() def btnUseChar(btn): if self.lblPlayerName.value != 'Create a new character': g.tcpConn.sendUseChar(self.engine.charIndex - 1) g.gameState = MENU_INGAME else: # new char g.tcpConn.sendGetClasses() g.gameState = MENU_NEWCHAR def btnDelChar(btn): print "lawl" self.tr() self.lblPlayerName = gui.Label('PLAYER NAME', color=(255, 0, 0)) self.td(self.lblPlayerName, colspan=3, valign=1) self.tr() self.lblPlayerExtra = gui.Label('PLAYER LEVEL/CLASS', color=(255, 0, 0)) self.td(self.lblPlayerExtra, colspan=3) self.tr() btn = gui.Button("Previous", width=160, height=40) btn.connect(gui.CLICK, btnPrevChar, None) self.td(btn) self.td(gui.Spacer(300, 160)) btn = gui.Button("Next", width=160, height=40) btn.connect(gui.CLICK, btnNextChar, None) self.td(btn) self.tr() self.td(gui.Spacer(0, 0)) self.btnSelChar = gui.Button("Use Character", width=160, height=30) self.btnSelChar.connect(gui.CLICK, btnUseChar, None) self.td(self.btnSelChar) self.td(gui.Spacer(0, 0)) self.tr() self.td(gui.Spacer(0, 20)) self.tr() self.td(gui.Spacer(0, 0)) btn = gui.Button("Delete Character", width=160, height=30) btn.connect(gui.CLICK, btnDelChar, None) self.td(btn) self.td(gui.Spacer(0, 0))
def __init__(self, value, **params): gui.Table.__init__(self, **params) self.ev_manager = params['ev_manager'] self.gui_form = gui.Form() g = gui.Group(value=[config.use_darkness], name='use_darkness') self.td(gui.Checkbox(g, value=1)) self.td(gui.Label("Darkness")) g.connect(gui.CHANGE, self.changed, None)
def __init__(self, value, **params): gui.Table.__init__(self, **params) self.ev_manager = params['ev_manager'] self.gui_form = gui.Form() g = gui.Group(value=[config.fill_board], name='fill_board') self.td(gui.Checkbox(g, value=1)) self.td(gui.Label("Fill board")) g.connect(gui.CHANGE, self.changed, None)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.engine = None def btnNextChar(btn): self.engine.charIndex += 1 self.engine.updateCharSelection() def btnPrevChar(btn): self.engine.charIndex -= 1 self.engine.updateCharSelection() def btnUseChar(btn=None): if self.lblPlayerName.value != 'Empty': g.tcpConn.sendUseChar(self.engine.charIndex-1) g.gameEngine.setState(MENU_INGAME) else: # new char g.tcpConn.sendGetClasses() g.gameEngine.setState(MENU_NEWCHAR) def btnDelChar(btn): print ("not yet implemented") self.tr() self.lblPlayerName = gui.Label('#PLAYER_NAME', antialias=1, color=UI_NAME_FONT_COLOR, font=g.charSelFont) self.td(self.lblPlayerName, colspan=3, valign=1, align=0) self.tr() self.lblPlayerExtra = gui.Label('#PLAYER_LEVEL_CLASS', antialias=1, color=UI_NAME_FONT_COLOR, font=g.charSelFont, name='lblExtra') self.td(self.lblPlayerExtra, colspan=3, align=0) self.tr() btn = gui.Button(_("Previous"), width=160, height=40) btn.connect(gui.CLICK, btnPrevChar, None) self.td(btn) self.td(gui.Spacer(300, 160)) btn = gui.Button(_("Next"), width=160, height=40) btn.connect(gui.CLICK, btnNextChar, None) self.td(btn) self.tr() self.td(gui.Spacer(0, 0)) self.btnSelChar = gui.Button(_("Use Character"), width=160, height=30) self.btnSelChar.connect(gui.CLICK, btnUseChar, None) self.td(self.btnSelChar) self.td(gui.Spacer(0, 0)) self.tr() self.td(gui.Spacer(0, 20)) self.tr() self.td(gui.Spacer(0, 0)) btn = gui.Button(_("Delete Character"), width=160, height=30) btn.connect(gui.CLICK, btnDelChar, None) self.td(btn) self.td(gui.Spacer(0, 0))
def __init__(self,**params): self.task = gui.Form() # widget values get added to this dict self.state = None title = gui.Label("Task Dialog") table = gui.Table(width=400) # Name input table.tr() table.td(gui.Label("Name:"), colspan=1) table.td(gui.Input(name="name"), colspan=3) table.tr() table.td(gui.Spacer(width=1,height=5)) # Notes input table.tr() table.td(gui.Label("Notes:"), colspan=1) table.td(gui.Input(name="notes"), colspan=3) table.tr() table.td(gui.Spacer(width=1,height=5)) # Due date input table.tr() table.td(gui.Label("Due Date:"), colspan=1) table.td(gui.Input(name="dueDate"), colspan=3) table.tr() table.td(gui.Spacer(width=1,height=5)) # tags checkbox table.tr() table.td(gui.Label("Tags:"), colspan=4, align=0) tagGroup = gui.Group(name="tags") table.tr() table.td(gui.Label("School"), colspan=2, align=1) table.td(gui.Checkbox(tagGroup,value="school")) table.tr() table.td(gui.Label("Work"), colspan=2, align=1) table.td(gui.Checkbox(tagGroup,value="work")) table.tr() table.td(gui.Label("Health"), colspan=2, align=1) table.td(gui.Checkbox(tagGroup,value="health")) table.tr() table.td(gui.Spacer(width=1,height=10)) table.tr() self.saveBtn = gui.Button("Add Task") self.saveBtn.connect(gui.CLICK,self.send,gui.CHANGE) table.td(self.saveBtn, colspan=4) gui.Dialog.__init__(self,title,table)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.tr() label = gui.Label("Left click to add block", color=UI_FONT_COLOR) self.td(label) self.tr() label = gui.Label("Right click to remove block", color=UI_FONT_COLOR) self.td(label)
def __init__(self,**params): fga = (255,25,0) title = gui.Label(u"游戏设置",font=psubfts) self.dfstr=[u'普 通',u'高 级',u'专 家',u'大 师'] self.value=gui.Form() tab=gui.Table() tab.tr() tab.td(gui.Spacer(width=8,height=16)) tab.tr() tab.td(gui.Label(u"难 度:",font=psubfts), align=1,valign=1) tt=gui.Table(width=200) sld=gui.HSlider(0,0,3,size=32,width=180,height=25,name='dif') dflb=gui.Label(self.dfstr[sld.value],width=180,font=psubfts,color=fga) sld.connect(gui.CHANGE, self.ajust,(sld,dflb)) tt.tr() tt.td(dflb) tt.tr() tt.td(sld,align=0,width=240) tab.td(tt) tab.tr() tab.td(gui.Spacer(width=8,height=16)) g = gui.Group(name='gstyle',value='style 1') tab.tr() tab.td(gui.Label(u"样 式:",font=psubfts),align=1) tt=gui.Table(width=200) tt.tr() tt.td(gui.Radio(g,value="style 1"),align=1) tt.td(gui.Image('data/s1.gif',width=36,height=36),align=-1) #tt.td(gui.Label(u"一",font=psubfts),align=-1) tt.td(gui.Radio(g,value="style 2"),align=1) tt.td(gui.Image('data/s2.gif',width=36,height=36),align=-1) tt.td(gui.Radio(g,value="style 3"),align=1) tt.td(gui.Image('data/s3.png',width=36,height=36),align=-1) tab.td(tt) tab.tr() tab.td(gui.Spacer(width=8,height=16)) tab.tr() bv=gui.Label(u"确定",font=psubfts,color=fga) bt=gui.Button(bv) bt.connect(gui.CLICK, self.send, gui.CHANGE) tab.td(bt,width=120,align=1) bv=gui.Label(u"取消",font=psubfts,color=fga) bt=gui.Button(bv) bt.connect(gui.CLICK, self.close,None) tab.td(bt) tab.tr() tab.td(gui.Spacer(width=8,height=16)) gui.Dialog.__init__(self, title, tab)
def __init__(self, config): self.config = config self.running = True self.form = gui.Form() self.module = gui.Desktop() self.module.connect(gui.QUIT, self.module.quit, None) main = gui.Container(width=self.config['width'], height=self.config['height']) newdialog = NewKBDDialog(self.config) newdialog.connect(gui.CHANGE, self.module.quit, None) main.add(newdialog, 0, 0)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.tr() self.td(gui.Label("Map ID: ", color=UI_FONT_COLOR), colspan=2) self.tr() self.inpMapID = gui.Input('0', size=8, name='inpWarpMapID') self.td(self.inpMapID, colspan=2) # used for selecting the map - todo ''' mapDialog = MapSelectorDialog(self.inpMapID) self.tr() e = gui.Button('Choose map...') e.connect(gui.CLICK, mapDialog.openDialog, None) self.td(e, colspan=2) ''' self.tr() self.td(gui.Spacer(10, 20)) self.tr() self.td(gui.Label("Warp-To Position", color=UI_FONT_COLOR), colspan=2) self.tr() self.td(gui.Label("X: ", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpWarpX")) self.tr() self.td(gui.Label("Y: ", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpWarpY")) self.tr() self.td(gui.Spacer(10, 20)) self.tr() label = gui.Label("Left click to add warp", color=UI_FONT_COLOR) self.td(label, colspan=2) self.tr() label = gui.Label("Right click to remove warp", color=UI_FONT_COLOR) self.td(label, colspan=2) # initialize the alert dialog self.alertDialog = EmptyFieldAlertDialog()
def __init__(self, **params): gui.Table.__init__(self, **params) self.listCount = 0 # dialogs openNpcDialog = OpenNPCDialog(self) self.value = gui.Form() self.tr() self.td(gui.Label("Map Name:", color=UI_FONT_COLOR)) self.td(gui.Input("", size=16, name="inpMapName")) self.tr() self.td(gui.Label("Warp Up:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapUp")) self.tr() self.td(gui.Label("Warp Down:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapDown")) self.tr() self.td(gui.Label("Warp Left:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapLeft")) self.tr() self.td(gui.Label("Warp Right:", color=UI_FONT_COLOR)) self.td(gui.Input("0", size=4, name="inpMapRight")) self.tr() self.td(gui.Spacer(10, 10)) # npc list self.tr() e = gui.Button('Add NPC...', width=80) e.connect(gui.CLICK, openNpcDialog.openDialog, None) self.td(e) e = gui.Button('Remove', width=80) e.connect(gui.CLICK, self.removeNpc, None) self.td(e) self.tr() self.npcList = gui.List(width=200, height=80, name='lstNpcs') self.td(self.npcList, colspan=2) self.loadProperties()
def __init__(self, **params): self.ev_manager = params['ev_manager'] self.ev_manager.register_listener(self) title = gui.Label("Game Paused") main = gui.Table(width=100, height=50) self.gui_form = gui.Form() # main.tr() # main.td(gui.Label("Click to un-pause:")) main.tr() submit_button = gui.Button("Resume") main.td(submit_button) submit_button.connect(gui.CLICK, self.resume, None) gui.Dialog.__init__(self, title, main)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() '''self.content = gui.Table() self.scrollArea = gui.ScrollArea(self.content, width=270, height=372, hscrollbar=False) self.tr() self.td(self.scrollArea) self.tr() g = gui.Group(name="grpTileType") self.content.td(gui.Label("Ground", color=UI_FONT_COLOR)) self.content.td(gui.Spacer(10, 0)) e = gui.Radio(g, value=1) e.click() self.content.td(e) self.content.tr() self.content.td(gui.Label("Fringe", color=UI_FONT_COLOR)) self.content.td(gui.Spacer(10, 0)) self.content.td(gui.Radio(g, value=2)) ''' self.tr() g = gui.Group(name="grpTileType") self.td(gui.Label("Ground", color=UI_FONT_COLOR)) self.td(gui.Spacer(10, 0)) e = gui.Radio(g, value=1) e.click() self.td(e) self.tr() self.td(gui.Label("Fringe", color=UI_FONT_COLOR)) self.td(gui.Spacer(10, 0)) self.td(gui.Radio(g, value=2)) e = gui.Select(name='selTileType') e.add('Layer 1', 0) e.add('Layer 2', 1) e.add('Layer 3', 2) e.add('Fringe', 3) e.value = 0 self.td(e)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.engine = None self._data = '' self._count = 1 self.focused = False def clickChatMsg(value): # disable movement when chat msg is mouse clicked if self.focused: self.focused = False else: self.focused = True g.canMoveNow = False self.tr() self.chatMsg = gui.Input(maxlength=128, width=468, focusable=False) self.chatMsg.connect(gui.CLICK, clickChatMsg, None) self.chatMsg.connect(gui.KEYDOWN, self.lkey) self.td(self.chatMsg) self.tr() self.chatList = gui.Table() self.box = gui.ScrollArea(self.chatList, width=480, height=172, hscrollbar=False) self.td(self.box) self.tr() class Hack(gui.Spacer): def __init__(self, box): super(gui.Spacer, self).__init__() self.box = box def resize(self, width=None, height=None): self.box.set_vertical_scroll(65535) return 1, 1 dirtyHack = Hack(self.box) self.td(dirtyHack)
def __init__(self, mode, dif, **params): gui.Table.__init__(self, **params) self.ev_manager = params['ev_manager'] self.ev_manager.register_listener(self) self.h1 = pygame.font.Font(config.font_logo, 18) self.gui_form = gui.Form() self.tr() self.td(gui.Label("Mode:", font=self.h1, color=config.COLOR5), colspan=2, align=-1, height=50) g = gui.Group(value=mode, name='mode') self.tr() self.td(gui.Radio(g, value=config.TIME_CHALLENGE)) self.td(gui.Label("Time Challenge"), align=-1) self.tr() self.td(gui.Radio(g, value=config.PLAN_AHEAD)) self.td(gui.Label("Plan Ahead"), align=-1) self.tr() self.td(gui.Label("Difficulty:", font=self.h1, color=config.COLOR5), colspan=2, align=-1, height=50) g = gui.Group(value=dif, name='difficulty') self.tr() self.td(gui.Radio(g, value=config.EASY), width=30) self.td(gui.Label("Easy"), align=-1) self.tr() self.td(gui.Radio(g, value=config.MED_DIF)) self.td(gui.Label("Medium"), align=-1) self.tr() self.td(gui.Radio(g, value=config.HARD)) self.td(gui.Label("Hard"), align=-1) self.tr() self.td(gui.Radio(g, value=config.SUPER)) self.td(gui.Label("Superstar"), align=-1) self.tr() self.refresh_button = gui.Button("Refresh") self.td(self.refresh_button, colspan=2, align=-1, height=50) self.refresh_button.connect(gui.CLICK, self.refresh, None)
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() self.tr() g = gui.Group(name="grpTileType") self.td(gui.Label("Ground", color=UI_FONT_COLOR)) self.td(gui.Spacer(10, 0)) e = gui.Radio(g, value=1) e.click() self.td(e) self.tr() self.td(gui.Label("Fringe", color=UI_FONT_COLOR)) self.td(gui.Spacer(10, 0)) self.td(gui.Radio(g, value=2))
def __init__(self, **params): gui.Table.__init__(self, **params) self.value = gui.Form() # dialogs openNpcDialog = OpenNPCDialog(self) self.tr() self.td(gui.Spacer(10, 70)) self.tr() e = gui.Button("Open NPC...", width=100) e.connect(gui.CLICK, openNpcDialog.openDialog, None) self.td(e, colspan=2) self.tr() self.td(gui.Spacer(10, 20)) self.tr() self.td(gui.Label('Name:', color=UI_FONT_COLOR), colspan=2) self.tr() self.td(gui.Input('', size=26, name='inpNpcName'), colspan=2, valign=-1) self.tr() self.td(gui.Spacer(10, 20)) self.tr() self.td(gui.Label('Behaviour:', color=UI_FONT_COLOR), colspan=2) self.tr() e = gui.Select(name='selBehaviour') e.add('Attack on sight', 0) e.add('Attack when attacked', 1) e.add('Friendly', 2) e.add('Shopkeeper', 3) e.add('Guard', 4) e.value = 0 #e.connect(gui.CHANGE, self.updateType, None) self.td(e, colspan=2)
def __init__(self,**params): title = gui.Label("Save As...") t = gui.Table() self.value = gui.Form() t.tr() t.td(gui.Label("Save: ")) t.td(gui.Input(name="fname"),colspan=3) t.tr() e = gui.Button("Okay") e.connect(gui.CLICK,self.send,gui.CHANGE) t.td(e,colspan=2) e = gui.Button("Cancel") e.connect(gui.CLICK,self.close,None) t.td(e,colspan=2) gui.Dialog.__init__(self,title,t)