本文整理汇总了Python中System.Windows.Forms.Form类的典型用法代码示例。如果您正苦于以下问题:Python Form类的具体用法?Python Form怎么用?Python Form使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Form类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, openFileDialog=None):
Form.__init__(self)
if openFileDialog:
self.openFileDialog = openFileDialog
else:
self.openFileDialog = OpenFileDialog()
self.Text = 'Tabbed Image Viewer'
self.Width = 450
self.Height = 400
self.StartPosition = FormStartPosition.CenterScreen
self.Icon = Icon(Path.Combine(IMAGEPATH, "pictures.ico"))
self.AllowDrop = True
self.justCopied = False
self.paths = []
self.initTabControl()
self.initToolBar()
self.initMenu()
self.initContextMenu()
self._clipboardViewerNext = None
if SetClipboardViewer is not None:
self._clipboardViewerNext = SetClipboardViewer.SetClipboardViewer(self.Handle)
for fileName in sys.argv[1:]:
self.openFile(fileName)
self.updateToolbar()
self.DragEnter += self.onDragEnter
self.DragDrop += self.onDragDrop
示例2: __init__
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)
示例3: __init__
def __init__(self, bitmap):
Form.__init__(self)
picBox = PictureBox()
picBox.SizeMode = PictureBoxSizeMode.AutoSize
picBox.Image = bitmap
picBox.Dock = DockStyle.Fill
self.Controls.Add(picBox)
self.Show()
self.Width = bitmap.Width + 20
self.Height = bitmap.Height + 20
示例4: __init__
def __init__(self):
Form.__init__(self)
self.Text = 'MultiDoc Editor'
self.MinimumSize = Size(150, 150)
self.tabControl = TabControl()
self.tabControl.Dock = DockStyle.Fill
self.tabControl.Alignment = TabAlignment.Bottom
self.Controls.Add(self.tabControl)
self.addTabPage("New Page", '')
示例5: create_form
def create_form():
f=Form()
f.Text="HelloIronPython"
btn=Button()
btn.Text="ClickMe"
f.Controls.Add(btn)
btn.Top=(f.ClientSize.Height-btn.Height)/2
btn.Left=(f.ClientSize.Width-btn.Width)/2
Application.Run(f)
示例6: __init__
def __init__(self, name, rename):
Form.__init__(self)
title = "Name Tab"
if rename:
title = "Rename Tab"
self.Text = title
self.Size = Size(170, 85)
self.FormBorderStyle = FormBorderStyle.FixedDialog
self.ShowInTaskbar = False
self.Padding = Padding(5)
self.initialiseTextBox(name)
self.initialiseButtons()
示例7: __init__
def __init__(self):
Form.__init__(self)
self.ClientSize = Size(400, 250)
self.Text = "About FLExTools"
self.FormBorderStyle = FormBorderStyle .Fixed3D
self.Icon = Icon(UIGlobal.ApplicationIcon)
pb = PictureBox()
pb.Image = Image.FromFile(UIGlobal.ApplicationIcon)
pb.BackColor = UIGlobal.helpDialogColor
pb.SizeMode = PictureBoxSizeMode.CenterImage
self.Controls.Add(pb)
self.Controls.Add(AboutInfo())
示例8: __init__
def __init__(self, currentProject=None):
Form.__init__(self)
self.ClientSize = Size(350, 250)
self.Text = "Choose Project"
self.Icon = Icon(UIGlobal.ApplicationIcon)
self.projectName = currentProject
self.projectList = ProjectList(currentProject)
self.projectList.SetActivatedHandler(self.__OnProjectActivated)
self.Load += self.__OnLoad
self.Controls.Add(self.projectList)
示例9: __init__
def __init__(self):
Form.__init__(self)
self.Text = 'stutter'
self.Height = self.INITIAL_HEIGHT
self.Width = self.INITIAL_WIDTH
self.postTextBox = TextBox()
self.postTextBox.Multiline = True
# Practical 1: Create a 'Post' button
# store it in member 'postButton'
self.friendsListBox = ListBox()
self._addMenu()
self._layout()
示例10: __init__
def __init__(self, cm, mm, currentCollection):
Form.__init__(self)
self.ClientSize = Size(600, 600)
self.Text = "Collections Manager"
self.Icon = Icon(UIGlobal.ApplicationIcon)
self.activatedCollection = None
self.cmPanel = CollectionsManagerUI(cm, mm, currentCollection)
self.cmPanel.SetActivatedHandler(self.__OnCollectionActivated)
self.Load += self.__OnLoad
self.Controls.Add(self.cmPanel)
self.FormClosing += self.__OnFormClosing
示例11: __init__
def __init__(self, imagePath):
Form.__init__(self)
self.Width = 346
self.Height = 215
self.images = dict((name, loadImage(imagePath, name + '.jpg'))
for name in ('pycon', 'andrzej', 'michael', 'christian'))
self.pictureBox = PictureBox()
self.pictureBox.Parent = self
self.pictureBox.Location = Point(234, 12)
self.pictureBox.TabStop = False
self.switchImage("pycon")
self.mainText = Label()
self.mainText.Parent = self
self.mainText.AutoSize = True
self.mainText.Location = Point(12, 12);
self.mainText.Text = ("Tabbed Image Viewer\r\n\r\nWritten for PyCon 2007\r\n"
"Using IronPython and Windows Forms\r\n\r\nBy:")
self.addNameLabel("Andrzej Krzywda", "andrzej", Point(36, 90))
self.addNameLabel("Christian Muirhead", "christian", Point(36, 105))
self.addNameLabel("Michael Foord", "michael", Point(36, 120))
versionLabel = Label()
versionLabel.Parent = self
versionLabel.AutoSize = True
versionLabel.Location = Point(12, 151)
versionLabel.Text = "Version: " + __revision__
self.okButton = Button()
self.okButton.Parent = self
self.okButton.Text = "OK"
self.okButton.Location = Point(251, 146)
self.okButton.Click += self.onOK
self.AcceptButton = self.okButton
self.Text = "About"
self.FormBorderStyle = FormBorderStyle.FixedDialog
self.MinimizeBox = False
self.MaximizeBox = False
示例12: EditValue
def EditValue(self, context, provider, value) :
service = provider.GetService(clr.GetClrType(IWindowsFormsEditorService))
if service != None :
from System.Windows.Forms import Form, TextBox, FormBorderStyle, DockStyle, DialogResult
tb = TextBox()
tb.Multiline = True
tb.Text = value
f = Form()
f.Controls.Add(tb)
f.FormBorderStyle = FormBorderStyle.None
f.TopLevel = False
tb.Dock = DockStyle.Fill
service.DropDownControl(f)
value = tb.Text
return value
示例13: __init__
def __init__(self):
Form.__init__(self)
self.Text = 'MultiDoc Editor'
self.MinimumSize = Size(150, 150)
self.iconPath = Path.Combine(executableDirectory, 'icons')
self.Icon = self.loadImage('copy_clipboard_16.dat')
tab = self.tabControl = TabControl()
self.tabControl.Dock = DockStyle.Fill
self.tabControl.Alignment = TabAlignment.Bottom
self.Controls.Add(self.tabControl)
self.tabController = TabController(tab)
self.initialiseCommands()
self.initialiseToolbar()
self.initialiseMenus()
self.initialiseObservers()
self.document = Document()
示例14: __init__
def __init__(self):
Form.__init__(self)
self.ClientSize = Size(700, 500)
self.Text = "FLExTools " + Version.number
## Get configurables - current DB, current collection
self.configuration = ConfigStore(FTPaths.CONFIG_PATH)
self.collectionsManager = FTCollections.CollectionsManager()
self.__LoadModules()
try:
listOfModules = self.collectionsManager.ListOfModules(
self.configuration.currentCollection)
except FTCollections.FTC_NameError:
# The configuration value is bad...
self.configuration.currentCollection = None
listOfModules = []
self.Icon = Icon(UIGlobal.ApplicationIcon)
self.InitMainMenu()
self.progressPercent = -1
self.progressMessage = None
self.StatusBar = StatusBar()
self.__UpdateStatusBar()
self.UIPanel = FTPanel(self.moduleManager,
self.configuration.currentProject,
listOfModules,
self.__LoadModules,
self.__ProgressBar
)
self.UIPanel.SetChooseProjectHandler(self.ChooseProject)
self.UIPanel.SetEditCollectionsHandler(self.EditCollections)
self.FormClosed += self.__OnFormClosed
self.Controls.Add(self.UIPanel)
self.Controls.Add(self.StatusBar)
示例15: __initialize
def __initialize(self):
''' intial configuration for new instances of this class '''
Form.__init__(self)
self.StartPosition = FormStartPosition.Manual
self.Load += self.__install_persistent_bounds