Example #1
0
	def __init__(self, plan):
		self.Text = "Choose the apropriate ROI"
		
		structure_set = plan.GetStructureSet()
		self.roi_names = sorted([rg.OfRoi.Name for rg in structure_set.RoiGeometries if rg.PrimaryShape != None])
		self.roi_colors = [rg.OfRoi.Color for rg in structure_set.RoiGeometries if rg.PrimaryShape != None]
		
		self.Width = 160*4 + 50
		self.Height = 55*int(ceil(len(self.roi_names)/4.)) + 150
		
		print self.roi_colors
		
		self.setupCheckButtons()
		
		# Add button to press OK and close the Form
		button = Button()
		button.Text = "OK"
		button.AutoSize = True
		button.Location = Point(self.Width - 105, self.Height - 100)
		button.Click += self.ok_button_clicked
		
		# Add button to press Stop and close the Form
		button2 = Button()
		button2.Text = "Stop"
		button2.AutoSize = True
		button2.Location = Point(self.Width - 210, self.Height - 100)
		button2.Click += self.stop_button_clicked
		
		self.Controls.Add(button)
		self.Controls.Add(button2)
		
		self.Controls.Add(self.checkPanel)
Example #2
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
Example #3
0
 def __init__(self, itemlist):
     
     height = len(itemlist)*17
     self.Text = "Select the categories to export"
     self.Size = Size(300, height + 80)
     
     self.check = CheckedListBox()
     self.check.Parent = self
     self.check.Location = Point(5, 5)
     self.check.Size = Size(270, height)
     
     # load the list of relevant categories found in the project
     list_items = List[Object](itemlist)
     self.check.Items.AddRange(list_items.ToArray())
     self.check.CheckOnClick = True
     
     # set checked by default
     for i in range(len(itemlist)):
         self.check.SetItemChecked(i , True)
         
     okay = Button()
     okay.Parent = self
     okay.Text = 'OK'
     okay.Location = Point(50, height+10)
     okay.Width = 140
     okay.Click += self.onValidate
     
     cancel = Button()
     cancel.Parent = self
     cancel.Text = 'Cancel'
     cancel.Location = Point(okay.Right, height+10)
     cancel.Click += self.onCancel
     
     self.CenterToScreen()
    def __init__(self):
        self.Text = 'Buttons'
        
        self.Size = Size(WIDTH, HEIGHT)

        ok = Button()

        PANEL_HEIGHT = ok.Height + PANEL_SPACE

        panel = Panel()
        panel.Height = PANEL_HEIGHT
        panel.Dock = DockStyle.Bottom
        panel.Parent = self

        x = ok.Width * 2 + BUTTONS_SPACE
        y = (PANEL_HEIGHT - ok.Height) / 2

        ok.Text = "Ok"
        ok.Parent = panel
        ok.Location = Point(WIDTH-x, y)
        ok.Anchor = AnchorStyles.Right

        close = Button()
  
        x = close.Width

        close.Text = "Close"
        close.Parent = panel
        close.Location = Point(WIDTH-x-CLOSE_SPACE, y)
        close.Anchor = AnchorStyles.Right


        self.CenterToScreen()    
Example #5
0
    def __init__(self, itemlist):

        height = len(itemlist) * 17
        self.Text = "Select the categories to export"
        self.Size = Size(300, height + 80)

        self.check = CheckedListBox()
        self.check.Parent = self
        self.check.Location = Point(5, 5)
        self.check.Size = Size(270, height)

        # load the list of relevant categories found in the project
        list_items = List[Object](itemlist)
        self.check.Items.AddRange(list_items.ToArray())
        self.check.CheckOnClick = True

        # set checked by default
        for i in range(len(itemlist)):
            self.check.SetItemChecked(i, True)

        okay = Button()
        okay.Parent = self
        okay.Text = 'OK'
        okay.Location = Point(50, height + 10)
        okay.Width = 140
        okay.Click += self.onValidate

        cancel = Button()
        cancel.Parent = self
        cancel.Text = 'Cancel'
        cancel.Location = Point(okay.Right, height + 10)
        cancel.Click += self.onCancel

        self.CenterToScreen()
