From: <ah...@us...> - 2007-11-15 19:53:47
|
Revision: 11576 http://jvcl.svn.sourceforge.net/jvcl/?rev=11576&view=rev Author: ahuser Date: 2007-11-15 11:53:40 -0800 (Thu, 15 Nov 2007) Log Message: ----------- Added theming support for JVCL.NET Modified Paths: -------------- trunk/jvcl/run/JvArrowButton.pas trunk/jvcl/run/JvCtrls.pas trunk/jvcl/run/JvDBGrid.pas trunk/jvcl/run/JvEdit.pas trunk/jvcl/run/JvThemes.pas trunk/jvcl/run/JvToolEdit.pas Modified: trunk/jvcl/run/JvArrowButton.pas =================================================================== --- trunk/jvcl/run/JvArrowButton.pas 2007-11-15 15:28:55 UTC (rev 11575) +++ trunk/jvcl/run/JvArrowButton.pas 2007-11-15 19:53:40 UTC (rev 11576) @@ -1196,7 +1196,7 @@ if ThemeServices.ThemesEnabled and Enabled and not Flat then begin R := BoundsRect; - InvalidateRect(Parent.Handle, @R, True); + InvalidateRect(Parent.Handle, R, True); end else {$ENDIF JVCLThemesEnabled} @@ -1261,7 +1261,7 @@ if ThemeServices.ThemesEnabled and Enabled and not Flat then begin R := BoundsRect; - InvalidateRect(Parent.Handle, @R, True); + InvalidateRect(Parent.Handle, R, True); end; {$ENDIF JVCLThemesEnabled} end; @@ -1282,7 +1282,7 @@ if ThemeServices.ThemesEnabled and Enabled and not Flat then begin R := BoundsRect; - InvalidateRect(Parent.Handle, @R, True); + InvalidateRect(Parent.Handle, R, True); end; {$ENDIF JVCLThemesEnabled} end; Modified: trunk/jvcl/run/JvCtrls.pas =================================================================== --- trunk/jvcl/run/JvCtrls.pas 2007-11-15 15:28:55 UTC (rev 11575) +++ trunk/jvcl/run/JvCtrls.pas 2007-11-15 19:53:40 UTC (rev 11576) @@ -544,7 +544,7 @@ Details := ThemeServices.GetElementDetails(Button); // Parent background. - ThemeServices.DrawParentBackground(Handle, DrawItemStruct.hDC, @Details, True); + ThemeServices.DrawParentBackground(Handle, DrawItemStruct.hDC, {$IFNDEF CLR}@{$ENDIF}Details, True); // Button shape. ThemeServices.DrawElement(DrawItemStruct.hDC, Details, DrawItemStruct.rcItem); // Return content rect Modified: trunk/jvcl/run/JvDBGrid.pas =================================================================== --- trunk/jvcl/run/JvDBGrid.pas 2007-11-15 15:28:55 UTC (rev 11575) +++ trunk/jvcl/run/JvDBGrid.pas 2007-11-15 19:53:40 UTC (rev 11576) @@ -1776,14 +1776,28 @@ end; procedure TJvDBGrid.Paint; +{$IFDEF CLR} + {$IFDEF JVCLThemesEnabled} +var + OptionsProp: PropertyInfo; + NewOptions: TGridOptions; + {$ENDIF JVCLThemesEnabled} +{$ENDIF CLR} begin {$IFDEF JVCLThemesEnabled} if UseXPThemes and ThemeServices.ThemesEnabled then begin // reset the inherited options but remove the goFixedVertLine and goFixedHorzLine values // as that causes the titles and indicator panels to have a black border - TStringGrid(Self).Options := TStringGrid(Self).Options - [goFixedVertLine]; - TStringGrid(Self).Options := TStringGrid(Self).Options - [goFixedHorzLine]; + {$IFDEF CLR} + { TJvDBGrid - TDBGrid - TCustomGrid } + OptionsProp := Self.GetType.BaseType.BaseType.GetProperty('Options', BindingFlags.NonPublic or BindingFlags.Instance); + NewOptions := OptionsProp.GetValue(Self, []) as TGridOptions; + NewOptions := NewOptions - [goFixedVertLine, goFixedHorzLine]; + OptionsProp.SetValue(Self, TObject(NewOptions), []); + {$ELSE} + TStringGrid(Self).Options := TStringGrid(Self).Options - [goFixedVertLine, goFixedHorzLine]; + {$ENDIF CLR} end; {$ENDIF JVCLThemesEnabled} inherited Paint; Modified: trunk/jvcl/run/JvEdit.pas =================================================================== --- trunk/jvcl/run/JvEdit.pas 2007-11-15 15:28:55 UTC (rev 11575) +++ trunk/jvcl/run/JvEdit.pas 2007-11-15 19:53:40 UTC (rev 11576) @@ -671,7 +671,7 @@ var AFont: TLogFont; begin - GetObject(GetStockObject(DEFAULT_GUI_FONT), SizeOf(AFont), @AFont); + GetObject(GetStockObject(DEFAULT_GUI_FONT), SizeOf(AFont), {$IFNDEF CLR}@{$ENDIF}AFont); AFont.lfHeight := Self.Font.Height; Result := CreateFontIndirect(AFont); end; Modified: trunk/jvcl/run/JvThemes.pas =================================================================== --- trunk/jvcl/run/JvThemes.pas 2007-11-15 15:28:55 UTC (rev 11575) +++ trunk/jvcl/run/JvThemes.pas 2007-11-15 19:53:40 UTC (rev 11576) @@ -90,7 +90,9 @@ TThemedWindow = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.TThemedWindow; {$EXTERNALSYM TThemedWindow} TThemeData = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.TThemeData; {$EXTERNALSYM TThemeData} + {$IFNDEF CLR} PThemedElementDetails = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.PThemedElementDetails; {$EXTERNALSYM PThemedElementDetails} + {$ENDIF ~CLR} TThemedElementDetails = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.TThemedElementDetails; {$EXTERNALSYM TThemedElementDetails} TThemeServices = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.TThemeServices; {$EXTERNALSYM TThemeServices} @@ -826,7 +828,8 @@ if TWinControl(Control).DoubleBuffered then PerformEraseBackground(Control, Canvas.Handle, R) else - ThemeServices.DrawParentBackground(TWinControl(Control).Handle, Canvas.Handle, nil, False, @R); + ThemeServices.DrawParentBackground(TWinControl(Control).Handle, Canvas.Handle, nil, + False, {$IFNDEF CLR}@{$ENDIF}R); end else PerformEraseBackground(Control, Canvas.Handle, R) @@ -851,7 +854,7 @@ {$ENDIF JVCLThemesEnabled} begin {$IFDEF JVCLThemesEnabled} - GetObject(Brush, SizeOf(LogBrush), @LogBrush); + GetObject(Brush, SizeOf(LogBrush), {$IFNDEF CLR}@{$ENDIF}LogBrush); if ThemeServices.ThemesEnabled and (Control.Parent <> nil) and (LogBrush.lbColor = Cardinal(ColorToRGB(TWinControlThemeInfo(Control.Parent).Color))) and @@ -863,7 +866,8 @@ if TWinControl(Control).DoubleBuffered then PerformEraseBackground(Control, DC, R) else - ThemeServices.DrawParentBackground(TWinControl(Control).Handle, DC, nil, False, @R); + ThemeServices.DrawParentBackground(TWinControl(Control).Handle, DC, nil, False, + {$IFNDEF CLR}@{$ENDIF}R); end else PerformEraseBackground(Control, DC, R) Modified: trunk/jvcl/run/JvToolEdit.pas =================================================================== --- trunk/jvcl/run/JvToolEdit.pas 2007-11-15 15:28:55 UTC (rev 11575) +++ trunk/jvcl/run/JvToolEdit.pas 2007-11-15 19:53:40 UTC (rev 11576) @@ -3133,10 +3133,22 @@ {$IFDEF JVCLThemesEnabled} procedure TJvCustomComboEdit.WMNCCalcSize(var Msg: TWMNCCalcSize); +{$IFDEF CLR} +var + CalcSizeParams: TNCCalcSizeParams; +{$ENDIF CLR} begin if ThemeServices.ThemesEnabled and Ctl3D and (BorderStyle = bsSingle) then + begin + {$IFDEF CLR} + CalcSizeParams := Msg.CalcSize_Params; + InflateRect(CalcSizeParams.rgrc0, 1, 1); + Msg.CalcSize_Params := CalcSizeParams; + {$ELSE} with Msg.CalcSize_Params^ do InflateRect(rgrc[0], 1, 1); + {$ENDIF CLR} + end; inherited; end; {$ENDIF JVCLThemesEnabled} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |