[Er...] Posted December 18, 2023 Share Posted December 18, 2023 Hallo! Gibt es die Möglichkeit eine Checkbox auszugrauen / auszublenden wenn bestimmte Bedingungen nicht erfüllt sind und eine Auswahl nicht gegeben werden soll? Grüße Link to comment https://qualityforum.zeiss.com/topic/3506-checkbox-ausblenden-oder-ausgrauen/ Share on other sites More sharing options...
[Ma...] Posted December 18, 2023 Share Posted December 18, 2023 Hallo, hier mal ein kleines Beispiel: # -*- coding: utf-8 -*- import gom DIALOG=gom.script.sys.create_user_defined_dialog (dialog={ "content": [ [ { "background_style": "", "columns": 1, "maximum": 1000, "minimum": 0, "name": "input", "precision": 2, "rows": 1, "tooltip": { "id": "", "text": "", "translatable": True }, "type": "input::number", "unit": "", "value": 0 } ], [ { "columns": 1, "name": "checkbox", "rows": 1, "title": { "id": "", "text": "aktiviert, wenn > 10", "translatable": True }, "tooltip": { "id": "", "text": "", "translatable": True }, "type": "input::checkbox", "value": False } ], [ { "background_style": "", "columns": 1, "maximum": 1000, "minimum": 0, "name": "input_1", "precision": 2, "rows": 1, "tooltip": { "id": "", "text": "", "translatable": True }, "type": "input::number", "unit": "", "value": 0 } ], [ { "columns": 1, "name": "checkbox_1", "rows": 1, "title": { "id": "", "text": "unsichtbar, wenn > 10", "translatable": True }, "tooltip": { "id": "", "text": "", "translatable": True }, "type": "input::checkbox", "value": False } ] ], "control": { "id": "OkCancel" }, "embedding": "always_toplevel", "position": "automatic", "size": { "height": 201, "width": 220 }, "sizemode": "", "style": "", "title": { "id": "", "text": "Dialogtitel", "translatable": True } }) DIALOG.checkbox.enabled = False DIALOG.checkbox_1.visible = True def dialog_event_handler (widget): if widget == DIALOG.input: if DIALOG.input.value > 10: DIALOG.checkbox.enabled = True else: DIALOG.checkbox.enabled = False if widget == DIALOG.input_1: if DIALOG.input_1.value > 10: DIALOG.checkbox_1.visible = False else: DIALOG.checkbox_1.visible = True DIALOG.handler = dialog_event_handler RESULT=gom.script.sys.show_user_defined_dialog (dialog=DIALOG) Ich hoffe das hilft weiter. Gruß Marcus Link to comment https://qualityforum.zeiss.com/topic/3506-checkbox-ausblenden-oder-ausgrauen/#findComment-9822 Share on other sites More sharing options...
[Er...] Posted December 19, 2023 Author Share Posted December 19, 2023 Hallo! Danke für die schnelle Antwort. Das DIALOG.checkbox_1.visible war das was mit gefehlt hat. Gibt´s da noch mehr so Variablen die man kennen sollte? Eine Dokumentation ist da irgendwie nicht mehr auffindbar. Gruß Eric Link to comment https://qualityforum.zeiss.com/topic/3506-checkbox-ausblenden-oder-ausgrauen/#findComment-9826 Share on other sites More sharing options...
[Ma...] Posted December 19, 2023 Share Posted December 19, 2023 Du kannst im Tech Guide schauen oder hier: https://zeissiqs.github.io/gom-software-python-api/2022/index.html Gruß Marcus Link to comment https://qualityforum.zeiss.com/topic/3506-checkbox-ausblenden-oder-ausgrauen/#findComment-9830 Share on other sites More sharing options...
[Er...] Posted December 19, 2023 Author Share Posted December 19, 2023 Oh, cool. Danke. Hab wohl immer falsch gesucht. Werd ich mir mal durchschauen! Link to comment https://qualityforum.zeiss.com/topic/3506-checkbox-ausblenden-oder-ausgrauen/#findComment-9844 Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in