Example #6
0
 def init(self):
     # table
     table = make_table('main', False)
     table.Size = Size(580, 700)
     table.Location = Point(10, 10)
     table.ColumnCount = 2
     table.Columns[0].Name = 'Key'
     table.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable
     table.Columns[0].ReadOnly = True
     table.Columns[0].DefaultCellStyle.SelectionBackColor = Color.FromArgb(238, 238, 238)
     table.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb(238, 238, 238)
     table.Columns[1].Name = 'Value'
     table.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable
     keys = sorted(self.settings.keys())
     for key in keys:
         table.Rows.Add(key, self.settings[key])
     self.table = table
     # buttons
     ok = Button()
     ok.Text = 'OK'
     ok.DialogResult = DialogResult.OK
     cancel = Button()
     cancel.Text = 'Cancel'
     cancel.DialogResult = DialogResult.Cancel
     buttons = FlowLayoutPanel()
     buttons.FlowDirection = FlowDirection.RightToLeft
     # buttons.BorderStyle = BorderStyle.None
     buttons.Controls.Add(cancel)
     buttons.Controls.Add(ok)
     buttons.Size = Size(580, 30)
     buttons.Location = Point(10, 720)
     # layout
     self.ClientSize = Size(600, 800)
     self.Controls.Add(table)
     self.Controls.Add(buttons)
        def setupOKButtons(self):
            self.OKbuttonPanel = self.newPanel(0, 600)

            okButton = Button()
            okButton.Text = "OK"
            okButton.Location = Point(25, 50)
            self.AcceptButton = okButton
            okButton.Click += self.okClicked

            cancelButton = Button()
            cancelButton.Text = "Cancel"
            cancelButton.Location = Point(okButton.Left + okButton.Width + 10,
                                          okButton.Top)
            self.CancelButton = cancelButton
            cancelButton.Click += self.cancelClicked

            self.Status = Label()
            self.Status.Text = ""
            self.Status.Location = Point(200, 50)
            self.Status.AutoSize = True
            self.Status.Font = Font("Arial", 12, FontStyle.Bold)
            self.Status.ForeColor = Color.Black

            self.OKbuttonPanel.Controls.Add(okButton)
            self.OKbuttonPanel.Controls.Add(cancelButton)
            self.OKbuttonPanel.Controls.Add(self.Status)

            for CT in patient.Examinations:
                self.scancombo.Items.Add(CT.Name)
            try:
                self.scancombo.SelectedIndex = self.scancombo.FindStringExact(
                    "CT 1")
            except:
                self.scancombo.SelectedIndex = 0
    def __init__(self):
        self.Text = 'Directories'
        self.Size = Size(400, 400)
        
        self.tv = TreeView()

        self.SuspendLayout()

        self.tv.Parent = self
        self.tv.Location = Point(10,10)
        self.tv.Size = Size(self.ClientSize.Width - 20, self.Height - 200)
        self.tv.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right 


        self.tv.FullRowSelect = False
        self.tv.ShowLines = True
        self.tv.ShowPlusMinus = True
        self.tv.Scrollable = True  
        self.tv.AfterSelect += self.AfterSelect

        expand = Button()
        expand.Parent = self
        expand.Location = Point(20, self.tv.Bottom + 20)
        expand.Text = 'Expand'
        expand.Anchor = AnchorStyles.Left | AnchorStyles.Top
        expand.Click += self.OnExpand

        expandAll = Button()
        expandAll.Parent = self
        expandAll.Location = Point(20, expand.Bottom + 5)
        expandAll.Text = 'Expand All'
        expandAll.Anchor = AnchorStyles.Left | AnchorStyles.Top
        expandAll.Click += self.OnExpandAll

        collapse = Button()
        collapse.Parent = self
        collapse.Location = Point(expandAll.Right + 5, expand.Top)
        collapse.Text = 'Collapse'
        collapse.Anchor = AnchorStyles.Left | AnchorStyles.Top
        collapse.Click += self.OnCollapse

        collapseAll = Button()
        collapseAll.Parent = self
        collapseAll.Location = Point(collapse.Left, collapse.Bottom + 5)
        collapseAll.Text = 'Collapse All'
        collapseAll.Anchor = AnchorStyles.Left | AnchorStyles.Top
        collapseAll.Click += self.OnCollapseAll

        self.sb = StatusBar()
        self.sb.Parent = self

        self.ShowDirectories(self.tv.Nodes, HOME_DIR)

        self.ResumeLayout()

        self.CenterToScreen()
