Question about Themes.pas and TWinControl.Canvas lazarus / 31-LCL ---------------------------------------------------------------------- Avishai · 2013-02-08 13:28 Maybe someone that is familiar with Themes.pas can explain to me what this code does.  The reason I ask is because when I mirror TWinControl for RightToLeftLayout, TWinControl.Canvas is corrupted and can not be used. Code: [Select]procedure TThemeServices.UpdateThemes; begin   if FUseThemes then     UnloadThemeData;   FUseThemes := UseThemes;   if FUseThemes then     FThemedControlsEnabled := ThemedControlsEnabled   else     FThemedControlsEnabled := False; end; If I change the code as follows, everything seems to work correctly and the Canvas is fine, but I'm not sure about any side effects.  It may have effects that I don't know about. Code: [Select]procedure TThemeServices.UpdateThemes; begin   if FUseThemes then     UnloadThemeData;   FUseThemes := UseThemes;   //if FUseThemes then   //  FThemedControlsEnabled := ThemedControlsEnabled   //else     FThemedControlsEnabled := False; end; Edit:  I found one of the side effects.  Some TGraphicControls are drawn differently with my changes.  I.E. TSpeedButton has square corners.  But for me, this is a very small price to pay to be able to produce RightToLeft Forms. ---------------------------------------------------------------------- Bart · 2013-02-09 13:24 Well, basically you are disabling themes... Bart ---------------------------------------------------------------------- Avishai · 2013-02-09 14:38 Well I sure hope so.  At least that is my intent.  What I don't understand is this.  If I disable Themes by un-checking "Use manifest file to enable themes" in Project Options, it affects the drawing on almost all controls.  If I disable Themes in "procedure TThemeServices.UpdateThemes;" it looks like only TGraphicControls are drawn differently. ---------------------------------------------------------------------- Avishai · 2013-02-11 07:47 What I'm really looking for is a way to fix Themes so that it doesn't corrupt TCanvas when RightToLeftLayout is used.