Code Red > Visual DCL Programming
Disabling list box in DCL dialog
vicoco:
I'm sure it'll be so simple, but I can't do it...
Can I enable/disable a list box in a dialog box depending on a toggle is off/on?
Can I disable a list box using mode_tile? I'm not successful...
I think that the appended example is enough to understand that I want to do:
- if toggle button ("None") is True -> element list will be disabled to avoid selecting items;
- if toggle button is False -> element list will be enabled.
roy_043:
This should work:
--- Code: ---(mode_tile "tileKey" 1) ; Disable.
(mode_tile "tileKey" 0) ; Enable.
--- End code ---
vicoco:
--- Quote from: roy_043 on May 12, 2021, 01:30:59 PM ---This should work:
--- Code: ---(mode_tile "tileKey" 1) ; Disable.
(mode_tile "tileKey" 0) ; Enable.
--- End code ---
--- End quote ---
It should work, but how??
I use something like this:
--- Code: ---(if (= (get_tile "togglekey") True)
(mode_tile "listboxkey" 1)
(mode_tile "listboxkey" 0))
--- End code ---
I tried to do it directly in the main function.
I tried to defun a new function in this way:
--- Code: ---(defun DisableList ()
(if
(= (get_tile "togglekey") True)
(mode_tile "listboxkey" 1)
(mode_tile "listboxkey" 0)
)
)
--- End code ---
and adding the next line in the main function:
--- Code: ---(action_tile "togglekey" "(DisableList)")
--- End code ---
I know that something escapes me, but I can't find the failure (my knowledge is still very low).
roy_043:
The get_tile function returns a string. In the case of a toggle either "0" or "1".
--- Code - Auto/Visual Lisp: ---(defun DisableList () (if (= (get_tile "togglekey") "1") (mode_tile "listboxkey" 1) (mode_tile "listboxkey" 0) ))
Lee Mac:
Alternatively, you could use this:
--- Code - Auto/Visual Lisp: ---(action_tile "togglekey" "(mode_tile \"listboxkey\" (atoi $value))")
Navigation
[0] Message Index
[#] Next page
Go to full version