Example #9
0
    def showBox(self):
        '''
        set the remaining box controls and launch
        '''
        self.buttonpanel = Panel()
        self.buttonpanel.Parent = self
        self.buttonpanel.Location = Point(0, self.panel.Bottom)
        self.buttonpanel.Size = Size(Fconfig.smwidth, 2 * Fconfig.unitline)
        self.buttonpanel.Dock = DockStyle.Bottom

        self.warning = Label()
        self.warning.Parent = self.buttonpanel
        self.warning.Location = Point(Fconfig.margin, 0)
        self.warning.Size = Size(Fconfig.smwidth, Fconfig.unitline)
        self.warning.Font = Font(Fconfig.basefont, Fconfig.sizefont,
                                 FontStyle.Bold)
        self.warning.ForeColor = Color.Coral
        self.warning.TextAlign = ContentAlignment.MiddleCenter

        okay = Button()
        okay.Parent = self.buttonpanel
        okay.Text = Fconfig.buttonOK
        okay.Location = Point(50, Fconfig.unitline)
        okay.Width = 140
        okay.Click += self.onValidate
        okay.Anchor = AnchorStyles.Right

        cancel = Button()
        cancel.Text = Fconfig.buttonCANCEL
        cancel.Parent = self.buttonpanel
        cancel.Location = Point(okay.Right, Fconfig.unitline)
        cancel.Click += self.onCancel
        cancel.Anchor = AnchorStyles.Right

        self.Width = Fconfig.width
        self.Height = self.panel.Bottom + 105
        self.CenterToScreen()

        ModeDBG.say('\npanel top :{0}, bottom :{1}'.format(
            self.panel.Top, self.panel.Bottom))
        ModeDBG.say('\n\nPanel loaded with {0} items\n'.format(
            len(self.panelparams)))

        # Display the form
        try:
            if Application.MessageLoop:
                TaskDialog.Show('UserForm', 'Another window is running...')
            else:
                Application.Run(self)

        except:
            TaskDialog.Show('UserForm', 'Loading failed...')
Example #10
0
 def showBox(self):
     '''
     set the remaining box controls and launch
     '''
     self.buttonpanel = Panel()
     self.buttonpanel.Parent = self
     self.buttonpanel.Location = Point(0,self.panel.Bottom)
     self.buttonpanel.Size = Size(Fconfig.smwidth, 2* Fconfig.unitline)
     self.buttonpanel.Dock = DockStyle.Bottom
     
     self.warning = Label()
     self.warning.Parent = self.buttonpanel
     self.warning.Location = Point(Fconfig.margin, 0)
     self.warning.Size = Size(Fconfig.smwidth, Fconfig.unitline)
     self.warning.Font = Font(Fconfig.basefont, Fconfig.sizefont, FontStyle.Bold)
     self.warning.ForeColor = Color.Coral
     self.warning.TextAlign = ContentAlignment.MiddleCenter
     
     okay = Button()
     okay.Parent = self.buttonpanel
     okay.Text = Fconfig.buttonOK
     okay.Location = Point(50, Fconfig.unitline)
     okay.Width = 140
     okay.Click += self.onValidate
     okay.Anchor = AnchorStyles.Right
     
     cancel = Button()
     cancel.Text = Fconfig.buttonCANCEL
     cancel.Parent = self.buttonpanel
     cancel.Location = Point(okay.Right, Fconfig.unitline)
     cancel.Click += self.onCancel
     cancel.Anchor = AnchorStyles.Right
     
     self.Width = Fconfig.width
     self.Height = self.panel.Bottom + 105
     self.CenterToScreen()
     
     ModeDBG.say('\npanel top :{0}, bottom :{1}'.format(
                 self.panel.Top, self.panel.Bottom))
     ModeDBG.say('\n\nPanel loaded with {0} items\n'.format(
                 len(self.panelparams)))
     
     # Display the form
     try:
         if Application.MessageLoop:
             TaskDialog.Show('UserForm', 'Another window is running...')
         else:
             Application.Run(self)
             
     except:
         TaskDialog.Show('UserForm','Loading failed...')
Example #11
0
    def __init__(self):
        self.Text = __title__
        textbox = TextBox()
        textbox.Location = Point(0, 0)
        textbox.Text = "Please input reports text or any list of IDs to select elements"
        textbox.AutoSize = False
        textbox.Size = Size(400, 200)
        textbox.Multiline = True
        textbox.Name = 'value'
        self.Controls.Add(textbox)

        saveSelection = CheckBox()
        saveSelection.Location = Point(260, 205)
        saveSelection.Text = "Save selection"
        saveSelection.Name = 'saveSelection'
        if not __shiftclick__:
            saveSelection.Checked = True
        self.Controls.Add(saveSelection)

        button_update = Button()
        button_update.Text = "Select"
        button_x = 8
        button_y = 240
        button_update.Location = Point(button_x, button_y)
        button_update.Click += self.form_update
        self.Controls.Add(button_update)
        self.Height = button_y + 70
        self.Width = 400
        self.MaximizeBox = False
        self.MinimizeBox = False
        self.FormBorderStyle = FormBorderStyle.FixedDialog
    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
