本文整理汇总了Python中frame.Frame.layoutEditPane方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.layoutEditPane方法的具体用法?Python Frame.layoutEditPane怎么用?Python Frame.layoutEditPane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frame.Frame
的用法示例。
在下文中一共展示了Frame.layoutEditPane方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import layoutEditPane [as 别名]
#.........这里部分代码省略.........
if thread.printToListen:
self.outputArea.printLine(event.data)
thread.output += event.data
elif type(event.data) is int:
if event.data == 0 or event.data == 2: # motelist returns 2 if no mote found!
# If no callback defined, no Done printed!
if thread.callbackFunction:
self.printInfo("Done!\n", False, not self.supressTabSwitching)
else:
self.printInfo("Failed!\n", False, not self.supressTabSwitching)
self.supressTabSwitching = False
else:
self.infoArea.printLine("Wrong format recieved {}\n".format(type(event.data)))
def changePlatform(self, event):
if event is not None:
platform = event.GetEventObject().GetValue()
else:
platform = "telosb"
if platform in self.platforms:
self.activePlatform = self.platforms.index(platform)
else:
self.activePlatform = self.platforms.index("telosb")
self.printInfo(localize("Changed platform to") + " " + self.getActivePlatform() + "\n")
def getActivePlatform(self):
if self.platformOnly == None:
if self.platforms[self.activePlatform] not in self.excludedPlatforms:
return self.platforms[self.activePlatform]
else:
return self.platforms[0]
else:
return self.platforms[self.platforms.index(self.platformOnly)]
def dummyPrint(self, msg, arg1 = "", arg2 = ""):
print msg
def addListenWindow(self, event):
listenModule = ListenModule(self.emptyFrame, self)
self.listenModules.append(listenModule)
self.frame.layoutListenPane(listenModule, "Listen module {}".format(len(self.listenModules)))
self.frame.auiManager.Update()
def showBlocklyWindow(self, event):
blocklyPane = self.frame.auiManager.GetPaneByName("blocklyPane")
if blocklyPane.IsShown() and blocklyPane.IsOk():
self.blocklyPane = blocklyPane
blocklyPane.Float()
blocklyPane.Hide()
self.frame.auiManager.DetachPane(self.blockly)
else:
self.frame.layoutBlocklyPane()
self.frame.auiManager.UpdateNotebook()
self.frame.auiManager.Update()
def showEditWindow(self, event):
editPane = self.frame.auiManager.GetPaneByName("editPane")
if editPane.IsShown() and editPane.IsOk():
self.frame.auiManager.ClosePane(editPane)
self.frame.auiManager.DetachPane(self.editPanel)
else:
self.frame.layoutEditPane()
self.frame.auiManager.Update()
def syncModuleCheckboxes(self):
if self.frame.auiManager.GetPaneByName("editPane").IsShown():
self.frame.editCheck.Check(True)
else:
self.frame.editCheck.Check(False)
if self.frame.auiManager.GetPaneByName("blocklyPane").IsShown():
self.frame.blocklyCheck.Check(True)
else:
self.frame.blocklyCheck.Check(False)
def loadUserMotes(self):
# Read motelist from config file
if os.path.exists(".motelist") and os.path.isfile(".motelist"):
f = open(".motelist", 'r')
lines = f.readlines()
for x in lines:
if x != '':
if x.find("->") != -1:
name, port = x.strip().split("->")
Motelist.addMote(port, name, localize("User defined"))
def saveUserMotes(self, name, port):
os.chdir(self.path)
f = open(".motelist", 'w')
for mote in Motelist.getMotelist(False):
if mote.isUserMote():
f.write(str(mote.getName()) + "->" + str(mote.getPort()) + '\n')
f.close()