def __init__(self, curveId):
    offset = 10
    self.Text = "Annotate Curve"
    crvlabel = Label(Text="Curve ID = "+str(curveId), AutoSize=True)
    self.Controls.Add(crvlabel)
    width = crvlabel.Right
    pt = Point(crvlabel.Left,crvlabel.Bottom + offset)
    labelstart = Label(Text="Text at start", AutoSize=True)
    labelstart.Location = pt
    self.Controls.Add(labelstart)
    pt.X = labelstart.Right + offset
    inputstart = TextBox(Text="Start")
    inputstart.Location = pt
    self.Controls.Add(inputstart)
    if( inputstart.Right > width ):
      width = inputstart.Right
    self.m_inputstart = inputstart

    pt.X  = labelstart.Left
    pt.Y  = labelstart.Bottom + offset*3
    buttonApply = Button(Text="Apply", DialogResult=DialogResult.OK)
    buttonApply.Location = pt
    self.Controls.Add(buttonApply)
    pt.X = buttonApply.Right + offset
    buttonCancel = Button(Text="Cancel", DialogResult=DialogResult.Cancel)
    buttonCancel.Location = pt
    self.Controls.Add(buttonCancel)
    if( buttonCancel.Right > width ):
      width = buttonCancel.Right
    self.ClientSize = Size(width, buttonCancel.Bottom)
    self.AcceptButton = buttonApply
    self.CancelButton = buttonCancel
Beispiel #2
0
   def __build_label(self, series_ref):
      ''' builds and returns the main text label for this form '''

      # 1. compute the best possible full name for the given SeriesRef   
      name_s = series_ref.series_name_s
      publisher_s = series_ref.publisher_s
      vol_year_n = series_ref.volume_year_n
      vol_year_s = sstr(vol_year_n) if vol_year_n > 0 else ''
      fullname_s = ''
      if name_s:
         if publisher_s:
            if vol_year_s:
               fullname_s = "'"+name_s+"' ("+publisher_s+", " + vol_year_s + ")"
            else:
               fullname_s = "'"+name_s+"' (" + publisher_s + ")"
         else:
            fullname_s = "'"+name_s+"'"
            
      
      label = Label()
      label.UseMnemonic = False
      sep = '  ' if len(fullname_s) > 40 else '\n'
      label.Text = i18n.get("IssueFormChooseText").format(fullname_s, sep)
         
      if self.__config.show_covers_b:
         label.Location = Point(218, 20)
         label.Size = Size(480, 40)
      else:
         label.Location = Point(10, 20)
         label.Size = Size(680, 40)
      
      return label
    def __build_label(self, series_ref):
        """ builds and returns the main text label for this form """

        # 1. compute the best possible full name for the given SeriesRef
        name_s = series_ref.series_name_s
        publisher_s = series_ref.publisher_s
        vol_year_n = series_ref.volume_year_n
        vol_year_s = sstr(vol_year_n) if vol_year_n > 0 else ""
        fullname_s = ""
        if name_s:
            if publisher_s:
                if vol_year_s:
                    fullname_s = "'" + name_s + "' (" + publisher_s + ", " + vol_year_s + ")"
                else:
                    fullname_s = "'" + name_s + "' (" + publisher_s + ")"
            else:
                fullname_s = "'" + name_s + "'"

        label = Label()
        label.UseMnemonic = False
        sep = "  " if len(fullname_s) > 40 else "\n"
        label.Text = i18n.get("IssueFormChooseText").format(fullname_s, sep)

        if self.__config.show_covers_b:
            label.Location = Point(218, 20)
            label.Size = Size(480, 40)
        else:
            label.Location = Point(10, 20)
            label.Size = Size(680, 40)

        return label
    def __init__(self, title, author):
        # Create the form
        self.Name = "Create Window"
        self.Text = title
        self.Size = Size(500, 150)
        self.CenterToScreen()

        self.value = ""

        # Create label for input title
        labelDiv = Label(Text=author + ":")
        labelDiv.Parent = self
        labelDiv.Size = Size(250, 250)
        labelDiv.Location = Point(30, 20)

        # Create TextBox for input
        self.textboxDiv = TextBox()
        self.textboxDiv.Parent = self
        self.textboxDiv.Text = "Date 1"
        self.textboxDiv.Size = Size(150, 150)
        self.textboxDiv.Location = Point(300, 20)

        # Create button
        button = Button()
        button.Parent = self
        button.Text = "Ok"
        button.Location = Point(300, 60)

        # Register event
        button.Click += self.ButtonClicked
    def __init__(self):  #the __init__ method inside a class is its constructor

        self.Text = "AU London"  #text that appears in the GUI titlebar
        self.Icon = Icon.FromHandle(icon.GetHicon())
        self.BackColor = Color.FromArgb(255, 255, 255)

        self.WindowState = FormWindowState.Normal
        self.CenterToScreen()
        self.BringToFront()
        self.TopMost = True

        screenSize = Screen.GetWorkingArea(self)
        self.Width = screenSize / 4
        self.Height = screenSize / 4

        uiWidth = self.DisplayRectangle.Width
        uiHeight = self.DisplayRectangle.Height

        spacing = 10

        userMessage = Label()
        font = Font("Helvetica", 10)
        userMessage.Text = message
        userMessage.Font = font
        userMessage.Location = Point(spacing, spacing)
        userMessage.Size = Size(uiWidth - (spacing * 2), (uiHeight / 4))
        self.Controls.Add(userMessage)
Beispiel #6
0
    def __init__(self, plan):
        # Set the size of the form
        self.Size = Size(500, 200)
        # Set title of the form
        self.Text = 'Approximate fiducial location'

        # Add a label
        label = Label()
        label.Text = 'Type the approximate fiducial location in mm'
        label.Location = Point(15, 15)
        label.AutoSize = True
        self.Controls.Add(label)

        # Add a TextBox
        self.textbox = TextBox()
        self.textbox.Location = Point(15, 60)
        self.textbox.Width = 150
        self.Controls.Add(self.textbox)

        # Add button to press OK and close the form
        button = Button()
        button.Text = 'OK'
        button.AutoSize = True
        button.Location = Point(15, 100)
        button.Click += self.ok_button_clicked
        self.Controls.Add(button)
Beispiel #7
0
    def __init__(self, curveId):
        offset = 10
        self.Text = "Annotate Curve"
        crvlabel = Label(Text="Curve ID = " + str(curveId), AutoSize=True)
        self.Controls.Add(crvlabel)
        width = crvlabel.Right
        pt = Point(crvlabel.Left, crvlabel.Bottom + offset)
        labelstart = Label(Text="Text at start", AutoSize=True)
        labelstart.Location = pt
        self.Controls.Add(labelstart)
        pt.X = labelstart.Right + offset
        inputstart = TextBox(Text="Start")
        inputstart.Location = pt
        self.Controls.Add(inputstart)
        if (inputstart.Right > width):
            width = inputstart.Right
        self.m_inputstart = inputstart

        pt.X = labelstart.Left
        pt.Y = labelstart.Bottom + offset * 3
        buttonApply = Button(Text="Apply", DialogResult=DialogResult.OK)
        buttonApply.Location = pt
        self.Controls.Add(buttonApply)
        pt.X = buttonApply.Right + offset
        buttonCancel = Button(Text="Cancel", DialogResult=DialogResult.Cancel)
        buttonCancel.Location = pt
        self.Controls.Add(buttonCancel)
        if (buttonCancel.Right > width):
            width = buttonCancel.Right
        self.ClientSize = Size(width, buttonCancel.Bottom)
        self.AcceptButton = buttonApply
        self.CancelButton = buttonCancel