Example #13
0
    def __init__(self):
        self.m_testport = 'COM3'  #: Port on test system
        self.m_test_meter = "300001162"  #: Test V4 meter
        ekm_set_log(ekm_print_log)
        print "\n****\nInitializing v3 and v4 for db test"

        self.Text = 'Sample EKM Iron Python App'

        self.label = Label()
        self.label.Text = "0.0"
        self.label.Location = Point(50, 50)
        self.label.Height = 30
        self.label.Width = 200

        self.count = 0

        button = Button()
        button.Text = "Read Meter: " + self.m_test_meter
        button.Location = Point(50, 100)
        button.Width = 180

        button.Click += self.buttonPressed

        self.Controls.Add(self.label)
        self.Controls.Add(button)
Example #14
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)
    def __init__(self):
        self.Text = 'Anchor'        
        self.Size = Size(210, 210)
              
        btn1 = Button()
        btn1.Text = "Button"
        btn1.Parent = self
        btn1.Location = Point(30, 30)

        btn2 = Button()
        btn2.Text = "Button"
        btn2.Parent = self
        btn2.Location = Point(30, 80)
        btn2.Anchor = AnchorStyles.Right
        
        self.CenterToScreen()
Example #16
0
     def __init__(self):
         self.m_testport = 'COM3'  #: Port on test system
         self.m_test_meter = "300001162"     #: Test V4 meter
         ekm_set_log(ekm_print_log)
         print "\n****\nInitializing v3 and v4 for db test"

         self.Text = 'Sample EKM Iron Python App'

         self.label = Label()
         self.label.Text = "0.0"
         self.label.Location = Point(50, 50)
         self.label.Height = 30
         self.label.Width = 200

         self.count = 0

         button = Button()
         button.Text = "Read Meter: " + self.m_test_meter
         button.Location = Point(50, 100)
         button.Width = 180

         button.Click += self.buttonPressed

         self.Controls.Add(self.label)
         self.Controls.Add(button)
Example #17
0
def ShowInputBox():
    """
    <Script>
    <Author>AUG</Author>
    <Description>This script will open an input box for the user to define an integer</Description>
    </Script>
    """

    if sys.platform != 'cli':
        import pythoncom
        pythoncom.CoInitialize()

    f.Text = 'Select Factor'
    f.Width = 300
    f.Height = 60

    tb.Text = value.ToString()
    tb.Dock = DockStyle.Left

    bt = Button()
    bt.Click += OnKeyPress
    bt.Text = "OK"
    bt.Dock = DockStyle.Right

    f.Controls.Add(tb)
    f.Controls.Add(bt)
    f.ShowDialog()
Example #18
0
 def _add_buttons(self):
     ok = Button()
     ok.Text = 'OK'
     ok.DialogResult = DialogResult.OK
     cancel = Button()
     cancel.Text = 'Cancel'
     cancel.DialogResult = DialogResult.Cancel
     self.buttons = FlowLayoutPanel()
     self.buttons.FlowDirection = FlowDirection.RightToLeft
     self.buttons.BorderStyle = BorderStyle.None
     self.buttons.Controls.Add(cancel)
     self.buttons.Controls.Add(ok)
     self.buttons.Size = Size(580, 30)
     self.buttons.Location = Point(10, 720)
     self.ClientSize = Size(600, 800)
     self.Controls.Add(self.buttons)
Example #19
0
 def init(self):
     # tabs
     tabs = TabControl()
     tabs.Size = Size(580, 700)
     tabs.Location = Point(10, 10)
     # buttons
     ok = Button()
     ok.Text = 'OK'
     ok.DialogResult = DialogResult.OK
     cancel = Button()
     cancel.Text = 'Cancel'
     cancel.DialogResult = DialogResult.Cancel
     buttons = FlowLayoutPanel()
     buttons.FlowDirection = FlowDirection.RightToLeft
     buttons.BorderStyle = BorderStyle.None
     buttons.Controls.Add(cancel)
     buttons.Controls.Add(ok)
     buttons.Size = Size(580, 30)
     buttons.Location = Point(10, 720)
     self.ClientSize = Size(600, 800)
     self.Controls.Add(tabs)
     self.Controls.Add(buttons)
     # pages and tables
     index = 0
     for name in self.settings:
         page = make_page(name, name, index)
         page.TabIndex = index
         settings = self.settings[name]
         table = make_table(name)
         table.ColumnCount = 2
         table.Columns[0].Name = 'Key'
         table.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable
         table.Columns[0].ReadOnly = True
         table.Columns[
             0].DefaultCellStyle.SelectionBackColor = Color.FromArgb(
                 238, 238, 238)
         table.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb(
             238, 238, 238)
         table.Columns[1].Name = 'Value'
         table.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable
         keys = sorted(settings.keys())
         for key in keys:
             table.Rows.Add(key, settings[key])
         page.Controls.Add(table)
         tabs.Controls.Add(page)
         self.tables[name] = table
         index += 1
