本文整理汇总了Python中System.Windows.Forms.Form.ClientSize方法的典型用法代码示例。如果您正苦于以下问题:Python Form.ClientSize方法的具体用法?Python Form.ClientSize怎么用?Python Form.ClientSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.ClientSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __OnLoad
# 需要导入模块: from System.Windows.Forms import Form [as 别名]
# 或者: from System.Windows.Forms.Form import ClientSize [as 别名]
self.FormClosing += self.__OnFormClosing
def __OnLoad(self, sender, event):
self.cmPanel.SetFocusOnCurrentCollection()
def __OnCollectionActivated(self, collectionName):
# make selection available to caller
self.activatedCollection = collectionName
self.Close()
def __OnFormClosing(self, sender, event):
self.activatedCollection = self.cmPanel.currentCollection
self.cmPanel.SaveAll()
# ------------------------------------------------------------------
if __name__ == "__main__":
collections = FTCollections.CollectionsManager()
mm = FTModules.ModuleManager()
mm.LoadAll()
cmPanel = CollectionsManagerUI(collections, mm, None)
form = Form()
form.ClientSize = Size(600, 550)
form.Text = "Test of Collections Manager"
form.Controls.Add(cmPanel)
Application.Run(form)
示例2: ModuleInfoDialog
# 需要导入模块: from System.Windows.Forms import Form [as 别名]
# 或者: from System.Windows.Forms.Form import ClientSize [as 别名]
# ------------------------------------------------------------------
class ModuleInfoDialog(Form):
def __init__(self, docs):
Form.__init__(self)
self.ClientSize = Size(400, 400)
self.Text = "Module Details"
self.Icon = Icon(UIGlobal.ApplicationIcon)
infoPane = ModuleInfoPane()
infoPane.SetFromDocs(docs)
self.Controls.Add(infoPane)
# ------------------------------------------------------------------
if __name__ == "__main__":
import FTModules
mm = FTModules.ModuleManager()
mm.LoadAll()
mb = ModuleBrowser(mm)
form = Form()
form.ClientSize = Size(500, 300)
form.Text = "Test of Module Browser"
form.Controls.Add(mb)
Application.Run(form)
示例3: draw
# 需要导入模块: from System.Windows.Forms import Form [as 别名]
# 或者: from System.Windows.Forms.Form import ClientSize [as 别名]
def draw(self, show=True, filename=None, update=False, usecoords=False):
"""Create a 2D depiction of the molecule.
Optional parameters:
show -- display on screen (default is True)
filename -- write to file (default is None)
update -- update the coordinates of the atoms to those
determined by the structure diagram generator
(default is False)
usecoords -- don't calculate 2D coordinates, just use
the current coordinates (default is False)
Tkinter and Python Imaging Library are required for image display.
"""
if update:
mol = self.Mol
else:
mol = self.Mol.clone()
if not usecoords:
mol.layout()
if show or filename:
renderer = IndigoRenderer(indigo)
indigo.setOption("render-output-format", "png")
indigo.setOption("render-margins", 10, 10)
indigo.setOption("render-coloring", "True")
indigo.setOption("render-image-size", 300, 300)
indigo.setOption("render-background-color", "1.0, 1.0, 1.0")
if self.title:
indigo.setOption("render-comment", self.title)
if filename:
filedes = None
else:
filedes, filename = tempfile.mkstemp()
renderer.renderToFile(mol, filename)
if show:
if sys.platform[:4] == "java":
image = javax.imageio.ImageIO.read(java.io.File(filename))
frame = javax.swing.JFrame(visible=1)
frame.getContentPane().add(javax.swing.JLabel(javax.swing.ImageIcon(image)))
frame.setSize(300,300)
frame.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE)
frame.show()
elif sys.platform[:3] == "cli":
if filedes:
errormessage = ("It is only possible to show the molecule if you "
"provide a filename. The reason for this is that I kept "
"having problems when using temporary files.")
raise RuntimeError(errormessage)
form = Form()
form.ClientSize = Size(300, 300)
form.Text = self.title
image = Image.FromFile(filename)
box = PictureBox()
box.SizeMode = PictureBoxSizeMode.StretchImage
box.Image = image
box.Dock = DockStyle.Fill
form.Controls.Add(box)
form.Show()
Application.Run(form)
else:
if not PILtk:
errormessage = ("Tkinter or Python Imaging "
"Library not found, but is required for image "
"display. See installation instructions for "
"more information.")
raise ImportError, errormessage
root = tk.Tk()
root.title((hasattr(self, "title") and self.title)
or self.__str__().rstrip())
frame = tk.Frame(root, colormap="new", visual='truecolor').pack()
image = PIL.open(filename)
imagedata = PILtk.PhotoImage(image)
label = tk.Label(frame, image=imagedata).pack()
quitbutton = tk.Button(root, text="Close", command=root.destroy).pack(fill=tk.X)
root.mainloop()
if filedes:
os.close(filedes)
os.remove(filename)