Beispiel #8
0
    def __init__(self):
        self.Title="Timer"
        self.timer1=Timer()
        self.timer1.Interval=1000
        self.timer1.Tick+=self.timer1_tick
        label1=Label()
        label1.AutoSize=True
        label1.Location=Point(41,22)
        label1.Text="00:00:00"
        label1.Font=Font("MS UI Gothic",24.0,FontStyle.Regular)
        self.label1=label1
        self.Controls.Add(self.label1)

        clientwidth=255

        b1=Button()
        b1.Location=Point((clientwidth-b1.Width*2)/3,68)
        b1.Text="Click"
        b1.Click+=self.start_Click
        self.Controls.Add(b1)

        b2=Button()
        b2.Location=Point((clientwidth-b1.Width*2)*2/3+b1.Width,68)
        b2.Text="Stop"

        b2.Click+=self.stop_Click
        self.Controls.Add(b2)
        self.ClientSize=Size(clientwidth,103)
        self.Text="Stop Watch"
        self.StartPosition=FormStartPosition.CenterScreen
Beispiel #9
0
    def _initialize_components(self):
        self._generate_menu_strip()
        self._create_buttons()

        flags_description = Label()
        flags_description.Parent = self
        flags_description.Text = 'Flags:'
        flags_description.Location = Point(10, 30)
        flags_description.Size = TextRenderer.MeasureText(
            flags_description.Text, flags_description.DefaultFont)

        self._result = Label()
        self._result.Parent = self
        self._result.Text = ''
        self._result.Size = TextRenderer.MeasureText(self._result.Text,
                                                     self._result.DefaultFont)
        self._result.Location = Point(
            self.Size.Width / 2 - self._result.Size.Width / 2 - 5, 30)

        self._flags_counter = Label()
        self._flags_counter.Parent = self
        self._flags_counter.Location = Point(45, 30)
        self._flags_counter.Size = Size(30, 20)

        self._label_timer = Label()
        self._label_timer.Parent = self
        self._label_timer.TextAlign = ContentAlignment.MiddleRight
        self._label_timer.Location = Point(self.Size.Width - 70, 30)
        self._label_timer.Size = Size(40, 20)
    def __build_advancedtab(self):
        ''' builds and returns the "Advanced" Tab for the TabControl '''

        tabpage = TabPage()
        tabpage.Text = i18n.get("ConfigFormAdvancedTab")

        # 1. --- a description label for this tabpage
        label = Label()
        label.UseMnemonic = False
        label.AutoSize = True
        label.Location = Point(14, 25)
        label.Size = Size(299, 17)
        label.Text = i18n.get("ConfigFormAdvancedText")

        # 2. --- build the update checklist (contains all the 'data' checkboxes)
        tbox = RichTextBox()
        tbox.Multiline = True
        tbox.MaxLength = 65536
        tbox.WordWrap = True
        tbox.Location = Point(15, 50)
        tbox.Size = Size(355, 200)

        menu = ContextMenu()
        items = menu.MenuItems
        items.Add(MenuItem(i18n.get("TextCut"), lambda s, ea: tbox.Cut()))
        items.Add(MenuItem(i18n.get("TextCopy"), lambda s, ea: tbox.Copy()))
        items.Add(MenuItem(i18n.get("TextPaste"), lambda s, ea: tbox.Paste()))
        tbox.ContextMenu = menu
        self.__advanced_tbox = tbox

        # 3. --- add 'em all to the tabpage
        tabpage.Controls.Add(label)
        tabpage.Controls.Add(self.__advanced_tbox)

        return tabpage
Beispiel #11
0
    def __init__(self):
        self.Text = "Spreadsheet to HTML"
        self.Width = 220
        self.Height = 90
        self.FormBorderStyle = FormBorderStyle.Fixed3D

        self.openDialog = OpenFileDialog()
        self.openDialog.Title = "Choose a Python Spreadsheet File"
        self.openDialog.Filter = 'Python files (*.py)|*.py|All files (*.*)|*.*'

        self.folderDialog = FolderBrowserDialog()
        self.folderDialog.ShowNewFolderButton = True
        self.folderDialog.Description = "Choose a directory to save the HTML files in."

        l = Label()
        l.AutoSize = True
        l.Location = Point(50, 5)
        l.Text = "Choose a Spreadsheet"

        b = Button(Text="Choose")
        b.Click += self.convert
        b.Location = Point(70, 30)

        self.Controls.Add(l)
        self.Controls.Add(b)
Beispiel #12
0
 def addNameLabel(self, name, imageName, location):
     label = Label()
     label.Parent = self
     label.AutoSize = True
     label.Location = location
     label.Text = name
     label.MouseEnter += lambda *_: self.switchImage(imageName)
     label.MouseLeave += self.resetImage
    def __build_label(self):
        ''' builds and returns the text label for this form '''

        label = Label()
        label.UseMnemonic = False
        label.Location = Point(10, 110 if self.__fail_label_is_visible else 10)
        label.Size = Size(415, 20)
        label.Text = i18n.get("SearchFormText")
        return label
   def __build_label(self):
      ''' builds and returns the text label for this form '''

      label = Label()
      label.UseMnemonic = False
      label.Location = Point(10, 110 if self.__fail_label_is_visible else 10)
      label.Size = Size(415, 20)
      label.Text = i18n.get("SearchFormText")
      return label
 def __build_label(self):
    ''' Builds and returns the label for this form. '''
    
    label = Label()
    label.UseMnemonic = False
    label.Text = '' # updated everytime we start scraping a new comic
    label.Location = Point(13, 45)
    label.Size = Size(320, 15)
    label.Anchor = AnchorStyles.Top | AnchorStyles.Left |AnchorStyles.Right
    label.AutoSize = False
    return label
   def __build_fail_label(self, failed_search_s):
      ''' builds and returns the 'search failed' text label for this form.
          if there is no failed search terms, this returns None. '''

      label = Label()
      label.UseMnemonic = False
      label.Location = Point(10, 10)
      label.Size = Size(415, 100)
      label.Visible = self.__fail_label_is_visible   
      if self.__fail_label_is_visible:
         label.Text = i18n.get("SeriesSearchFailedText").format(failed_search_s)
         
      return label
   def __build_skip_label(self, skipped_n):
      ''' 
      Builds and returns the 'number skipped' Label for this form.
      'skipped_n' -> the number of books that were skipped. 
      '''

      label = Label()
      label.UseMnemonic = False
      label.Location = Point(10, 30) 
      label.Size = Size(280, 13)
      label.TextAlign = ContentAlignment.MiddleCenter
      label.Text = i18n.get("FinishFormSkippedSingle") if skipped_n==1 else \
         i18n.get("FinishFormSkippedPlural").format(skipped_n)
      return label
