make pressing enter work properly in the sprite w and h fields
This commit is contained in:
parent
dd5e1f7984
commit
127bae1500
|
@ -713,14 +713,16 @@ class LobbyI(TokenClient):
|
|||
except:
|
||||
return ""
|
||||
|
||||
def MiTypein_MiButton(self, stBtnLabel, stMiTypein, dgOnSelect):
|
||||
def NewI(stName = None):
|
||||
if stName == None:
|
||||
stName = self.miCmds.Value(stMiTypein)
|
||||
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):
|
||||
self.project = project
|
||||
|
@ -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])
|
||||
|
||||
|
|
Loading…
Reference in a new issue