GraphicButton Image change with click

Started by pascal_dedi, December 05, 2013, 03:11:10 AM

Previous topic - Next topic

pascal_dedi

Hi , i am new in Forum,
how can i for a GraphicButton 2 Image use?

eg. for one click "Image a", second click "Image b", next click again "Image a", next click "Image b" so.

Thankyou


(defun c:Layer_Manager_Form1_GraphicButton5_OnClicked (/)

(if

????????????????

(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  105)

(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  104)
)
   )       

owenwengerd

Maybe this?

Code (autolisp) Select
(if (/= (dcl_Control_GetPicture Layer_Manager_Form1_GraphicButton5) 105) ...)
Owen Wengerd (Outside The Box) / ManuSoft

pascal_dedi


hi, thank you .
I have also solved, with extra button value :)


;(if
;(= but_val 0)
;(progn
;(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  105)
;(setq but_val 1)
;)
;(progn
;(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  104)
;(setq but_val 0)
;)
;);if

Fred Tomke

Hm, why don't you use the property value as Owen recommended?

Code (autolisp) Select

(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5
  (if (/= (dcl_Control_GetPicture Layer_Manager_Form1_GraphicButton5) 105)
    105
    106
  ); if
); dcl_Control_SetPicture


That decreases the number of variables.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

pascal_dedi

#4
Hi Fred,
i use Owen Version,
sure he has better written, I self have written before Owen,
only for Info :-)