Beispiel #18
0
    def __build_skip_label(self, skipped_n):
        ''' 
      Builds and returns the 'number skipped' Label for this form.
      'skipped_n' -> the number of books that were skipped. 
      '''

        label = Label()
        label.UseMnemonic = False
        label.Location = Point(10, 30)
        label.Size = Size(280, 13)
        label.TextAlign = ContentAlignment.MiddleCenter
        label.Text = i18n.get("FinishFormSkippedSingle") if skipped_n==1 else \
           i18n.get("FinishFormSkippedPlural").format(skipped_n)
        return label
    def __build_fail_label(self, failed_search_s):
        ''' builds and returns the 'search failed' text label for this form.
          if there is no failed search terms, this returns None. '''

        label = Label()
        label.UseMnemonic = False
        label.Location = Point(10, 10)
        label.Size = Size(415, 100)
        label.Visible = self.__fail_label_is_visible
        if self.__fail_label_is_visible:
            label.Text = i18n.get("SeriesSearchFailedText").format(
                failed_search_s)

        return label
    def __build_comicvinetab(self):
        ''' builds and returns the "ComicVine" Tab for the TabControl '''

        tabpage = TabPage()
        tabpage.Text = i18n.get("ConfigFormComicVineTab")
        tabpage.Name = "comicvine"

        # 1. --- a description label for this tabpage
        label = Label()
        label.UseMnemonic = False
        label.AutoSize = False
        label.Location = Point(34, 80)
        label.Size = Size(315, 54)
        label.Text = i18n.get("ConfigFormComicVineText")

        # 2. --- the API key text box
        fired_update_gui = self.__fired_update_gui

        class ApiKeyTextBox(TextBox):
            def OnTextChanged(self, args):
                fired_update_gui()

        self.__api_key_tbox = ApiKeyTextBox()
        tbox = self.__api_key_tbox
        tbox.Location = Point(34, 135)
        tbox.Size = Size(315, 1)

        menu = ContextMenu()
        items = menu.MenuItems
        items.Add(MenuItem(i18n.get("TextCut"), lambda s, ea: tbox.Cut()))
        items.Add(MenuItem(i18n.get("TextCopy"), lambda s, ea: tbox.Copy()))
        items.Add(MenuItem(i18n.get("TextPaste"), lambda s, ea: tbox.Paste()))
        tbox.ContextMenu = menu

        # 3. --- add a clickable link to send the user to ComicVine
        linklabel = LinkLabel()
        linklabel.UseMnemonic = False
        linklabel.AutoSize = False
        linklabel.Location = Point(34, 170)
        linklabel.Size = Size(315, 34)
        linklabel.Text = i18n.get("ConfigFormComicVineClickHere")
        linklabel.LinkClicked += self.__fired_linkclicked

        # 4. --- add 'em all to this tabpage
        tabpage.Controls.Add(label)
        tabpage.Controls.Add(tbox)
        tabpage.Controls.Add(linklabel)

        return tabpage
    def __init__(self):

        self.Text = "You know I'm No Good"

        font = Font("Serif", 10)

        lyrics = Label()
        lyrics.Parent = self
        lyrics.Text = text
        lyrics.Font = font
        lyrics.Location = Point(10, 10)
        lyrics.Size = Size(390, 390)
        
        self.Size = Size(400,400)
        self.CenterToScreen()
 def __build_comicvinetab(self):
    ''' builds and returns the "ComicVine" Tab for the TabControl '''
    
    tabpage = TabPage()
    tabpage.Text = i18n.get("ConfigFormComicVineTab")
    tabpage.Name = "comicvine"
    
    # 1. --- a description label for this tabpage
    label = Label()
    label.UseMnemonic = False
    label.AutoSize = False
    label.Location = Point(34, 80)
    label.Size = Size(315, 54)
    label.Text = i18n.get("ConfigFormComicVineText")
    
    # 2. --- the API key text box 
    fired_update_gui = self.__fired_update_gui
    class ApiKeyTextBox(TextBox):
       def OnTextChanged(self, args):
          fired_update_gui()
          
    self.__api_key_tbox = ApiKeyTextBox()
    tbox = self.__api_key_tbox
    tbox.Location = Point(34, 135)
    tbox.Size = Size(315, 1)
    
    menu = ContextMenu()
    items = menu.MenuItems
    items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) )
    items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) )
    items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) )
    tbox.ContextMenu = menu
    
    # 3. --- add a clickable link to send the user to ComicVine
    linklabel = LinkLabel()
    linklabel.UseMnemonic = False
    linklabel.AutoSize = False
    linklabel.Location = Point(34, 170) 
    linklabel.Size = Size(315, 34)
    linklabel.Text = i18n.get("ConfigFormComicVineClickHere")
    linklabel.LinkClicked += self.__fired_linkclicked
    
    # 4. --- add 'em all to this tabpage
    tabpage.Controls.Add(label)
    tabpage.Controls.Add(tbox)
    tabpage.Controls.Add(linklabel)
    
    return tabpage
   def __build_label(self, books):
      ''' 
      Builds and returns the Label for this form.
      'books' -> a list of all the comic books being scraped. 
      '''

      plural = len(books) != 1
      
      label = Label()
      label.UseMnemonic = False
      label.AutoSize = True
      label.Location = Point(9, 10)
      label.Size = Size(319, 13)
      label.Text = i18n.get("WelcomeFormTextPlural").format(len(books)) \
         if plural else i18n.get("WelcomeFormTextSingle")
      return label
Beispiel #24
0
    def __init__(self):
        self.Text = "Hello World"
        self.FormBorderStyle = FormBorderStyle.Fixed3D
        self.Height = 150
        
        newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic)

        label = Label()
        label.AutoSize = True
        label.Text = "My Hello World Label"
        label.Location = Point(10, 50)
        label.BackColor = Color.Aquamarine
        label.ForeColor = Color.DarkMagenta
        label.Font = newFont

        self.Controls.Add(label)
Beispiel #25
0
    def __init__(self, curveId):
        offset = 10
        index = 0

        # header
        self.Text = "Annotate Curve"

        #label
        crvlabel = Label(Text="Curve ID = " + str(curveId), AutoSize=True)
        self.Controls.Add(crvlabel)
        width = crvlabel.Right
        pt = Point(crvlabel.Left, crvlabel.Bottom + offset)

        #textInput
        labelstart = Label(Text="Text at start", AutoSize=True)
        labelstart.Location = pt
        self.Controls.Add(labelstart)
        pt.X = labelstart.Right + offset
        inputstart = TextBox(Text="Start")
        inputstart.Location = pt
        self.Controls.Add(inputstart)
        if (inputstart.Right > width):
            width = inputstart.Right
        self.m_inputstart = inputstart

        index += 1
        cb = CheckBox()
        cb.Parent = self
        cb.Location = Point(30, labelstart.Bottom + offset * index)
        cb.Text = "Show Title"
        cb.Checked = True

        pt.X = labelstart.Left
        pt.Y = labelstart.Bottom + offset * 3
        buttonApply = Button(Text="Apply", DialogResult=DialogResult.OK)
        buttonApply.Location = pt
        self.Controls.Add(buttonApply)
        pt.X = buttonApply.Right + offset
        buttonCancel = Button(Text="Cancel", DialogResult=DialogResult.Cancel)
        buttonCancel.Location = pt
        self.Controls.Add(buttonCancel)
        if (buttonCancel.Right > width):
            width = buttonCancel.Right
        self.ClientSize = Size(width, buttonCancel.Bottom)
        self.AcceptButton = buttonApply
        self.CancelButton = buttonCancel
