dcl_Control_SetBackColor not working on slides

Started by mr nick, April 07, 2009, 08:57:00 AM

Previous topic - Next topic

mr nick

I'm trying to change the background color of my slides when I select them but nothing is happening. If I use the highlight function, this works with no problems but it's just too subtle so I'd much prefer to change the entire background. If I set a color in the studio, the color shows correctly but if I try to alter it from code, nothing happens - no errors, no change.

Is this a bug or am I doing something wrong?

docsaintly

Please post the code you are using so we can take a look :)

mr nick

#2
Here is a simple example. The dialog has a single slide with the background defined in the studio as green. Clicking the button should, if I'm doing things correctly, change the background to yellow but doesn't.

If anyone can point out the error of my ways or confirm it as a bug I'd be most appreciative.

Code (autolisp) Select


(defun c:slidex (/ slidedia )
  (setq slidedia
    '("YWt6AygMAACfU3xZBuKT6LUVbS9quMGqSMczXTy/ucyu9Ht3ugjkWNB6OzrTK33AbjztMCUT5Pb2"
    "szAJqIkwSVAixI53QIjQCplhnmFehqTHL2Wxx/cNGUDzu1xoumeYj8WJohGQnQJJJ60mEt4LWwKq"
    "T/9H4jx7QBx+IFv+EAcUi75W2JqyH3pgWJvg6J7C4lsHjdo/J7DKqvG0TVURBxqaYmzkzFNY+oxs"
    "GUGpLrtv97W1mzdVscgoo+KriBLSEQvMZuisyhYXYUws5O/RcPccMJAnCtw5O8u5XKK+ROZmRK5E"
    "2tQVWRRGUz2lfI18w6EVJF+Y3lb6cA2wNKed85bnJfbJTtihTyH3sWyJxIgJKpFLq7FtQQ2PiIUx"
    "9uFsQViAMgQLnFEQAqSuIj5c5mJjIQGltwTw0C495unvNuY/qe17x5JM0unp2uhyjUxadewnWRrv"
    "A2Ls2fGHSHWsf21yUMpm1epF/VCnDk2QlAlX0di/2fZhrBxB3LcHPo+J95FvoVsw7GAxH1ZH8Fah"
    "3oZ7rFVvYVgglYoKrLIAuZnr8S+CL5zluqn30W8hW8A8AueGbI87nH2qgZ0qwWayMbKwsXm5yLOF"
    "XrvkjxFXO0F4hLOGCT+MSQf+pBHagJINAiUHcecRUY9mjxAcyK5YJIHu25QWJzRtwTk1SM3bxDVG"
    "/VTIHTgIvVTYuyo1Z1Qa5j+bBjpOa+iUbZ/kBiiJfUwsAWclb4O7VryTYjuCps9cuBP3kH8bsjS3"
    "mqHJHUtEpE9qGup7l9tRg9S2hXDHMb3i2krVb7HHyoTaBZZSqyn2Ac9zEr4xyP/bErNIHWXT3hMY"
    "bsuzSIJ/pV5os+2bpFbbW5MT2sckyMeOZUjMbWDLL0JcyzKVRvuBqHePQRJjg21ryDBhKKBEBAJ9"
    "k6nsww==")
  );setq
  (dcl_Project_import slidedia nil nil)
  (dcl_Form_Show example_form1)
  (dcl_Project_Unload "example" t)
  (princ)
);defun

(defun c:example_Form1_btnChange_OnClicked (/)
  (dcl_Control_SetBackColor example_Form1_SlideView1 2)
)
(defun c:example_Form1_btnCancel_OnClicked (/)
  (dcl_Form_Close example_form1)
)


owenwengerd

Thanks for the sample code.  It's a bug.  I've fixed it now for the next build.

mr nick

Quote from: owenwengerd on April 07, 2009, 06:27:19 PM
Thanks for the sample code.  It's a bug.  I've fixed it now for the next build.

Thanks Owen. Any ideas on an ETA for the next build?

Fred Tomke

Hi,

Sorry for my silly question, but - what is an ETA?

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

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

owenwengerd

ETA = "Estimated Time of Arrival"

In this case, ETA is April 13.

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

mr nick

Just downloaded the updated arx and the slide backgrounds now work as expected. Thanks Owen.

Danner

Hi,

I've just noticed exactly the same issue with BlockViews too.  Works with highlight, but not background colour.

Cheers

owenwengerd

The BlockView should not have a background color property, because the background color is determined by AutoCAD and cannot be set. I will remove that property for the next build and correct the documentation.

Fred Tomke

Hello,

Quotethe background color is determined by AutoCAD

that is new to me. In ObjectDCL I could set the BackColor to -16 so a drawn preview block could be placed on the form as if it was drawn directly on the form.
It would be very unfortunate to me, if this wouldn't work any longer (see attachment BlockView.png).

What I don't understand is that the backcolor property work in OpenDCL as you can see in the attachment BlockLin.png. So why should this be removed?

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

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

Danner

Owen,  I don't want to seem churlish, because I am so indebted to you.  However,  I was setting Background colour in BlockViews worked quite happily in v4, so why not v5?

owenwengerd

No problem to correct me when I'm wrong. I'll see if I can figure out why this would have changed.

owenwengerd

After some further testing, I see that the block view (and hatch) controls do use the background color that is set at design time, but they apparently cache that background color and repaint with the original background color at runtime. This means that even though the new background color is actually painted, it then gets painted over with the cached original background color. This presents a bit of a dilemma, because caching the displayed graphics is a performance improvement. Those controls use AutoCAD AcGsView control internally, and while I could force that control to be recreated every time the background color changes, it would cause a noticeable delay at runtime.

How important is it to you guys to be able to change the background color of block view and hatch controls at runtime? Is it worth the performance penalty?