Problem PaintBox.Color lazarus / 1-Linux ---------------------------------------------------------------------- ilikeit · 2006-08-24 12:59 Hello, I'm working with lazarus 0.96 beta on Mandrake 10.2.  I can change the color property of PaintBox (idem with ScrollBox) but when the program runs it's still clBtnFace. Any idea? Thank you ---------------------------------------------------------------------- felipemdc · 2006-08-25 00:09 Remember that the PaintBox doesn´t remember things painted on it. They will only remain there until it is refreshed, and this is probably the reason why the drawing disappears. Try changing the color property of the paintbox inside the OnPaint event of the form. ---------------------------------------------------------------------- ilikeit · 2006-08-25 07:59 Quote from: "sekel"Remember that the PaintBox doesn´t remember things painted on it. They will only remain there until it is refreshed, and this is probably the reason why the drawing disappears. Try changing the color property of the paintbox inside the OnPaint event of the form. It's not so simple! There is nothing painted on my PaintBox, I just want a white PaintBox. Of course I could draw a rectangle and fill it with white color, but I think it's really a bug (scrollbox has also bugs [2 at least]). The same program has no problem with lazarus v0.90 under window! ---------------------------------------------------------------------- theo · 2006-08-25 09:02 QuoteIt's not so simple! There is nothing painted on my PaintBox, I just want a white PaintBox. Of course I could draw a rectangle and fill it with white color, but I think it's really a bug I don't think it's a bug. You'd probably better take a TShape for what you need. ---------------------------------------------------------------------- ilikeit · 2006-08-25 10:32 Quote from: "theo" I don't think it's a bug. You'd probably better take a TShape for what you need. Did you really try with the same version under linux? Sorry, but it's a bug. So, I must keep kylix, pfffff..... Bye ---------------------------------------------------------------------- Marc · 2006-08-25 15:00 This is not a bug. Color is the Color of the brush used while painting. If you don't paint anyting, nothing will show. If you want a white background, paint a backround in the OnPaint event. ---------------------------------------------------------------------- ilikeit · 2006-08-25 18:59 Quote from: "Marc"This is not a bug. Color is the Color of the brush used while painting. If you don't paint anyting, nothing will show. If you want a white background, paint a backround in the OnPaint event. Well, I take Delphi6 (under windows), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite and the paintbox appears in white color. I take Lazarus 0.90 (under windows), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite, and the paintbox appears in white color. I take kylix3 (under linux), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite, and the paintbox appears in white color. I take Lazarus 0.96 beta (under linux), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite, and the paintbox appears in ... clBtnFace color. What is your conclusion? ---------------------------------------------------------------------- felipemdc · 2006-08-26 02:00 Quote from: "ilikeit"What is your conclusion? Please submit a bug report. But also notice that it is trivial to work around this problem. ---------------------------------------------------------------------- theo · 2006-08-26 13:05 Quote from: "ilikeit" What is your conclusion? This is the most unimportant "bug" I've ever seen. ;-) ---------------------------------------------------------------------- Marc · 2006-08-28 10:09 Quote from: "ilikeit"Quote from: "Marc"This is not a bug. Color is the Color of the brush used while painting. If you don't paint anyting, nothing will show. If you want a white background, paint a backround in the OnPaint event. Well, I take Delphi6 (under windows), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite and the paintbox appears in white color. I take Delphi 6 and I change the color to clGreen and nothing happens. Quote I take Lazarus 0.90 (under windows), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite, and the paintbox appears in white color. I take kylix3 (under linux), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite, and the paintbox appears in white color. I take Lazarus 0.96 beta (under linux), I create a new Project, I put a paintbox on the Form1 (with mouse). I select color property in the inspector, I select clwhite, and the paintbox appears in ... clBtnFace color. What is your conclusion? The conclusion is that either you and me are using a different version of Delphi6 or (what is more likely) the behaviour of the color differs if you use win XP or not. At this point I'm still not convinced what the behaviour should be (still think nothing should be drawn) ---------------------------------------------------------------------- felipemdc · 2006-08-28 11:33 Quote from: "Marc"I take Delphi 6 and I change the color to clGreen and nothing happens. I did exactly the same with Delphi 7 on Windows XP, and nothings happens. ---------------------------------------------------------------------- CCRDude · 2006-08-28 11:50 Thinking about both, I would expect: The Color property if OnPaint is not assigned, and nothing (well, "transparency" aka background) otherwise. Can't test right now since the main Lazarus bar is gone again here (did this 3 times the past 3 weeks, need to find the config file settings for this now ^^) ---------------------------------------------------------------------- ilikeit · 2006-08-28 12:00 Quote from: "sekel"Quote from: "Marc"I take Delphi 6 and I change the color to clGreen and nothing happens. I did exactly the same with Delphi 7 on Windows XP, and nothings happens. Arf! I beg your pardon! It's not Paintbox.Color but ScrollBox.Color which is buggy. There is also another problem with scrollbox when scrollbars are visible, if I click on the buttons (which have an arrow) nothing happens. Sorry for my confusion with paintbox! ---------------------------------------------------------------------- Marc · 2006-08-29 09:21 Aahhhhh, Confirmed, the gtk scrollbox only changes its bordercolor. (a gtk scrollbox is not really a component, it is a set of scrollbars placed on its parent). Can you bugrep this (if not already done) How did you configure the scrollbars ?