Question about ThemeServices lazarus / 39-Graphics ---------------------------------------------------------------------- Blaazen · 2011-04-09 23:49 Can someone tell me how to use function ThemeServices.DrawEdge ? Declaration: Code: [Select]procedure DrawEdge(DC: HDC; Details: TThemedElementDetails; const R: TRect; Edge, Flags: Cardinal; AContentRect: PRect = nil); virtual;What is Edge and Flags ?  (I cannot find it on wiki.) Code: [Select]  details:=ThemeServices.GetElementDetails(tbPushButtonNormal);   //works   ThemeServices.DrawElement(FSlider.Canvas.Handle, details, aRect, nil);   //works   ThemeServices.DrawEdge(FSlider.Canvas.Handle, details, aRect, 4, 4, nil);   // ??? I would like to have border around button, I believe DrawEdge is what I need. I added screenshot, normal TButton (for comparison) and image of Button painted on TImage by function DrawElement. Thanks. Edit: I am on Linux+Qt. ---------------------------------------------------------------------- zeljko · 2011-04-10 08:54 Is DrawEdge() implemented in QtThemes ? ---------------------------------------------------------------------- Blaazen · 2011-04-10 10:22 It seems it is implemented only for Windows. Thanks anyway. ---------------------------------------------------------------------- Blaazen · 2011-04-10 11:18 Finally it seems that DrawEdge is not necessary. Previous problem caused painting on a black background. Now works as expected (see new screenshot). Note that it is impossible paint on canvas (TPanel.Canvas etc.) outside of OnPaint method for Qt (and Carbon). It is better use TImage for it. ---------------------------------------------------------------------- zeljko · 2011-04-10 13:55 Quote from: Blaazen on April 10, 2011, 01:18:00 pm Finally it seems that DrawEdge is not necessary. Previous problem caused painting on a black background. Now works as expected (see new screenshot). Note that it is impossible paint on canvas (TPanel.Canvas etc.) outside of OnPaint method for Qt (and Carbon). It is better use TImage for it. Yes, painting outside of paint event is evil (for handles), anyway you can always paint on bitmap, and then in handle paintevent just draw that bitmap. Under Qt you can get old behaviour (set painting outside of paintevent on widget), but it works only on linux.