gtk: formatting

git-svn-id: trunk@20030 -
This commit is contained in:
paul 2009-05-19 01:54:41 +00:00
parent e1f781f1a1
commit 7dcf00f903
2 changed files with 20 additions and 17 deletions

View File

@ -318,8 +318,6 @@ type
procedure CreateBitmap; virtual; procedure CreateBitmap; virtual;
function GetFunction: TGdkFunction; virtual; abstract; function GetFunction: TGdkFunction; virtual; abstract;
property GCValues: TGdkGCValues read FGCValues;
protected protected
// winapi // winapi
function SelectBitmap(AGdiObject: PGdiObject): PGdiObject; virtual; function SelectBitmap(AGdiObject: PGdiObject): PGdiObject; virtual;
@ -333,7 +331,6 @@ type
procedure SelectRegion; procedure SelectRegion;
public public
// device handles // device handles
procedure SetWidget(AWidget: PGtkWidget; AWindow: PGdkWindow; procedure SetWidget(AWidget: PGtkWidget; AWindow: PGdkWindow;
@ -362,6 +359,7 @@ type
property CurrentBrush: PGdiObject read FCurrentBrush write SetCurrentBrush; property CurrentBrush: PGdiObject read FCurrentBrush write SetCurrentBrush;
property CurrentPalette: PGdiObject read FCurrentPalette write SetCurrentPalette; property CurrentPalette: PGdiObject read FCurrentPalette write SetCurrentPalette;
property ClipRegion: PGdiObject read FClipRegion write SetClipRegion; property ClipRegion: PGdiObject read FClipRegion write SetClipRegion;
property GCValues: TGdkGCValues read FGCValues;
property GDIObjects[ID: TGDIType]: PGdiObject read GetGDIObjects write SetGDIObjects; property GDIObjects[ID: TGDIType]: PGdiObject read GetGDIObjects write SetGDIObjects;
CurrentTextColor: TGDIColor; CurrentTextColor: TGDIColor;
CurrentBackColor: TGDIColor; CurrentBackColor: TGDIColor;

View File

@ -3941,8 +3941,8 @@ begin
BeginGDKErrorTrap; BeginGDKErrorTrap;
{$ENDIF} {$ENDIF}
If not DevCtx.IsNullBrush if not DevCtx.IsNullBrush then
then begin begin
DevCtx.SelectBrushProps; DevCtx.SelectBrushProps;
gdk_draw_arc(DevCtx.Drawable, DevCtx.GC, 1, gdk_draw_arc(DevCtx.Drawable, DevCtx.GC, 1,
Left+DCOrigin.X, Top+DCOrigin.Y, Width, Height, 0, 360 shl 6); Left+DCOrigin.X, Top+DCOrigin.Y, Width, Height, 0, 360 shl 6);
@ -3951,16 +3951,17 @@ begin
// Draw outline // Draw outline
DevCtx.SelectPenProps; DevCtx.SelectPenProps;
if (dcfPenSelected in DevCtx.Flags) if (dcfPenSelected in DevCtx.Flags) then
then begin begin
Result := True; Result := True;
if not DevCtx.IsNullPen if not DevCtx.IsNullPen then
then begin begin
gdk_draw_arc(DevCtx.Drawable, DevCtx.GC, 0, gdk_draw_arc(DevCtx.Drawable, DevCtx.GC, 0,
Left+DCOrigin.X, Top+DCOrigin.Y, Width, Height, 0, 360 shl 6); Left+DCOrigin.X, Top+DCOrigin.Y, Width, Height, 0, 360 shl 6);
end; end;
end end
else Result := False; else
Result := False;
{$IFDEF DebugGDKTraps} {$IFDEF DebugGDKTraps}
EndGDKErrorTrap; EndGDKErrorTrap;
@ -4304,13 +4305,15 @@ begin
exit; exit;
with TGtkDeviceContext(DC) do with TGtkDeviceContext(DC) do
begin begin
if not IsNullBrush then begin if not IsNullBrush then
begin
Width := Rect.Right - Rect.Left; Width := Rect.Right - Rect.Left;
Height := Rect.Bottom - Rect.Top; Height := Rect.Bottom - Rect.Top;
// Temporary hold the old brush to // Temporary hold the old brush to
// replace it with the given brush // replace it with the given brush
OldCurrentBrush := GetBrush; OldCurrentBrush := GetBrush;
if not CompareGDIBrushes(PGdiObject(Brush),OldCurrentBrush) then begin if not CompareGDIBrushes(PGdiObject(Brush),OldCurrentBrush) then
begin
BrushChanged:=true; BrushChanged:=true;
CurrentBrush := PGdiObject(Brush); CurrentBrush := PGdiObject(Brush);
SelectedColors:=dcscCustom; SelectedColors:=dcscCustom;
@ -4320,21 +4323,23 @@ begin
SelectBrushProps; SelectBrushProps;
DCOrigin := Offset; DCOrigin := Offset;
if (CurrentBrush^.GDIBrushFill = GDK_SOLID) if (CurrentBrush^.GDIBrushFill = GDK_SOLID) and
and (IsBackgroundColor(TColor(CurrentBrush^.GDIBrushColor.ColorRef))) (IsBackgroundColor(TColor(CurrentBrush^.GDIBrushColor.ColorRef))) then
then begin begin
StyleFillRectangle(Drawable, GC, StyleFillRectangle(Drawable, GC,
CurrentBrush^.GDIBrushColor.ColorRef, CurrentBrush^.GDIBrushColor.ColorRef,
Rect.Left+DCOrigin.X, Rect.Top+DCOrigin.Y, Rect.Left+DCOrigin.X, Rect.Top+DCOrigin.Y,
Width, Height) Width, Height)
end else begin end else
begin
gdk_draw_rectangle(Drawable, GC, 1, gdk_draw_rectangle(Drawable, GC, 1,
Rect.Left+DCOrigin.X, Rect.Top+DCOrigin.Y, Rect.Left+DCOrigin.X, Rect.Top+DCOrigin.Y,
Width, Height); Width, Height);
end; end;
// Restore current brush // Restore current brush
if BrushChanged then begin if BrushChanged then
begin
SelectedColors:=dcscCustom; SelectedColors:=dcscCustom;
CurrentBrush := OldCurrentBrush; CurrentBrush := OldCurrentBrush;
end; end;