Example #20
0
def makeMournButton(text, width, height, location, click):
    button = Button()
    button.Text = text
    button.Width = width
    button.Height = height
    button.Location = location
    button.Click += click
    return button
    def __init__(self):
        self.Text = 'Hello World'

        button = Button()
        button.Text = "Click Me"
        button.Location = Point(50, 100)
        button.Click += self.buttonPress
        self.Controls.Add(button)
Example #22
0
 def init(self):
     # table
     table = make_table('main', False)
     table.Size = Size(980, 700)
     table.Location = Point(10, 10)
     table.ColumnCount = len(self.names) + 1
     table.Columns[0].Name = 'Key'
     table.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable
     table.Columns[0].ReadOnly = True
     table.Columns[0].DefaultCellStyle.SelectionBackColor = Color.FromArgb(
         238, 238, 238)
     table.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb(
         238, 238, 238)
     for i in range(len(self.names)):
         column = table.Columns[i + 1]
         column.Name = self.names[i]
         column.SortMode = DataGridViewColumnSortMode.NotSortable
         if self.types:
             if self.types[i] == 'f':
                 column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
             else:
                 column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
     keys = sorted(self.attributes.keys(), key=int)
     for key in keys:
         values = [self.attributes[key][name] for name in self.names]
         objects = [key] + values
         table.Rows.Add(*objects)
     self.table = table
     # buttons
     ok = Button()
     ok.Text = 'OK'
     ok.DialogResult = DialogResult.OK
     cancel = Button()
     cancel.Text = 'Cancel'
     cancel.DialogResult = DialogResult.Cancel
     buttons = FlowLayoutPanel()
     buttons.FlowDirection = FlowDirection.RightToLeft
     # buttons.BorderStyle = BorderStyle.None
     buttons.Controls.Add(cancel)
     buttons.Controls.Add(ok)
     buttons.Size = Size(980, 30)
     buttons.Location = Point(10, 720)
     # layout
     self.ClientSize = Size(1000, 800)
     self.Controls.Add(table)
     self.Controls.Add(buttons)
Example #23
0
 def __build_backbutton(self):
    ''' builds and returns the back button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Retry
    button.Location = Point(595, 362)
    button.Size = Size(125, 24)
    button.Text = i18n.get("IssueFormGoBack")
    return button
    def __build_cancel_button(self):
        ''' builds and returns the cancel button for this form '''

        button = Button()
        button.DialogResult = DialogResult.Cancel
        button.Location = Point(315, 343)
        button.Size = Size(90, 23)
        button.Text = i18n.get("ConfigFormCancel")
        return button
    def __build_restore_button(self):
        ''' builds and returns the restore button for this form '''

        button = Button()
        button.Click += self.__fired_restore_defaults
        button.Location = Point(10, 343)
        button.Size = Size(170, 23)
        button.Text = i18n.get("ConfigFormRestore")
        return button
 def __build_skipbutton(self):
    ''' builds and return the skip button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Ignore
    button.Location = Point(110, 362)
    button.Size = Size(90, 24)
    button.Text = i18n.get("SeriesFormSkip")
    return button
Example #27
0
    def __build_skipbutton(self):
        """ builds and returns the skip button for this form """

        button = Button()
        button.DialogResult = DialogResult.Ignore
        button.Location = Point(318, 362) if self.__config.show_covers_b else Point(105, 362)
        button.Size = Size(90, 24)
        button.Text = i18n.get("IssueFormSkip")
        return button
 def __build_restore_button(self):
    ''' builds and returns the restore button for this form '''
    
    button = Button()
    button.Click += self.__fired_restore_defaults
    button.Location = Point(10, 343)
    button.Size = Size(170, 23)
    button.Text = i18n.get("ConfigFormRestore")
    return button
