gkobler 38 Posted October 19 I have a problem with my TTreeView Component, i have add my own methode OnCustomDraw Sender.Canvas.Brush.Color := clGreen; Sender.Canvas.Rectangle(ARect); Sender.Canvas.FillRect(ARect); DefaultDraw := True; Just to draw a green background for test purpose. This code is working well as a VCL-Form App, but as a nested form from as follow TYPE TMainFrame = CLASS(TFrame) When i use them in a WelcomePage Plugin, it does not work. It just drawed the white Background, also the Color Property is ignored. Does anybody has a hint for me? Share this post Link to post
Remy Lebeau 1436 Posted October 19 (edited) Can you provide a more complete reproducible example? Are you suggesting that when your custom TreeView is placed on a TForm then the TreeView shows a green background, but when the TreeView is placed on a TFrame than the TreeView does not show a green background? Is it only limited to IDE plugins, or do you have the same problem if you use the TFrame in an application? Edited October 19 by Remy Lebeau Share this post Link to post
gkobler 38 Posted October 20 (edited) Have created a demo (see attached file). Demo are based on the basic WP demo project. Open the project group TestWPTreeView. When you compile the WP-Plugin, and install it you will see the backgroud are not painted. But when you run the VCL-Program it does. I hope this makes my question clear. TestWPTreeView.zip Edited October 20 by gkobler Share this post Link to post
Uwe Raabe 2064 Posted October 20 Could it be related to the VCL style the IDE is using? BTW, you can change the color used for the item background in the BeforeItemErase event. Share this post Link to post
gkobler 38 Posted October 20 10 minutes ago, Uwe Raabe said: Could it be related to the VCL style the IDE is using? OK, a good approach. 11 minutes ago, Uwe Raabe said: BTW, you can change the color used for the item background in the BeforeItemErase event. The color is just a test, I want to draw a background and call the following code. IF Assigned(BorlandIDEServices) THEN BEGIN LColor := (BorlandIDEServices AS IOTAIDEThemingServices).StyleServices.GetSystemColor(Color) END ELSE BEGIN LColor := clNone; END; (WelcomePagePluginService AS INTAWelcomePageBackgroundService).PaintBackgroundTo(Sender.Canvas, Sender, LColor, cCaptionOpacity); Share this post Link to post