Beispiel #26
0
 def __build_label(self, search_terms_s, num_matches_n):
    ''' 
    Builds and return the text label for this form.
    'search_terms_s' -> user's search string that was used to find series
    'num_matches_n' -> number of series (table rows) the user's search matched
    '''
    
    label = Label()
    label.UseMnemonic = False
    label.Location = Point(10, 20)
    label.Size = Size(480, 40)
    if num_matches_n > 1:
       label.Text = i18n.get("SeriesFormChooseText")\
          .format(search_terms_s, num_matches_n )
    else:
       label.Text = i18n.get("SeriesFormConfirmText").format(search_terms_s)
    return label
Beispiel #27
0
    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
 def __build_advancedtab(self):
    ''' builds and returns the "Advanced" Tab for the TabControl '''
    
    tabpage = TabPage()
    tabpage.Text = i18n.get("ConfigFormAdvancedTab")
    
    
    # 1. --- a description label for this tabpage
    label = Label()
    label.UseMnemonic = False
    label.AutoSize = True
    label.Location = Point(14, 25)
    label.Size = Size(299, 17)
    label.Text = i18n.get("ConfigFormAdvancedText")
    
    
    # 2. --- build the update checklist (contains all the 'data' checkboxes)
    tbox = RichTextBox()
    tbox.Multiline=True
    tbox.MaxLength=65536
    tbox.WordWrap = True
    tbox.Location = Point(15, 50)
    tbox.Size = Size(355, 200)
    
    menu = ContextMenu()
    items = menu.MenuItems
    items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) )
    items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) )
    items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) )
    tbox.ContextMenu = menu
    self.__advanced_tbox = tbox
    
    # 3. --- add 'em all to the tabpage 
    tabpage.Controls.Add(label)
    tabpage.Controls.Add(self.__advanced_tbox)
    
    return tabpage
