當前位置: 首頁>>代碼示例>>Python>>正文


Python Form.ClientSize方法代碼示例

本文整理匯總了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)
開發者ID:cdfarrow,項目名稱:FLExTools,代碼行數:32,代碼來源:UICollections.py

示例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)
開發者ID:cdfarrow,項目名稱:FLExTools,代碼行數:31,代碼來源:UIModuleBrowser.py

示例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)
開發者ID:mwojcikowski,項目名稱:cinfony,代碼行數:87,代碼來源:indy.py


注:本文中的System.Windows.Forms.Form.ClientSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。