CheckBox - not hiding properly

Started by ehya, June 11, 2023, 04:47:31 AM

Previous topic - Next topic

ehya

Hi there,


I want to hide the radio button and checkbox on the screen.

The obfuscation is working correctly with the radio_button. But when I click checkBox it doesn't work correctly. It leaves a mark on the screen.

The obfuscation is working correctly with the radio_button. But when I click checkBox it doesn't work correctly. It leaves a mark on the screen.


The 1st picture is the correct one. When I click on the radio_button it looks like what I want.
However, when I click checkbox, the text_box trace remains where I marked in the 2nd picture.


In summary, what I want to do is;
If the checkbox is checked while the radio_button is checked, the image and textbox will be on the screen.
If the checkbox is unchecked, the image will change. 1 editbox will be hidden. 2 editbox locations will change.



How can I solve this problem?


1ST PIC



2ND PIC


CODE

(defun resimduzen (/)
(if (and (= (dcl-Control-GetValue istinat/Form1/OptionButton1) 1)
(= (dcl-Control-GetValue istinat/Form1/CheckBox1) 1))
(progn
   (dcl-Control-SetPicture istinat/Form1/PictureBox1 100)
             (dcl-Control-setLeft istinat/Form1/DG11 114)
             (dcl-Control-setLeft istinat/Form1/DG7 230)
          (dcl-Control-setVisible istinat/Form1/DG10 t)
))

(if (and (= (dcl-Control-GetValue istinat/Form1/OptionButton1) 1)
(= (dcl-Control-GetValue istinat/Form1/CheckBox1) 0))
(progn
(dcl-Control-SetPicture istinat/Form1/PictureBox1 101)
             (dcl-Control-setLeft istinat/Form1/DG11 96)
             (dcl-Control-setLeft istinat/Form1/DG7 210)
    (dcl-Control-setVisible istinat/Form1/DG10 nil)
)))


Fred Tomke

Hi, is it possible to get the project and (only) the relevant code for testing?
Maybe a resreh on all controls or the form could help.
With regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

ehya

Hello
First of all, thank you for your reply message.
I am attaching the lisp and odcl file.
I actually found a solution last night. But it was a very strange solution.

In the attached lisp, in the section related to checkbox, typing the "(BUTON-1)" section twice in succession solves the problem.
I would like to know if there is a correct solution though.
Thanks.


https://drive.google.com/file/d/1FFxVCBn1gmD7orUnWWpJccmHvPs4A4Gf/view?usp=sharing


(defun c:retaining/Form1/CheckBox1#OnClicked (Value /)
   (BUTTON-1)(BUTTON-1)
   (if (= (dcl-Control-GetValue retaining/Form1/CheckBox1) 1)
        (dcl-Control-SetEnabled retaining/Form1/TextBox11t)
        (dcl-Control-SetEnabled retaining/Form1/TextBox11 nil)
))