Jump to content

Vergrößerung eines Texteingabefeldes im Dialog


---
 Share

Recommended Posts

Hallo zusammen,

in einem Dialog verwende ich ein Texteingabefeld, dessen Größe sich leider nicht wie gewünscht anpassen lässt. Weder das vertikale Verbinden von Zellen noch die Definition von Absätzen über das Attribut „rows“ im Code führen zu einer Vergrößerung des Feldes.

Bei der Eingabe längerer Texte wird kein automatischer Zeilenumbruch erzeugt, und das Feld wächst nicht mit dem Inhalt mit. Stattdessen wird der Text einfach weitergeschrieben und nach links hinausgeschoben, was die Lesbarkeit und Übersichtlichkeit stark beeinträchtigt.

Auch in der App Development Documentation konnte ich hierzu keine hilfreichen Informationen finden. Dass eine größere Darstellung jedoch grundsätzlich möglich ist, zeigt der Systemdialog „Supportdaten zusammenstellen“, der ein entsprechend angepasstes Texteingabefeld verwendet.

Meine Frage: Wie kann ich das Texteingabefeld standardmäßig vergrößern, sodass es auch bei längeren Texten übersichtlich bleibt und Absätze korrekt dargestellt werden?

image.png.a132c2704588a2cb9579f8c58fd9344e.png               image.png.4e53ea7580e1d13985a302737d7c8f3d.png

RESULT=gom.script.sys.execute_user_defined_dialog (dialog={

                "content": [

                               [

                                               {

                                                               "columns": 1,

                                                               "data": "AAAAAA==",

                                                               "file_name": "",

                                                               "height": 0,

                                                               "keep_aspect": True,

                                                               "keep_original_size": True,

                                                               "name": "image",

                                                               "rows": 1,

                                                               "system_image": "system_message_question",

                                                               "tooltip": {

                                                                               "id": "",

                                                                               "text": "",

                                                                               "translatable": True

                                                               },

                                                               "type": "image",

                                                               "use_system_image": True,

                                                               "width": 0

                                               },

                                               {

                                                               "columns": 1,

                                                               "name": "input_1",

                                                               "password": False,

                                                               "read_only": False,

                                                               "rows": 1,

                                                               "tooltip": {

                                                                               "id": "",

                                                                               "text": "",

                                                                               "translatable": True

                                                               },

                                                               "type": "input::string",

                                                               "value": "dsadasasasasasasasasasasasasasasasassddassdssd"

                                               }

                               ]

                ],

                "control": {

                               "id": "OkCancel"

                },

                "embedding": "always_toplevel",

                "position": "center",

                "size": {

                               "height": 223,

                               "width": 239

                },

                "sizemode": "fixed",

                "style": "",

                "title": {

                               "id": "",

                               "text": "Dialogtitel",

                               "translatable": True

                }

})

Link to comment
Share on other sites

I found that if you export that ".dlg" file, edit "with", then it will stay like that if you have "fixed" sizemode.

If you want to show multiline, then use "continuous text" which can only show text, but you can check word wrap.

Link to comment
Share on other sites

Hi,

Another option could be the use of spacers:

  • If you place a horizontal spacer with a certain minimum width in the same column as the text widget, both widgets will be resized accordingly.  
  • If you place a vertical spacer with a certain minimum height in the same row as the text widget, both widgets will be resized accordingly.

You can use a horizontal and a vertical spacer to achieve a minimum size of your text widget in both directions. The spacers are not visible in the resulting dialog.

Best regards,

Matthias

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...