Beispiel #29
0
 def __init__(self):
     self.patient = patient
     self.Text = 'My Form'  #title of the new format
     self.AutoSize = True
     labelX1 = Label()
     labelX2 = Label()
     labelX1.Text = 'What is'
     labelX2.Text = 'this?'
     labelX1.Location = Point(15, 28)
     labelX2.Location = Point(120, 28)
     labelX1.Width = 50
     labelX2.Width = 50
     labelX1.Height = 20
     labelX2.Height = 40
     self.Controls.Add(labelX1)
     self.Controls.Add(labelX2)
     # create a textbox property of the form
     self.textbox1 = TextBox()
     self.textbox1.Location = Point(50, 200)
     self.textbox1.Width = 120
     self.textbox1.Height = 50
     self.Controls.Add(self.textbox1)
     # implement an interaction button
     self.button1 = Button()
     self.button1.Text = "Auto-fill current patient name"
     self.button1.Location = Point(50, 120)
     self.button1.Width = 150
     self.button1.Height = 45
     self.Controls.Add(self.button1)
     self.button1.Click += self.button1_clicked
     # add checklist question
     self.question1 = Label()
     self.question1.Text = "Which actions have you finished so far?"
     self.question1.Location = Point(15, 280)
     self.question1.AutoSize = True
     self.Controls.Add(self.question1)
     # first checkbox
     self.check1 = CheckBox()
     self.check1.Text = "Patient modelling"
     self.check1.Location = Point(20, 310)
     self.check1.AutoSize = True
     self.check1.Checked = False
     self.Controls.Add(self.check1)
     self.check1.CheckedChanged += self.checkedChanged
     # second checkbox
     self.check2 = CheckBox()
     self.check2.Text = "Plan design"
     self.check2.Location = Point(20, 340)
     self.check2.AutoSize = True
     self.check2.Checked = False
     self.Controls.Add(self.check2)
     self.check2.CheckedChanged += self.checkedChanged
     # add checklist response message
     self.response1 = Label()
     self.response1.Text = "-"
     self.response1.Location = Point(160, 340)
     self.response1.AutoSize = True
     self.Controls.Add(self.response1)
     # generate combobox
     self.question2 = Label()
     self.question2.Text = "Select an ROI"
     self.question2.Location = Point(320, 310)
     self.question2.AutoSize = True
     self.Controls.Add(self.question2)
     rois = [r.Name for r in patient.PatientModel.RegionsOfInterest]
     self.combobox = ComboBox()
     self.combobox.Location = Point(320, 340)
     self.combobox.DataSource = rois
     self.Controls.Add(self.combobox)
     self.combobox.SelectionChangeCommitted += self.comboSelection
     # generate combobox response
     self.response2 = Label()
     self.response2.Text = ""
     self.response2.Location = Point(320, 380)
     self.response2.AutoSize = True
     self.Controls.Add(self.response2)
	def __init__(self):
		self.patient = patient
		self.Text = 'My Form' #title of the new format
		self.AutoSize = True
		labelX1 = Label()
		labelX2 = Label()
		labelX1.Text = 'What is'
		labelX2.Text = 'this?'
		labelX1.Location = Point(15,28)
		labelX2.Location = Point(120,28)
		labelX1.Width = 50
		labelX2.Width = 50
		labelX1.Height = 20
		labelX2.Height = 40
		self.Controls.Add(labelX1)
		self.Controls.Add(labelX2)
		# create a textbox property of the form
		self.textbox1 = TextBox()
		self.textbox1.Location = Point(50,200)
		self.textbox1.Width = 120
		self.textbox1.Height = 50
		self.Controls.Add(self.textbox1)
		# implement an interaction button
		self.button1 = Button()
		self.button1.Text = "Auto-fill current patient name"
		self.button1.Location = Point(50, 120)
		self.button1.Width = 150
		self.button1.Height = 45
		self.Controls.Add(self.button1)
		self.button1.Click += self.button1_clicked
		# add checklist question
		self.question1 = Label()
		self.question1.Text = "Which actions have you finished so far?"
		self.question1.Location = Point(15,280)
		self.question1.AutoSize = True
		self.Controls.Add(self.question1)
		# first checkbox
		self.check1 = CheckBox()
		self.check1.Text = "Patient modelling"
		self.check1.Location = Point(20,310)
		self.check1.AutoSize = True
		self.check1.Checked = False
		self.Controls.Add(self.check1)
		self.check1.CheckedChanged += self.checkedChanged
		# second checkbox
		self.check2 = CheckBox()
		self.check2.Text = "Plan design"
		self.check2.Location = Point(20,340)
		self.check2.AutoSize = True
		self.check2.Checked = False
		self.Controls.Add(self.check2)
		self.check2.CheckedChanged += self.checkedChanged
		# add checklist response message
		self.response1 = Label()
		self.response1.Text = "-"
		self.response1.Location = Point(160,340)
		self.response1.AutoSize = True
		self.Controls.Add(self.response1)
		# generate combobox
		self.question2 = Label()
		self.question2.Text = "Select an ROI"
		self.question2.Location = Point(320,310)
		self.question2.AutoSize = True
		self.Controls.Add(self.question2)
		rois = [r.Name for r in patient.PatientModel.RegionsOfInterest]
		self.combobox = ComboBox()
		self.combobox.Location = Point(320,340)
		self.combobox.DataSource = rois
		self.Controls.Add(self.combobox)
		self.combobox.SelectionChangeCommitted += self.comboSelection
		# generate combobox response
		self.response2 = Label()
		self.response2.Text = ""
		self.response2.Location = Point(320,380)
		self.response2.AutoSize = True
		self.Controls.Add(self.response2)
 def __build_behaviourtab(self):
    ''' builds and returns the "Behaviour" Tab for the TabControl '''
    
    tabpage = TabPage()
    tabpage.Text = i18n.get("ConfigFormBehaviourTab")
    
    # 1. --- build the 'When scraping for the first time' label
    first_scrape_label = Label()
    first_scrape_label.AutoSize = False
    first_scrape_label.FlatStyle = FlatStyle.System
    first_scrape_label.Location = Point(52, 27)
    first_scrape_label.Text = i18n.get("ConfigFormFirstScrapeLabel")
    first_scrape_label.Size = Size(300, 17)
    
    # 1. --- build the 'autochoose series' checkbox
    self.__autochoose_series_cb = CheckBox()
    self.__autochoose_series_cb.AutoSize = False
    self.__autochoose_series_cb.FlatStyle = FlatStyle.System
    self.__autochoose_series_cb.Location = Point(82, 45)
    self.__autochoose_series_cb.Size = Size(300, 34)
    self.__autochoose_series_cb.Text =i18n.get("ConfigFormAutochooseSeriesCB")
    self.__autochoose_series_cb.CheckedChanged += self.__fired_update_gui
     
    # 2. --- build the 'confirm issue' checkbox
    self.__confirm_issue_cb = CheckBox()
    self.__confirm_issue_cb.AutoSize = False
    self.__confirm_issue_cb.FlatStyle = FlatStyle.System
    self.__confirm_issue_cb.Location = Point(82, 75)
    self.__confirm_issue_cb.Size = Size(300, 34)
    self.__confirm_issue_cb.Text = i18n.get("ConfigFormConfirmIssueCB")
    self.__confirm_issue_cb.CheckedChanged += self.__fired_update_gui
    
    # 3. -- build the 'use fast rescrape' checkbox
    self.__fast_rescrape_cb = CheckBox()
    self.__fast_rescrape_cb.AutoSize = False
    self.__fast_rescrape_cb.FlatStyle = FlatStyle.System
    self.__fast_rescrape_cb.Location = Point(52, 116)
    self.__fast_rescrape_cb.Size = Size(300, 34)
    self.__fast_rescrape_cb.Text = i18n.get("ConfigFormRescrapeCB")
    self.__fast_rescrape_cb.CheckedChanged += self.__fired_update_gui
    
    # 4. -- build the 'add rescrape hints to notes' checkbox
    self.__rescrape_notes_cb = CheckBox()
    self.__rescrape_notes_cb.AutoSize = False
    self.__rescrape_notes_cb.FlatStyle = FlatStyle.System
    self.__rescrape_notes_cb.Location = Point(82, 151)
    self.__rescrape_notes_cb.Size = Size(270, 17)
    self.__rescrape_notes_cb.Text = i18n.get("ConfigFormRescrapeNotesCB")
    self.__rescrape_notes_cb.CheckedChanged += self.__fired_update_gui
    
    # 5. -- build the 'add rescrape hints to tags' checkbox
    self.__rescrape_tags_cb = CheckBox()
    self.__rescrape_tags_cb.AutoSize = False
    self.__rescrape_tags_cb.FlatStyle = FlatStyle.System
    self.__rescrape_tags_cb.Location = Point(82, 181)
    self.__rescrape_tags_cb.Size = Size(270, 17)
    self.__rescrape_tags_cb.Text = i18n.get("ConfigFormRescrapeTagsCB")
    self.__rescrape_tags_cb.CheckedChanged += self.__fired_update_gui 
 
    # 6. --- build the 'specify series name' checkbox
    self.__summary_dialog_cb = CheckBox()
    self.__summary_dialog_cb.AutoSize = False
    self.__summary_dialog_cb.FlatStyle = FlatStyle.System
    self.__summary_dialog_cb.Location = Point(52, 214)
    self.__summary_dialog_cb.Size = Size(300, 34)
    self.__summary_dialog_cb.Text = i18n.get("ConfigFormShowSummaryCB")
    self.__summary_dialog_cb.CheckedChanged += self.__fired_update_gui 
          
    # 7. --- add 'em all to the tabpage 
    tabpage.Controls.Add(first_scrape_label)
    tabpage.Controls.Add(self.__autochoose_series_cb)
    tabpage.Controls.Add(self.__confirm_issue_cb)
    tabpage.Controls.Add(self.__fast_rescrape_cb)
    tabpage.Controls.Add(self.__rescrape_tags_cb)
    tabpage.Controls.Add(self.__rescrape_notes_cb)
    tabpage.Controls.Add(self.__summary_dialog_cb)
    
    return tabpage
 def __build_detailstab(self):
    ''' builds and returns the "Details" Tab for the TabControl '''
    
    tabpage = TabPage()
    tabpage.Text = i18n.get("ConfigFormDetailsTab")
    tabpage.Name = "details"
    
    # 1. --- a description label for this tabpage
    label = Label()
    label.UseMnemonic = False
    label.AutoSize = True
    label.Location = Point(14, 35)
    label.Size = Size(299, 17)
    label.Text = i18n.get("ConfigFormDetailsText")
    
    # 2. --- the 'select all' button
    checkall_button = Button()
    checkall_button.Click += self.__fired_checkall
    checkall_button.Location = Point(280, 107)
    checkall_button.Size = Size(100, 23)
    checkall_button.Text = i18n.get("ConfigFormDetailsAll")
    
    # 3. --- the 'deselect all' button
    uncheckall_button = Button()
    uncheckall_button.Click += self.__fired_uncheckall
    uncheckall_button.Location = Point(280, 138)
    uncheckall_button.Size = Size(100, 23)
    uncheckall_button.Text = i18n.get("ConfigFormDetailsNone")
    
    # 4. --- build the update checklist (contains all the 'data' checkboxes)
    self.__update_checklist = CheckedListBox()
    self.__update_checklist.CheckOnClick = True
    self.__update_checklist.ColumnWidth = 125
    self.__update_checklist.ThreeDCheckBoxes = True
    self.__update_checklist.Location = Point(15, 65)
    self.__update_checklist.MultiColumn = True
    self.__update_checklist.SelectionMode = SelectionMode.One
    self.__update_checklist.Size = Size(260, 170)
    self.__update_checklist.ItemCheck += self.__fired_update_gui
    
    self.__update_checklist.Items.Add(ConfigForm.__SERIES_CB)
    self.__update_checklist.Items.Add(ConfigForm.__VOLUME_CB)
    self.__update_checklist.Items.Add(ConfigForm.__NUMBER_CB)
    self.__update_checklist.Items.Add(ConfigForm.__TITLE_CB)
    self.__update_checklist.Items.Add(ConfigForm.__PUBLISHED_CB)
    self.__update_checklist.Items.Add(ConfigForm.__RELEASED_CB)
    self.__update_checklist.Items.Add(ConfigForm.__CROSSOVERS_CB)
    self.__update_checklist.Items.Add(ConfigForm.__PUBLISHER_CB)
    self.__update_checklist.Items.Add(ConfigForm.__IMPRINT_CB)
    self.__update_checklist.Items.Add(ConfigForm.__WRITER_CB)
    self.__update_checklist.Items.Add(ConfigForm.__PENCILLER_CB)
    self.__update_checklist.Items.Add(ConfigForm.__INKER_CB)
    self.__update_checklist.Items.Add(ConfigForm.__COLORIST_CB)
    self.__update_checklist.Items.Add(ConfigForm.__LETTERER_CB)
    self.__update_checklist.Items.Add(ConfigForm.__COVER_ARTIST_CB)
    self.__update_checklist.Items.Add(ConfigForm.__EDITOR_CB)
    self.__update_checklist.Items.Add(ConfigForm.__SUMMARY_CB)
    self.__update_checklist.Items.Add(ConfigForm.__CHARACTERS_CB)
    self.__update_checklist.Items.Add(ConfigForm.__TEAMS_CB)
    self.__update_checklist.Items.Add(ConfigForm.__LOCATIONS_CB)     
    self.__update_checklist.Items.Add(ConfigForm.__WEBPAGE_CB)
 
    # 5. --- add 'em all to this tabpage
    tabpage.Controls.Add(label)
    tabpage.Controls.Add(checkall_button)
    tabpage.Controls.Add(uncheckall_button)
    tabpage.Controls.Add(self.__update_checklist)
    
    return tabpage
