Пример #1
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
Пример #2
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)     

        all_items = RadioButton()
        all_items.Location = Point(10, 205)
        all_items.Text = "All"
        all_items.Name = 'all'
        all_items.Width = 50
        all_items.Checked = True
        self.Controls.Add(all_items) 

        even = RadioButton()
        even.Location = Point(60, 205)
        even.Text = "Even only"
        even.Name = 'even_only'
        even.Width = 80
        self.Controls.Add(even) 

        odd = RadioButton()
        odd.Location = Point(140, 205)
        odd.Text = "Odd only"
        odd.Name = 'odd_only'
        self.Controls.Add(odd) 

        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):

        self.Text = "CheckBox"
        self.Size = Size(220, 170)

        cb = CheckBox()
        cb.Parent = self
        cb.Location = Point(30, 30)
        cb.Text = "Show Title"
        cb.Checked = True

        cb.CheckedChanged += self.OnChanged


        self.CenterToScreen()
Пример #4
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
Пример #5
0
  def __init__(self, curveId):
    
    label_width = 30
    offset = 30
    index = 0
    
    # header
    self.Text = "Annotate Curve"
    
    #label
    index += 1

    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 = Point(label_width, offset* index)
    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( AutoSize=True)
    cb.Parent = self
    cb.Location = Point(label_width, offset* index)
    cb.Text = "Show Title"
    cb.Checked = True

    
    
    index += 1
    cbb = ComboBox(Text="select tool", Location=Point(label_width, offset * index), Parent=self)
    cbb.Items.AddRange(("Inner contour",
            "Outer contour",
            "Pocket",
            "Engrave",
            "Clamex horizontal"))
    
    self.cbb_tool = cbb

    index += 1
    cbb = ComboBox(Text="Outer contour", Location=Point(label_width, offset * index), Parent=self)
    cbb.Items.AddRange(("Inner contour",
            "Outer contour",
            "Pocket",
            "Engrave",
            "Clamex horizontal"))    
    
    self.cbb_operation = cbb
            
    index += 1
    sb = NumericUpDown( AutoSize=True, Location=Point(label_width, offset * index), Parent=self , DecimalPlaces = 2) 
    sb.Parent = self
    sb.Location = Point(label_width, offset* index)
    sb.DecimalPlaces  = 2
    sb.Text = "Show Title"
  
            
      

    
    index += 1
    pt.X  = labelstart.Left
    pt.Y  = labelstart.Bottom + offset*index
    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
Пример #6
0
    def __init__(self, tools):

        label_width = 30
        offset = 30
        index = 0

        # header
        self.Text = "Add layer"
        width = 400

        #label

        #textInput
        # labelstart = Label(Text="Text at start", AutoSize=True)
        # labelstart.Location = Point(label_width, offset* index)
        # 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

        # TOOL SELECTON
        index += 1
        cbb = ComboBox(
            Text="Outer contour",
            Location=Point(label_width, offset * index),
            Parent=self,
            Width=200,
        )
        cbb.Items.AddRange(
            ("Inner contour", "Outer contour", "Pocket", "Engrave", "Drill",
             "Saw X", "Saw Y", "Clamex verticaal", "Clamex horizontaal"))
        cbb.TextChanged += self.updateLabelLayername
        self.cbb_operation = cbb

        # TOOL SELECTON
        index += 1
        cbb = ComboBox(Text=tools[0],
                       Location=Point(label_width, offset * index),
                       Parent=self,
                       Width=200)
        cbb.Items.AddRange(tools)
        cbb.TextChanged += self.updateLabelLayername

        self.cbb_tool = cbb

        index += 1
        sb = NumericUpDown(AutoSize=True,
                           Location=Point(label_width, offset * index),
                           Parent=self,
                           DecimalPlaces=2)
        sb.ValueChanged += self.updateLabelLayername

        self.sb_height = sb

        index += 1
        cb = CheckBox(Text="use depth from top of workpiece",
                      AutoSize=True,
                      Location=Point(label_width, offset * index),
                      Parent=self)
        cb.Checked = False
        cb.CheckedChanged += self.updateLabelLayername

        self.cb_depth = cb

        index += 1
        la = Label(Text="<layername>",
                   Location=Point(label_width, offset * index),
                   Parent=self,
                   AutoSize=True)
        self.la_layername = la

        index += 1
        pt = Point(label_width, offset * index)

        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 + 10)
        self.AcceptButton = buttonApply
        self.CancelButton = buttonCancel