Example #29
0
    def __build_okbutton(self):
        ''' builds and returns the ok button for this form '''

        button = Button()
        button.DialogResult = DialogResult.OK
        button.Location = Point(15, 362)
        button.Size = Size(90, 24)
        button.Text = i18n.get("SeriesFormOK")
        return button
Example #30
0
    def __build_skipbutton(self):
        ''' builds and return the skip button for this form '''

        button = Button()
        button.DialogResult = DialogResult.Ignore
        button.Location = Point(110, 362)
        button.Size = Size(90, 24)
        button.Text = i18n.get("SeriesFormSkip")
        return button
Example #31
0
    def __build_backbutton(self):
        """ builds and returns the back button for this form """

        button = Button()
        button.DialogResult = DialogResult.Retry
        button.Location = Point(595, 362)
        button.Size = Size(125, 24)
        button.Text = i18n.get("IssueFormGoBack")
        return button
 def __build_okbutton(self):
    ''' builds and returns the ok button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.OK
    button.Location = Point(15, 362)
    button.Size = Size(90, 24)
    button.Text = i18n.get("SeriesFormOK")
    return button
    def __build_okbutton(self):
        ''' builds and returns the ok button for this form '''

        button = Button()
        button.DialogResult = DialogResult.OK
        button.Location = Point(228, 343)
        button.Size = Size(80, 23)
        button.Text = i18n.get("ConfigFormOK")
        return button
 def __build_okbutton(self):
    ''' builds and returns the ok button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.OK
    button.Location = Point(228, 343)
    button.Size = Size(80, 23)
    button.Text = i18n.get("ConfigFormOK")
    return button