Beispiel #33
0

def clicked(sender, args):
    global count
    global button
    count += 1
    button.Text = "Clicked %s times" % count


a = Form()
a.Text = "Hi"
a.Name = "Hi"

label = Label()
label.Text = "lel"
label.Location = Point(50, 50)
label.Height = 30
label.Width = 200
a.Controls.Add(label)

button = Button()
button.Text = "yeman"
button.Location = Point(100, 100)
button.Height = 30
button.Width = 50
button.Click += clicked
a.Controls.Add(button)

Application.Run(a)

# window = Tk()
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Windows.Forms import (Application, Form, FormBorderStyle, Label)
from System.Drawing import (Color, Font, FontStyle, Point)

form = Form()
form.Text = "Hello World"
form.FormBorderStyle = FormBorderStyle.Fixed3D
form.Height = 150

newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic)

label = Label()
label.AutoSize = True
label.Text = "My Hello World Label"
label.Location = Point(10, 50)
label.BackColor = Color.Aquamarine
label.ForeColor = Color.DarkMagenta
label.Font = newFont

form.Controls.Add(label)

Application.Run(form)
    def __init__(self):  #the __init__ method inside a class is its constructor

        self.Text = "AU London"  #text that appears in the GUI titlebar
        self.Icon = Icon.FromHandle(
            icon.GetHicon()
        )  #takes a bitmap image and converts to a file that can be used as a Icon for the titlebar
        self.BackColor = Color.FromArgb(255, 255, 255)

        self.WindowState = FormWindowState.Normal  # set maximised minimised or normal size GUI
        self.CenterToScreen()  # centres GUI to the middle of your screen
        self.BringToFront()  #brings the GUI to the front of all opens windows.
        self.Topmost = True  # true to display the GUI infront of any other active forms

        screenSize = Screen.GetWorkingArea(
            self
        )  #get the size of the computers main screen, as the form will scale differently to different sized screens
        self.Width = screenSize.Width / 4  #set the size of the form based on the size of the users screen. this helps to ensure consistant look across different res screens.
        self.Height = screenSize.Height / 4
        uiWidth = self.DisplayRectangle.Width  #get the size of the form to use to scale form elements
        uiHeight = self.DisplayRectangle.Height

        #self.FormBorderStyle = FormBorderStyle.FixedDialog      # fixed dialog stops the user from adjusting the form size. Recomended disabling this when testing to see if elements are in the wrong place.

        self.userOutput = userOutputDefaultStr  #create a container to store the output from the form
        self.runNextOutput = False  #set these default values

        #############-------------\-------------#############
        spacing = 10  #spacing size for GUI elements to form a consistent border

        # creates the text box for a info message
        userMessage = Label()  #label displays texts
        font = Font("Helvetica ", 10)
        userMessage.Text = message
        userMessage.Font = font
        userMessage.Location = Point(
            spacing, spacing
        )  #all location require a point object from system.Drawing to set the location.
        userMessage.Size = Size(
            uiWidth - (spacing * 2), (uiHeight / 4)
        )  #size the control with the width of the GUI to ensure it scales with different screen
        self.Controls.Add(userMessage)  #this adds control element to the GUI

        #############-------------\-------------#############
        #logo file
        logo = PictureBox()
        logo.Image = logoFile
        ratio = float(logo.Height) / float(
            logo.Width
        )  #needs to be a float as int will round to the nearest whole number
        logo.Size = Size(
            uiWidth / 4, (uiHeight / 4) * ratio
        )  #scale the image by the ratio between the images height & width
        logo.Location = Point(spacing, (uiHeight - logo.Height) - spacing)
        logo.SizeMode = PictureBoxSizeMode.Zoom  # zooms the image to fit the extent
        logo.Anchor = (
            AnchorStyles.Bottom | AnchorStyles.Left
        )  #anchor styles lock elements to a given corner of the GUI if you allow users change size
        self.Controls.Add(logo)
        #logo.BorderStyle = BorderStyle.Fixed3D    #gives a border to the panel to test its location

        #############-------------\-------------#############

        #combox drop down
        cBox = ComboBox()  #dropdown control form
        cBox.Location = Point(spacing, uiHeight / 3)
        cBox.Width = uiWidth - (spacing * 2)
        cBox.Items.AddRange(
            listInput
        )  # Adds an array of items to the list of items for a ComboBox.
        cBox.DropDownStyle = ComboBoxStyle.DropDownList  #setting to dropdown list prevents users from being able to add aditional text values
        cBox.SelectedIndexChanged += self.dropDownOutput  #.Click+= registers the press of the button to register the event handler and determine what action takes place when button clicked
        self.Controls.Add(cBox)

        #############-------------\-------------#############

        #Create ok button
        btnOk = Button()  #create a button control
        btnOk.Text = "Next"
        btnOk.Location = Point(uiWidth - ((btnOk.Width * 2) + spacing),
                               uiHeight - (btnOk.Height + spacing))
        btnOk.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right)
        btnOk.Click += self.okButtonPressed  #Register the event on the button bress to trigger the def okButtonPressed
        self.Controls.Add(btnOk)

        #Create Cancel Button
        btnCancel = Button()
        #btnCancel.Parent = self
        btnCancel.Text = "Cancel"
        btnCancel.Location = Point(uiWidth - (btnOk.Width + spacing),
                                   uiHeight - (btnOk.Height + spacing))
        btnCancel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right)
        btnCancel.Click += self.CnlButtonPressed
        self.Controls.Add(btnCancel)
    def __build_detailstab(self):
        ''' builds and returns the "Details" Tab for the TabControl '''

        tabpage = TabPage()
        tabpage.Text = i18n.get("ConfigFormDetailsTab")
        tabpage.Name = "details"

        # 1. --- a description label for this tabpage
        label = Label()
        label.UseMnemonic = False
        label.AutoSize = True
        label.Location = Point(14, 35)
        label.Size = Size(299, 17)
        label.Text = i18n.get("ConfigFormDetailsText")

        # 2. --- the 'select all' button
        checkall_button = Button()
        checkall_button.Click += self.__fired_checkall
        checkall_button.Location = Point(280, 107)
        checkall_button.Size = Size(100, 23)
        checkall_button.Text = i18n.get("ConfigFormDetailsAll")

        # 3. --- the 'deselect all' button
        uncheckall_button = Button()
        uncheckall_button.Click += self.__fired_uncheckall
        uncheckall_button.Location = Point(280, 138)
        uncheckall_button.Size = Size(100, 23)
        uncheckall_button.Text = i18n.get("ConfigFormDetailsNone")

        # 4. --- build the update checklist (contains all the 'data' checkboxes)
        self.__update_checklist = CheckedListBox()
        self.__update_checklist.CheckOnClick = True
        self.__update_checklist.ColumnWidth = 125
        self.__update_checklist.ThreeDCheckBoxes = True
        self.__update_checklist.Location = Point(15, 65)
        self.__update_checklist.MultiColumn = True
        self.__update_checklist.SelectionMode = SelectionMode.One
        self.__update_checklist.Size = Size(260, 170)
        self.__update_checklist.ItemCheck += self.__fired_update_gui

        self.__update_checklist.Items.Add(ConfigForm.__SERIES_CB)
        self.__update_checklist.Items.Add(ConfigForm.__VOLUME_CB)
        self.__update_checklist.Items.Add(ConfigForm.__NUMBER_CB)
        self.__update_checklist.Items.Add(ConfigForm.__TITLE_CB)
        self.__update_checklist.Items.Add(ConfigForm.__PUBLISHED_CB)
        self.__update_checklist.Items.Add(ConfigForm.__RELEASED_CB)
        self.__update_checklist.Items.Add(ConfigForm.__CROSSOVERS_CB)
        self.__update_checklist.Items.Add(ConfigForm.__PUBLISHER_CB)
        self.__update_checklist.Items.Add(ConfigForm.__IMPRINT_CB)
        self.__update_checklist.Items.Add(ConfigForm.__WRITER_CB)
        self.__update_checklist.Items.Add(ConfigForm.__PENCILLER_CB)
        self.__update_checklist.Items.Add(ConfigForm.__INKER_CB)
        self.__update_checklist.Items.Add(ConfigForm.__COLORIST_CB)
        self.__update_checklist.Items.Add(ConfigForm.__LETTERER_CB)
        self.__update_checklist.Items.Add(ConfigForm.__COVER_ARTIST_CB)
        self.__update_checklist.Items.Add(ConfigForm.__EDITOR_CB)
        self.__update_checklist.Items.Add(ConfigForm.__SUMMARY_CB)
        self.__update_checklist.Items.Add(ConfigForm.__CHARACTERS_CB)
        self.__update_checklist.Items.Add(ConfigForm.__TEAMS_CB)
        self.__update_checklist.Items.Add(ConfigForm.__LOCATIONS_CB)
        self.__update_checklist.Items.Add(ConfigForm.__WEBPAGE_CB)

        # 5. --- add 'em all to this tabpage
        tabpage.Controls.Add(label)
        tabpage.Controls.Add(checkall_button)
        tabpage.Controls.Add(uncheckall_button)
        tabpage.Controls.Add(self.__update_checklist)

        return tabpage
    def __init__(self, title):
        # Create the form
        self.Name = "Create Window"
        self.Text = title
        self.Size = Size(370, 590)
        self.CenterToScreen()

        self.value = ""
        self.value1 = ""
        self.value2 = ""
        self.value3 = ""
        self.value4 = ""
        self.value5 = ""
        self.value6 = ""
        self.value7 = ""
        self.value8 = ""
        self.finalValue = []

        # Create label for input title
        labelDiv = Label(Text="Door Type")
        labelDiv.Parent = self
        labelDiv.Size = Size(150, 20)
        labelDiv.Location = Point(30, 40)
        # Create TextBox for input
        self.textboxDiv = TextBox()
        self.textboxDiv.Parent = self
        self.textboxDiv.Text = ""
        self.textboxDiv.Location = Point(200, 40)

        # Create label for input title
        labelDiv1 = Label(Text="Door Frame Type")
        labelDiv1.Parent = self
        labelDiv1.Size = Size(150, 20)
        labelDiv1.Location = Point(30, 80)
        # Create TextBox for input
        self.textboxDiv1 = TextBox()
        self.textboxDiv1.Parent = self
        self.textboxDiv1.Text = ""
        self.textboxDiv1.Location = Point(200, 80)

        # Create label for input title
        labelDiv2 = Label(Text="Door Frame Finish")
        labelDiv2.Parent = self
        labelDiv2.Size = Size(150, 20)
        labelDiv2.Location = Point(30, 120)
        # Create TextBox for input
        self.textboxDiv2 = TextBox()
        self.textboxDiv2.Parent = self
        self.textboxDiv2.Text = ""
        self.textboxDiv2.Location = Point(200, 120)

        # Create label for input title
        labelDiv3 = Label(Text="Door Leaf Type")
        labelDiv3.Parent = self
        labelDiv3.Size = Size(150, 20)
        labelDiv3.Location = Point(30, 160)
        # Create TextBox for input
        self.textboxDiv3 = TextBox()
        self.textboxDiv3.Parent = self
        self.textboxDiv3.Text = ""
        self.textboxDiv3.Location = Point(200, 160)

        # Create label for input title
        labelDiv4 = Label(Text="Meeting Styles")
        labelDiv4.Parent = self
        labelDiv4.Size = Size(150, 20)
        labelDiv4.Location = Point(30, 200)
        # Create TextBox for input
        self.textboxDiv4 = TextBox()
        self.textboxDiv4.Parent = self
        self.textboxDiv4.Text = ""
        self.textboxDiv4.Location = Point(200, 200)

        # Create label for input title
        labelDiv5 = Label(Text="Door Leaf Material")
        labelDiv5.Parent = self
        labelDiv5.Size = Size(150, 20)
        labelDiv5.Location = Point(30, 240)
        # Create TextBox for input
        self.textboxDiv5 = TextBox()
        self.textboxDiv5.Parent = self
        self.textboxDiv5.Text = ""
        self.textboxDiv5.Location = Point(200, 240)

        # Create label for input title
        labelDiv6 = Label(Text="Door Leaf Finish")
        labelDiv6.Parent = self
        labelDiv6.Size = Size(150, 20)
        labelDiv6.Location = Point(30, 280)
        # Create TextBox for input
        self.textboxDiv6 = TextBox()
        self.textboxDiv6.Parent = self
        self.textboxDiv6.Text = ""
        self.textboxDiv6.Location = Point(200, 280)

        # Create label for input title
        labelDiv7 = Label(Text="Fire/Smoke")
        labelDiv7.Parent = self
        labelDiv7.Size = Size(150, 20)
        labelDiv7.Location = Point(30, 320)
        # Create TextBox for input
        self.textboxDiv7 = TextBox()
        self.textboxDiv7.Parent = self
        self.textboxDiv7.Text = ""
        self.textboxDiv7.Location = Point(200, 320)

        # Create label for input title
        labelDiv8 = Label(Text="Door Security")
        labelDiv8.Parent = self
        labelDiv8.Size = Size(150, 20)
        labelDiv8.Location = Point(30, 360)
        # Create TextBox for input
        self.textboxDiv8 = TextBox()
        self.textboxDiv8.Parent = self
        self.textboxDiv8.Text = ""
        self.textboxDiv8.Location = Point(200, 360)

        # Create label for input title
        labelDiv9 = Label(Text="Misc")
        labelDiv9.Parent = self
        labelDiv9.Size = Size(150, 20)
        labelDiv9.Location = Point(30, 400)
        # Create TextBox for input
        self.textboxDiv9 = TextBox()
        self.textboxDiv9.Parent = self
        self.textboxDiv9.Text = ""
        self.textboxDiv9.Location = Point(200, 400)

        # Create label for input title
        labelDiv10 = Label(Text="Comments")
        labelDiv10.Parent = self
        labelDiv10.Size = Size(150, 20)
        labelDiv10.Location = Point(30, 440)
        # Create TextBox for input
        self.textboxDiv10 = TextBox()
        self.textboxDiv10.Parent = self
        self.textboxDiv10.Text = ""
        self.textboxDiv10.Location = Point(200, 440)

        # Create button
        button = Button()
        button.Parent = self
        button.Text = "Ok"
        button.Location = Point(200, 490)
        button.Size = Size(100, 20)

        # Register event
        button.Click += self.ButtonClicked
