``MultilineTextField`` add multi-line text string input field. Result is stored in self.result as a string. This option is not supported on the command-line.
| 114 | |
| 115 | |
| 116 | class MultilineTextField: |
| 117 | """ |
| 118 | ``MultilineTextField`` add multi-line text string input field. Result is stored in self.result |
| 119 | as a string. This option is not supported on the command-line. |
| 120 | """ |
| 121 | def __init__(self, prompt: str, default: Optional[str] = None): |
| 122 | self._prompt = prompt |
| 123 | self._default = default |
| 124 | self._result = None |
| 125 | |
| 126 | def _fill_core_struct(self, value): |
| 127 | value.type = FormInputFieldType.MultilineTextFormField |
| 128 | value.prompt = self._prompt |
| 129 | value.hasDefault = self._default is not None |
| 130 | if self._default is not None: |
| 131 | value.stringDefault = self._default |
| 132 | |
| 133 | def _fill_core_result(self, value): |
| 134 | value.stringResult = core.BNAllocString(str(self._result)) |
| 135 | |
| 136 | def _get_result(self, value): |
| 137 | self._result = value.stringResult |
| 138 | |
| 139 | @property |
| 140 | def prompt(self): |
| 141 | return self._prompt |
| 142 | |
| 143 | @prompt.setter |
| 144 | def prompt(self, value): |
| 145 | self._prompt = value |
| 146 | |
| 147 | @property |
| 148 | def result(self): |
| 149 | return self._result |
| 150 | |
| 151 | @result.setter |
| 152 | def result(self, value): |
| 153 | self._result = value |
| 154 | |
| 155 | |
| 156 | class IntegerField: |