()
| 105 | |
| 106 | |
| 107 | def test_combobox(): |
| 108 | doc = pymupdf.open() |
| 109 | page = doc.new_page() |
| 110 | widget = pymupdf.Widget() |
| 111 | widget.field_name = "ComboBox-1" |
| 112 | widget.field_label = "an editable combo box ..." |
| 113 | widget.field_type = pymupdf.PDF_WIDGET_TYPE_COMBOBOX |
| 114 | widget.field_flags = ( |
| 115 | pymupdf.PDF_CH_FIELD_IS_COMMIT_ON_SEL_CHANGE | pymupdf.PDF_CH_FIELD_IS_EDIT |
| 116 | ) |
| 117 | widget.fill_color = gold |
| 118 | widget.choice_values = ( |
| 119 | "Spanien", |
| 120 | "Frankreich", |
| 121 | "Holland", |
| 122 | "Dänemark", |
| 123 | "Schweden", |
| 124 | "Norwegen", |
| 125 | "England", |
| 126 | "Polen", |
| 127 | "Russland", |
| 128 | "Italien", |
| 129 | "Portugal", |
| 130 | "Griechenland", |
| 131 | ) |
| 132 | widget.rect = rect |
| 133 | widget.text_color = blue |
| 134 | widget.text_fontsize = fontsize |
| 135 | widget.field_value = widget.choice_values[-1] |
| 136 | page.add_widget(widget) # create the field |
| 137 | field = page.first_widget |
| 138 | assert field.field_type_string == "ComboBox" |
| 139 | |
| 140 | |
| 141 | def test_text2(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…