make pressing enter work properly in the sprite w and h fields

This commit is contained in:
Jeremy Penner 2011-10-08 14:57:33 -04:00
parent dd5e1f7984
commit 127bae1500

View file

@ -713,13 +713,15 @@ class LobbyI(TokenClient):
except:
return ""
def MiTypein_MiButton(self, stBtnLabel, stMiTypein, dgOnSelect):
def NewI(stName = None):
if stName == None:
def MiTypein_MiButton_DgNew(self, stBtnLabel, stMiTypein, dgOnSelect):
def NewI(stName):
stName = self.miCmds.Value(stMiTypein)
if stName != "":
dgOnSelect(stName)
return (MiTypein(NewI, stMiTypein), MiButton(stBtnLabel, NewI))
return (MiTypein(NewI, stMiTypein), MiButton(stBtnLabel, NewI), NewI)
def MiTypein_MiButton(self, stBtnLabel, stMiTypein, dgOnSelect):
return self.MiTypein_MiButton_DgNew(stBtnLabel, stMiTypein, dgOnSelect)[:2]
class LobbyBoard(LobbyI):
def InitPersistent(self, owner, client, project, drawing = None):
@ -728,10 +730,10 @@ class LobbyBoard(LobbyI):
def CreateMiCmds(self):
miTypeinBoard, miBtnNewBoard = self.MiTypein_MiButton("New Board", "BoardName", self.NewBoard)
miTypeinSpr, miBtnNewSpr = self.MiTypein_MiButton("New Sprite", "SpriteName", self.NewSprite)
miTypeinW = MiTypein(self.NewSprite, "w")
miTypeinSpr, miBtnNewSpr, dgNewSprite = self.MiTypein_MiButton_DgNew("New Sprite", "SpriteName", self.NewSprite)
miTypeinW = MiTypein(dgNewSprite, "w")
miTypeinW.SetValue("1")
miTypeinH = MiTypein(self.NewSprite, "h")
miTypeinH = MiTypein(dgNewSprite, "h")
miTypeinH.SetValue("1")
self.miDimensions = MiMenuHoriz([MiStatic("W:"), miTypeinW, MiStatic("H:"), miTypeinH])