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.
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.
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.