Beispiel #38
0
import clr
clr.AddReference('System.Windows.Forms') 
clr.AddReference('System.Drawing')
from System.Windows.Forms import (
    Application, Form,
    FormBorderStyle, Label
)
from System.Drawing import (
    Color, Font, FontStyle, Point
)

form = Form()
form.Text = "Hello World"
form.FormBorderStyle = FormBorderStyle.Fixed3D
form.Height = 150

newFont = Font("Verdana", 16, 
    FontStyle.Bold | FontStyle.Italic)

label = Label()
label.AutoSize = True
label.Text = "My Hello World Label"
label.Font = newFont
label.BackColor = Color.Aquamarine
label.ForeColor = Color.DarkMagenta
label.Location = Point(10, 50)

form.Controls.Add(label)

Application.Run(form)
    def __build_behaviourtab(self):
        ''' builds and returns the "Behaviour" Tab for the TabControl '''

        tabpage = TabPage()
        tabpage.Text = i18n.get("ConfigFormBehaviourTab")

        # 1. --- build the 'When scraping for the first time' label
        first_scrape_label = Label()
        first_scrape_label.AutoSize = False
        first_scrape_label.FlatStyle = FlatStyle.System
        first_scrape_label.Location = Point(52, 27)
        first_scrape_label.Text = i18n.get("ConfigFormFirstScrapeLabel")
        first_scrape_label.Size = Size(300, 17)

        # 1. --- build the 'autochoose series' checkbox
        self.__autochoose_series_cb = CheckBox()
        self.__autochoose_series_cb.AutoSize = False
        self.__autochoose_series_cb.FlatStyle = FlatStyle.System
        self.__autochoose_series_cb.Location = Point(82, 45)
        self.__autochoose_series_cb.Size = Size(300, 34)
        self.__autochoose_series_cb.Text = i18n.get(
            "ConfigFormAutochooseSeriesCB")
        self.__autochoose_series_cb.CheckedChanged += self.__fired_update_gui

        # 2. --- build the 'confirm issue' checkbox
        self.__confirm_issue_cb = CheckBox()
        self.__confirm_issue_cb.AutoSize = False
        self.__confirm_issue_cb.FlatStyle = FlatStyle.System
        self.__confirm_issue_cb.Location = Point(82, 75)
        self.__confirm_issue_cb.Size = Size(300, 34)
        self.__confirm_issue_cb.Text = i18n.get("ConfigFormConfirmIssueCB")
        self.__confirm_issue_cb.CheckedChanged += self.__fired_update_gui

        # 3. -- build the 'use fast rescrape' checkbox
        self.__fast_rescrape_cb = CheckBox()
        self.__fast_rescrape_cb.AutoSize = False
        self.__fast_rescrape_cb.FlatStyle = FlatStyle.System
        self.__fast_rescrape_cb.Location = Point(52, 116)
        self.__fast_rescrape_cb.Size = Size(300, 34)
        self.__fast_rescrape_cb.Text = i18n.get("ConfigFormRescrapeCB")
        self.__fast_rescrape_cb.CheckedChanged += self.__fired_update_gui

        # 4. -- build the 'add rescrape hints to notes' checkbox
        self.__rescrape_notes_cb = CheckBox()
        self.__rescrape_notes_cb.AutoSize = False
        self.__rescrape_notes_cb.FlatStyle = FlatStyle.System
        self.__rescrape_notes_cb.Location = Point(82, 151)
        self.__rescrape_notes_cb.Size = Size(270, 17)
        self.__rescrape_notes_cb.Text = i18n.get("ConfigFormRescrapeNotesCB")
        self.__rescrape_notes_cb.CheckedChanged += self.__fired_update_gui

        # 5. -- build the 'add rescrape hints to tags' checkbox
        self.__rescrape_tags_cb = CheckBox()
        self.__rescrape_tags_cb.AutoSize = False
        self.__rescrape_tags_cb.FlatStyle = FlatStyle.System
        self.__rescrape_tags_cb.Location = Point(82, 181)
        self.__rescrape_tags_cb.Size = Size(270, 17)
        self.__rescrape_tags_cb.Text = i18n.get("ConfigFormRescrapeTagsCB")
        self.__rescrape_tags_cb.CheckedChanged += self.__fired_update_gui

        # 6. --- build the 'specify series name' checkbox
        self.__summary_dialog_cb = CheckBox()
        self.__summary_dialog_cb.AutoSize = False
        self.__summary_dialog_cb.FlatStyle = FlatStyle.System
        self.__summary_dialog_cb.Location = Point(52, 214)
        self.__summary_dialog_cb.Size = Size(300, 34)
        self.__summary_dialog_cb.Text = i18n.get("ConfigFormShowSummaryCB")
        self.__summary_dialog_cb.CheckedChanged += self.__fired_update_gui

        # 7. --- add 'em all to the tabpage
        tabpage.Controls.Add(first_scrape_label)
        tabpage.Controls.Add(self.__autochoose_series_cb)
        tabpage.Controls.Add(self.__confirm_issue_cb)
        tabpage.Controls.Add(self.__fast_rescrape_cb)
        tabpage.Controls.Add(self.__rescrape_tags_cb)
        tabpage.Controls.Add(self.__rescrape_notes_cb)
        tabpage.Controls.Add(self.__summary_dialog_cb)

        return tabpage