Example #35
0
    def __build_okbutton(self):
        """ builds and returns the ok button for this form """

        button = Button()
        button.DialogResult = DialogResult.OK
        button.Location = Point(223, 362) if self.__config.show_covers_b else Point(10, 362)
        button.Size = Size(90, 24)
        button.Text = i18n.get("IssueFormOK")
        return button
 def __build_cancel_button(self):
    ''' builds and returns the cancel button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Cancel
    button.Location = Point(315, 343)
    button.Size = Size(90, 23)
    button.Text = i18n.get("ConfigFormCancel")
    return button
Example #37
0
        def setupOKButtons(self):
            self.OKbuttonPanel = self.miniPanel(0, 900)

            printButton = Button()
            printButton.Text = "Imprimer"
            printButton.Location = Point(25, 28)
            #self.AcceptButton = okButton
            printButton.Click += self.printClicked

            #cancelButton = Button()
            #cancelButton.Text = "Annuler"
            #cancelButton.Location = Point(110,10)
            #self.CancelButton = cancelButton
            #cancelButton.Click += self.cancelClicked

            levelwindowButton = Button()
            levelwindowButton.Text = "Level/Window"
            levelwindowButton.Location = Point(108, 28)
            levelwindowButton.Width = 85
            levelwindowButton.Click += self.levelwindowClicked

            referencedoseButton = Button()
            referencedoseButton.Text = "Toggle Reference Dose"
            referencedoseButton.Location = Point(200, 28)
            referencedoseButton.Width = 140
            referencedoseButton.Click += self.referencedoseClicked

            nbfxButton = Button()
            nbfxButton.Text = "Nb. de fx"
            nbfxButton.Location = Point(345, 28)
            nbfxButton.Width = 70
            nbfxButton.Click += self.nbfxClicked

            self.message = Label()
            self.message.Text = ""
            self.message.Location = Point(30, 0)
            self.message.Font = Font("Arial", 11, FontStyle.Bold)
            self.message.AutoSize = True

            self.OKbuttonPanel.Controls.Add(printButton)
            self.OKbuttonPanel.Controls.Add(levelwindowButton)
            self.OKbuttonPanel.Controls.Add(referencedoseButton)
            self.OKbuttonPanel.Controls.Add(nbfxButton)
            self.OKbuttonPanel.Controls.Add(self.message)
Example #38
0
        def setupOKButtons(self):
            self.OKbuttonPanel = self.miniPanel(0, 950)

            printButton = Button()
            printButton.Text = "Imprimer"
            printButton.Location = Point(25, 28)
            #self.AcceptButton = okButton
            printButton.Click += self.printClicked

            #cancelButton = Button()
            #cancelButton.Text = "Annuler"
            #cancelButton.Location = Point(110,10)
            #self.CancelButton = cancelButton
            #cancelButton.Click += self.cancelClicked

            levelwindowButton = Button()
            levelwindowButton.Text = "Level/Window"
            levelwindowButton.Location = Point(25, 28)
            levelwindowButton.Width = 85
            levelwindowButton.Click += self.levelwindowClicked

            referencedoseButton = Button()
            referencedoseButton.Text = "Toggle Reference Dose"
            referencedoseButton.Location = Point(117, 28)
            referencedoseButton.Width = 140
            referencedoseButton.Click += self.referencedoseClicked

            nbfxButton = Button()
            nbfxButton.Text = "Nb. de fx"
            nbfxButton.Location = Point(263, 28)
            nbfxButton.Width = 70
            nbfxButton.Click += self.nbfxClicked

            self.message = Label()
            self.message.Text = ""
            self.message.Location = Point(30, 0)
            self.message.Font = Font("Arial", 11, FontStyle.Bold)
            self.message.AutoSize = True

            #Printing has been disabled for verif 1, simply add the printButton back if you want to reactivate it
            self.OKbuttonPanel.Controls.Add(nbfxButton)
            self.OKbuttonPanel.Controls.Add(levelwindowButton)
            self.OKbuttonPanel.Controls.Add(referencedoseButton)
            self.OKbuttonPanel.Controls.Add(self.message)
 def __build_issuesbutton(self):
    ''' builds and return the 'show issues' button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Yes
    button.Location = Point(395, 362) \
       if self.__config.show_covers_b else Point(605, 362) 
    button.Size = Size(115, 24)
    button.Text = i18n.get("SeriesFormIssues")
    return button
        def setupOKButtons(self):
            self.OKbuttonPanel = self.miniPanel(0, 750)
            
            cancelButton = Button()
            cancelButton.Text = "Cancel"
            cancelButton.Location = Point(25,25)
            self.CancelButton = cancelButton
            cancelButton.Click += self.cancelClicked

            self.OKbuttonPanel.Controls.Add(cancelButton)
 def __build_cancelbutton(self):
    ''' builds and returns the cancel button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Cancel
    button.Location = Point(335, 170 if self.__fail_label_is_visible else 70)
    button.Size = Size(90, 23)
    button.Text = i18n.get("SearchFormCancel")
    button.UseVisualStyleBackColor = True
    return button
Example #42
0
    def __build_issuesbutton(self):
        ''' builds and return the 'show issues' button for this form '''

        button = Button()
        button.DialogResult = DialogResult.Yes
        button.Location = Point(395, 362) \
           if self.__config.show_covers_b else Point(605, 362)
        button.Size = Size(115, 24)
        button.Text = i18n.get("SeriesFormIssues")
        return button
Example #43
0
    def __build_searchbutton(self):
        ''' builds and return the 'search again' button for this form '''

        button = Button()
        button.DialogResult = DialogResult.Retry
        button.Location = Point(275, 362) \
           if self.__config.show_covers_b else Point(485, 362)
        button.Size = Size(115, 24)
        button.Text = i18n.get("SeriesFormAgain")
        return button
   def __build_okbutton(self):
      ''' Builds and returns the ok button for this form. '''

      button = Button()
      button.DialogResult = DialogResult.OK
      button.Location = Point(10, 68)
      button.Size = Size(145, 23)
      button.Text = i18n.get("WelcomeFormStart")
      button.UseVisualStyleBackColor = True
      return button
 def __build_searchbutton(self):
    ''' builds and return the 'search again' button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Retry
    button.Location = Point(275, 362) \
       if self.__config.show_covers_b else Point(485, 362) 
    button.Size = Size(115, 24)
    button.Text = i18n.get("SeriesFormAgain")
    return button
Example #46
0
 def __build_skipbutton(self):
    ''' builds and returns the skip button for this form '''
    
    button = Button()
    button.DialogResult = DialogResult.Ignore
    button.Location = Point(318, 362) \
       if self.__config.show_covers_b else Point(105, 362)
    button.Size = Size(90, 24)
    button.Text = i18n.get("IssueFormSkip")
    return button
Example #47
0
   def __build_okbutton(self):
      ''' Builds and returns the ok button for this form. '''

      button = Button()
      button.DialogResult = DialogResult.OK
      button.Location = Point(105, 58)
      button.Size = Size(90, 23)
      button.Text = i18n.get("MessageBoxOk")
      button.UseVisualStyleBackColor = True
      return button
