| 1090 | inputWidget = None |
| 1091 | |
| 1092 | def __init__(self, widget, attributeName, propertyDef, attributeDict, appInstance, *args, **kwargs): |
| 1093 | super(EditorAttributeInputUrl, self).__init__(widget, attributeName, |
| 1094 | propertyDef, attributeDict, appInstance, *args, **kwargs) |
| 1095 | self.inputWidget = gui.TextInput(width="100%", height="100%") |
| 1096 | self.inputWidget.onchange.do(self.on_attribute_changed) |
| 1097 | self.inputWidget.attributes['title'] = attributeDict['description'] |
| 1098 | |
| 1099 | self.btFileFolderSelection = gui.Widget(width='100%', height='100%') |
| 1100 | self.btFileFolderSelection.style.update({'background-repeat': 'no-repeat', |
| 1101 | 'background-image': "url('/res:folder.png')", |
| 1102 | 'background-color': 'transparent'}) |
| 1103 | self.btFileFolderSelection.onclick.do( |
| 1104 | self.on_file_selection_bt_pressed) |
| 1105 | ''' |
| 1106 | self.set_from_asciiart(""" |
| 1107 | |del|lbl |input |bt| |
| 1108 | """) |
| 1109 | ''' |
| 1110 | self.style.update({'grid-template-columns': "6% 46% 33% 15%", |
| 1111 | 'grid-template-rows': "100%", 'grid-template-areas': "'del lbl input bt'"}) |
| 1112 | self.append({'del': self.removeAttribute, 'lbl': self.label, |
| 1113 | 'input': self.inputWidget, 'bt': self.btFileFolderSelection}) |
| 1114 | |
| 1115 | def on_file_selection_bt_pressed(self, widget): |
| 1116 | self.selectionDialog = gui.FileSelectionDialog( |