Exemplo n.º 1
0
def change_pages():
    unhook_events()
    part = topComboBoxPart.SelectedIndex

    unhook_events()
    topComboBoxPage.Items.Clear()
    bottomComboBoxPage.Items.Clear()
    if part == 0:
        return

    items = get_list('docs/part%s/list.txt' % part)

    topCombobox = topComboBoxPage
    bottomComboBox = bottomComboBoxPage

    items = ['Index'] + items
    for combobox in topCombobox, bottomComboBox:
        for item in items:
            boxitem = ComboBoxItem()
            boxitem.Content = item
            boxitem.Height = 25
            combobox.Items.Add(boxitem)

    topComboBoxPage.SelectedIndex = 0
    bottomComboBoxPage.SelectedIndex = 0
    hook_events()
Exemplo n.º 2
0
 def combobox_add_text_types(self):
     """Function to add all TextNoteTypes to ComboBox(self.UI_text_type)."""
     for n, type in enumerate(all_text_types):
         item = ComboBoxItem()
         item.Content    = type.get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_NAME).AsString()
         item.IsSelected = True if n==0 else False
         self.UI_text_type.Items.Add(item)
Exemplo n.º 3
0
 def combobox_add_parameters(self):
     """Function to add all TextNoteTypes to ComboBox(self.UI_text_type)."""
     for n, p_name in enumerate(sorted(dict_sheet_parameters.keys())):
         item = ComboBoxItem()
         item.Content = p_name
         item.IsSelected = True if p_name == 'Sheet Number' else False
         self.UI_parameters.Items.Add(item)
Exemplo n.º 4
0
def setup_parts():
    items = get_list('docs/list.txt')

    topCombobox = topComboBoxPart
    bottomComboBox = bottomComboBoxPart

    items = ['Index'] + items
    for combobox in topCombobox, bottomComboBox:
        for item in items:
            boxitem = ComboBoxItem()
            boxitem.Content = item
            boxitem.Height = 25
            combobox.Items.Add(boxitem)

    topCombobox.SelectionChanged += on_change_top_part
    bottomComboBox.SelectionChanged += on_change_bottom_part

    topCombobox.SelectedIndex = bottomComboBox.SelectedIndex = 0