Example #48
0
    def __build_okbutton(self):
        ''' Builds and returns the ok button for this form. '''

        button = Button()
        button.DialogResult = DialogResult.OK
        button.Location = Point(105, 58)
        button.Size = Size(90, 23)
        button.Text = i18n.get("MessageBoxOk")
        button.UseVisualStyleBackColor = True
        return button
 def __build_cancelbutton(self):
    ''' Builds and returns the cancel button for this form. '''
    
    button = Button()
    button.DialogResult = DialogResult.Cancel
    button.Location = Point(314, 68)
    button.Size = Size(90, 23)
    button.Text = i18n.get("WelcomeFormCancel")
    button.UseVisualStyleBackColor = True
    return button
 def __build_settingsbutton(self):
    ''' Builds and returns the settings button for this form. '''
   
    button = Button()
    button.Click += self.__show_configform
    button.Location = Point(208, 68)
    button.Size = Size(100, 23)
    button.Text = i18n.get("WelcomeFormSettings")
    button.UseVisualStyleBackColor = True
    return button
 def init_btn(self, x, y, text, handler):
     btn = Button()
     btn.Text = text
     btn.BackColor = Color.FromArgb(50, 50, 50)
     btn.Location = self.btn_pos(x, y)
     btn.Size = Size(60, 30)
     btn.FlatStyle = FlatStyle.Flat
     btn.FlatAppearance.BorderSize = 1
     btn.Click += handler
     return btn
Example #52
0
 def __init__(self):
     self.Text = "Button"
     self.CenterToScreen()
     self.Size = Size(200, 150)
     
     btn = Button()
     btn.Parent = self
     btn.Text = "Quit"
     btn.Location = Point(50, 50)
     btn.Click += self.OnClick
     btn.MouseEnter += self.OnEnter
   def __build_prevbutton(self):
      ''' Builds and returns the 'previous' button for this panel. '''

      button = Button()
      button.Location = Point(2, 332)
      button.Size = Size(20, 24)
      button.Text = '<'
      button.Font = Font(button.Font, FontStyle.Bold)
      button.UseVisualStyleBackColor = True
      button.Click += self.__button_click_fired
      # note: this button's visibility is manipulated by __update
      return button
Example #54
0
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)
 def __build_cancelbutton(self):
    ''' Builds and returns the cancel button for this form. '''
    
    button = Button()
    button.Text=""  # gets updated by the 'update' method
    def cancel(sender, args):
       button.Enabled = False
       self.Close()
    button.Click+=cancel
    button.Location = Point(78, 572)
    button.Size = Size(190, 23)
    button.Anchor = AnchorStyles.Bottom
    return button
    def __init__(self):
        self.Text = 'Drag & Drop'

        button = Button()
        button.Parent = self
        button.Text = 'Button'
        button.MouseDown += self.OnMousDown
        button.MouseUp += self.OnMousUp
        button.MouseMove += self.OnMousMove

        button.Location = Point(20, 20)

        self.isDragging = False
        self.CenterToScreen()
Example #57
0
    def initialiseButtons(self):
        buttonPanel = Panel()
        buttonPanel.Height = 23
        buttonPanel.Dock = DockStyle.Bottom
        buttonPanel.Width = 170

        acceptButton = Button()
        acceptButton.Text = "OK"
        acceptButton.DialogResult = DialogResult.OK
        acceptButton.Width = 75
        acceptButton.Dock = DockStyle.Left
        self.AcceptButton = acceptButton
        buttonPanel.Controls.Add(acceptButton)

        cancelButton = Button()
        cancelButton.Text = "Cancel"
        cancelButton.DialogResult = DialogResult.Cancel
        cancelButton.Width = 75
        cancelButton.Dock = DockStyle.Right
        self.CancelButton = cancelButton
        buttonPanel.Controls.Add(cancelButton)

        self.Controls.Add(buttonPanel)
Example #58
0
    def __init__(self):
        self.Text = "Tooltips"
        self.CenterToScreen()
        self.Size = Size(200, 150)

        tooltip = ToolTip()
        tooltip.SetToolTip(self, "This is a Form")

        button = Button()
        button.Parent = self
        button.Text = "Button"
        button.Location = Point(50, 70)

        tooltip.SetToolTip(button, "This is a Button")
Example #59
0
    def __init__(self):
        self.Text = 'Tooltips'
        self.CenterToScreen()
        xsize,ysize=300,200
        self.Size = Size(xsize, ysize)

        tooltip = ToolTip()
        tooltip.SetToolTip(self, "This is a Form")

        button = Button()
        button.Parent = self
        button.Text = "Button"
        xloc,yloc=50,70
        button.Location = Point(xloc,yloc)

        tooltip.SetToolTip(button, "This is a Button")