Esempio n. 1
0
    def __init__(self, title, items):

        # icon
        self.Icon = _Icon(r"%s\extra\icon.ico" % ipath)
        self.Size = _Size(360, 430)
        self.Text = "Quasar"
        self.class2Result = []

        self.title = title
        self.items = items
        # fonts
        self.gsmt_11r = _Font("Georgia", 10)
        self.gsmt_10r = _Font("Georgia", 9)

        # combo box
        self.cbox = ComboBox()
        self.cbox.Font = self.gsmt_11r
        self.cbox.Location = _Point(30, 10)
        self.cbox.Size = _Size(280, 28)
        self.cbox.Items.AddRange(tuple(title))
        self.cbox.SelectedIndex = 0
        self.Controls.Add(self.cbox)

        # checklist box
        self.lstbox = CheckedListBox()
        self.lstbox.Items.AddRange(tuple(self.items[self.cbox.SelectedIndex]))
        self.lstbox.Font = self.gsmt_10r
        # padding
        self.lstbox.Padding = Padding(30)
        # select one click
        self.lstbox.CheckOnClick = True

        self.FormBorderStyle = FormBorderStyle.FixedDialog
        self.MaximizeBox = False
        self.ManimizeBox = False
        self.lstbox.Location = _Point(30, 45)
        self.lstbox.Size = _Size(280, 300)

        # auto horizontal scrollbar
        self.lstbox.HorizontalScrollbar = True
        self.Controls.Add(self.lstbox)

        # select all btn
        self.btn_all = Button()
        self.btn_all.Text = "Select All"
        self.btn_all.Font = self.gsmt_10r
        self.btn_all.Size = _Size(95, 25)
        self.btn_all.Location = _Point(30, 340)
        self.Controls.Add(self.btn_all)

        # select none btn
        self.btn_none = Button()
        self.btn_none.Text = "Select None"
        self.btn_none.Font = self.gsmt_10r
        self.btn_none.Size = _Size(95, 25)
        self.btn_none.Location = _Point(215, 340)
        self.Controls.Add(self.btn_none)

        # ok btn
        self.btn = Button()
        self.btn.Text = "OK"
        self.btn.Font = self.gsmt_10r
        self.btn.Size = _Size(80, 25)
        self.btn.Location = _Point(130, 340)
        self.Controls.Add(self.btn)

        # events
        self.btn_all.Click += self.click_all
        self.btn_none.Click += self.click_none
        self.btn.Click += self.click_ok
        self.cbox.SelectedValueChanged += self.on_class_change

        # pop up from center
        self.CenterToScreen()
Esempio n. 2
0
    def __init__(self, inputList):
        self.Icon = _Icon(r"%s\extra\icon.ico" % ipath)
        self.Size = _Size(290, 435)
        self.Text = "Quasar"
        self.class1Result = []

        # fonts
        self.gsmt_11r = _Font("Georgia", 10)
        self.gsmt_10r = _Font("Georgia", 9)

        # label
        self.label = Label()
        self.label.Text = "Select Items:"
        self.label.Font = self.gsmt_11r
        self.label.Location = _Point(30, 10)
        self.label.Size = _Size(220, 28)
        self.Controls.Add(self.label)

        # checklist box
        self.lstbox = CheckedListBox()
        self.lstbox.Items.AddRange(tuple(inputList))
        self.lstbox.Font = self.gsmt_10r
        # padding
        self.lstbox.Padding = Padding(30)
        # select one click
        self.lstbox.CheckOnClick = True

        self.FormBorderStyle = FormBorderStyle.FixedDialog
        self.MaximizeBox = False
        self.ManimizeBox = False
        self.lstbox.Location = _Point(30, 40)
        self.lstbox.Size = _Size(210, 280)

        # auto horizontal scrollbar
        self.lstbox.HorizontalScrollbar = True
        self.Controls.Add(self.lstbox)

        # select all btn
        self.btn_all = Button()
        self.btn_all.Text = "Select All"
        self.btn_all.Font = self.gsmt_10r
        self.btn_all.Size = _Size(95, 25)
        self.btn_all.Location = _Point(30, 315)
        self.Controls.Add(self.btn_all)

        # select none btn
        self.btn_none = Button()
        self.btn_none.Text = "Select None"
        self.btn_none.Font = self.gsmt_10r
        self.btn_none.Size = _Size(95, 25)
        self.btn_none.Location = _Point(145, 315)
        self.Controls.Add(self.btn_none)

        # ok btn
        self.btn = Button()
        self.btn.Text = "OK"
        self.btn.Font = self.gsmt_10r
        self.btn.Size = _Size(80, 25)
        self.btn.Location = _Point(95, 350)
        self.Controls.Add(self.btn)

        # events
        self.btn_all.Click += self.click_all
        self.btn_none.Click += self.click_none
        self.btn.Click += self.click_ok

        # pop up from center
        self.CenterToScreen()
Esempio n. 3
0
	def __init__(self):

		self.linkInstances = FilteredElementCollector(doc).OfClass(RevitLinkInstance).ToElements();
		self.linkName = [i.Name.split(" : ")[0] for i in self.linkInstances];
		self.linkDict = {i.Name.split(" : ")[0] : i for i in self.linkInstances}



		#icon
		self.Icon = _Icon(r"%s\extra\icon.ico" %ipath)
		self.Size = _Size(290,435)
		self.Text = "Quasar"
		self.class1Result = "Done!"

		# fonts
		self.gsmt_11r = _Font("Georgia", 10)
		self.gsmt_10r = _Font("Georgia",9)

		# label
		self.label = Label()
		self.label.Text = "Select Links:"
		self.label.Font = self.gsmt_11r
		self.label.Location = _Point(30,10)
		self.label.Size = _Size(220,28)
		self.Controls.Add(self.label)

		# checklist box
		self.lstbox = CheckedListBox()
		self.lstbox.Items.AddRange(tuple(self.linkName))
		self.lstbox.Font = self.gsmt_10r
		# padding
		self.lstbox.Padding = Padding(30)
		# select one click
		self.lstbox.CheckOnClick = True

		self.FormBorderStyle = FormBorderStyle.FixedDialog
		self.MaximizeBox = False;
		self.ManimizeBox = False;
		self.lstbox.Location = _Point(30,40)
		self.lstbox.Size = _Size(210,280)

		# auto horizontal scrollbar
		self.lstbox.HorizontalScrollbar = True
		self.Controls.Add(self.lstbox)

		# select all btn
		self.btn_all = Button()
		self.btn_all.Text = "Select All"
		self.btn_all.Font = self.gsmt_10r
		self.btn_all.Size = _Size(95,25)
		self.btn_all.Location = _Point(30,315)
		self.Controls.Add(self.btn_all)

		# select none btn
		self.btn_none = Button()
		self.btn_none.Text = "Select None"
		self.btn_none.Font = self.gsmt_10r
		self.btn_none.Size = _Size(95,25)
		self.btn_none.Location = _Point(145,315)
		self.Controls.Add(self.btn_none)

		# ok btn
		self.btn = Button()
		self.btn.Text = "OK"
		self.btn.Font = self.gsmt_10r
		self.btn.Size = _Size(80,25)
		self.btn.Location = _Point(95,350)
		self.Controls.Add(self.btn)

		# events
		self.btn_all.Click += self.click_all
		self.btn_none.Click += self.click_none
		self.btn.Click += self.click_ok 

		# pop up from center
		self.CenterToScreen()