mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 12:30:36 +02:00
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
git-svn-id: trunk@6608 -
This commit is contained in:
parent
ef95085574
commit
ab66df423f
@ -103,7 +103,7 @@ object CondForm: TCondForm
|
|||||||
Caption = '&Remove'
|
Caption = '&Remove'
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
OnClick = RemoveBtnClick
|
OnClick = RemoveBtnClick
|
||||||
Left = 133
|
Left = 134
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 64
|
Top = 64
|
||||||
Width = 82
|
Width = 82
|
||||||
@ -132,7 +132,7 @@ object CondForm: TCondForm
|
|||||||
Cancel = True
|
Cancel = True
|
||||||
Caption = 'Cancel'
|
Caption = 'Cancel'
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
Left = 136
|
Left = 134
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 125
|
Top = 125
|
||||||
Width = 82
|
Width = 82
|
||||||
|
@ -28,14 +28,14 @@ LazarusResources.Add('TCondForm','FORMDATA',[
|
|||||||
+'ck'#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2#6#5'Width'#2'R'#0#0#7'TBitBtn'#9
|
+'ck'#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2#6#5'Width'#2'R'#0#0#7'TBitBtn'#9
|
||||||
+'RemoveBtn'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'OnClick'#7#14'RemoveBtnCli'
|
+'RemoveBtn'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'OnClick'#7#14'RemoveBtnCli'
|
||||||
+'ck'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#7'&Remove'#8'TabOrder'
|
+'ck'#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#7'&Remove'#8'TabOrder'
|
||||||
+#2#5#7'OnClick'#7#14'RemoveBtnClick'#4'Left'#3#133#0#6'Height'#2#25#3'Top'#2
|
+#2#5#7'OnClick'#7#14'RemoveBtnClick'#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2
|
||||||
+'@'#5'Width'#2'R'#0#0#7'TBitBtn'#5'OkBtn'#7'Anchors'#11#5'akTop'#7'akRight'#0
|
+'@'#5'Width'#2'R'#0#0#7'TBitBtn'#5'OkBtn'#7'Anchors'#11#5'akTop'#7'akRight'#0
|
||||||
+#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#7'Anchors'#11#5'akTop'#7
|
+#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#7'Anchors'#11#5'akTop'#7
|
||||||
+'akRight'#0#7'Default'#9#11'ModalResult'#2#1#7'Caption'#6#3'&OK'#8'TabOrder'
|
+'akRight'#0#7'Default'#9#11'ModalResult'#2#1#7'Caption'#6#3'&OK'#8'TabOrder'
|
||||||
+#2#6#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2'_'#5'Width'#2'R'#0#0#7'TBitBtn'
|
+#2#6#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2'_'#5'Width'#2'R'#0#0#7'TBitBtn'
|
||||||
+#7'BitBtn1'#7'Anchors'#11#5'akTop'#7'akRight'#0#4'Kind'#7#8'bkCancel'#11'Mod'
|
+#7'BitBtn1'#7'Anchors'#11#5'akTop'#7'akRight'#0#4'Kind'#7#8'bkCancel'#11'Mod'
|
||||||
+'alResult'#2#2#7'Anchors'#11#5'akTop'#7'akRight'#0#11'ModalResult'#2#2#6'Can'
|
+'alResult'#2#2#7'Anchors'#11#5'akTop'#7'akRight'#0#11'ModalResult'#2#2#6'Can'
|
||||||
+'cel'#9#7'Caption'#6#6'Cancel'#8'TabOrder'#2#7#4'Left'#3#136#0#6'Height'#2#25
|
+'cel'#9#7'Caption'#6#6'Cancel'#8'TabOrder'#2#7#4'Left'#3#134#0#6'Height'#2#25
|
||||||
+#3'Top'#2'}'#5'Width'#2'R'#0#0#7'TButton'#10'AddInverse'#7'Anchors'#11#5'akT'
|
+#3'Top'#2'}'#5'Width'#2'R'#0#0#7'TButton'#10'AddInverse'#7'Anchors'#11#5'akT'
|
||||||
+'op'#7'akRight'#0#7'Caption'#6#11'Add Inverse'#8'TabOrder'#2#4#7'OnClick'#7
|
+'op'#7'akRight'#0#7'Caption'#6#11'Add Inverse'#8'TabOrder'#2#4#7'OnClick'#7
|
||||||
+#15'AddInverseCLICK'#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2'"'#5'Width'#2'R'
|
+#15'AddInverseCLICK'#4'Left'#3#134#0#6'Height'#2#25#3'Top'#2'"'#5'Width'#2'R'
|
||||||
|
@ -796,14 +796,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TFontPropertyEditor.GetAttributes: TPropertyAttributes;
|
function TFontPropertyEditor.GetAttributes: TPropertyAttributes;
|
||||||
var
|
|
||||||
APersistent: TPersistent;
|
|
||||||
begin
|
begin
|
||||||
Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
|
Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
|
||||||
APersistent:=GetComponent(0);
|
|
||||||
if (APersistent<>nil) and (APersistent is TControl)
|
|
||||||
and (not (APersistent is TStaticText)) then
|
|
||||||
Result:=Result+[paDisableSubProperties]-[paDialog];
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,11 +185,11 @@ type
|
|||||||
published
|
published
|
||||||
property Align;
|
property Align;
|
||||||
property Anchors;
|
property Anchors;
|
||||||
property AutoSize default True;
|
property AutoSize;
|
||||||
//property AutoScroll;
|
//property AutoScroll;
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
//property BiDiMode;
|
//property BiDiMode;
|
||||||
property BorderStyle default bsSingle;
|
property BorderStyle;
|
||||||
property ChildSizing;
|
property ChildSizing;
|
||||||
property Constraints;
|
property Constraints;
|
||||||
//property DockSite;
|
//property DockSite;
|
||||||
|
@ -41,7 +41,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
destructor TGraphicControl.Destroy;
|
destructor TGraphicControl.Destroy;
|
||||||
begin
|
begin
|
||||||
FCanvas.Free;
|
FreeAndNil(FCanvas);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -58,6 +58,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Canvas.Lock;
|
Canvas.Lock;
|
||||||
try
|
try
|
||||||
|
//debugln('TGraphicControl.WMPaint A ',DbgSName(Self));
|
||||||
Canvas.Handle := Message.DC;
|
Canvas.Handle := Message.DC;
|
||||||
try
|
try
|
||||||
Paint;
|
Paint;
|
||||||
@ -89,6 +90,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.10 2005/01/16 11:40:10 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.9 2004/04/10 17:58:57 mattias
|
Revision 1.9 2004/04/10 17:58:57 mattias
|
||||||
implemented mainunit hints for include files
|
implemented mainunit hints for include files
|
||||||
|
|
||||||
|
@ -105,6 +105,7 @@ var
|
|||||||
Clip: hRGN;
|
Clip: hRGN;
|
||||||
begin
|
begin
|
||||||
// If the interface has a better way to check a region it can override this
|
// If the interface has a better way to check a region it can override this
|
||||||
|
//debugln('TWidgetSet.DCClipRegionValid DC=',HexStr(Cardinal(DC),8));
|
||||||
Clip:=CreateEmptyRegion;
|
Clip:=CreateEmptyRegion;
|
||||||
Result:=GetClipRGN(DC,Clip)>=0;
|
Result:=GetClipRGN(DC,Clip)>=0;
|
||||||
DeleteObject(Clip);
|
DeleteObject(Clip);
|
||||||
@ -632,6 +633,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.32 2005/01/16 11:40:10 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.31 2004/10/23 14:47:44 micha
|
Revision 1.31 2004/10/23 14:47:44 micha
|
||||||
remove old code: statusbar methods in twidgetset
|
remove old code: statusbar methods in twidgetset
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ begin
|
|||||||
GetClipRGN(DC, OldC);
|
GetClipRGN(DC, OldC);
|
||||||
Clip := CreateEmptyRegion;
|
Clip := CreateEmptyRegion;
|
||||||
//DebugLn('TWidgetSet.ExtSelectClipRGN A OldC=',HexStr(Cardinal(OldC),8),
|
//DebugLn('TWidgetSet.ExtSelectClipRGN A OldC=',HexStr(Cardinal(OldC),8),
|
||||||
// ' Clip=',HexStr(Cardinal(Clip),8),' RGn=',HexStr(Cardinal(RGN),8),' Mode=',Mode);
|
// ' Clip=',HexStr(Cardinal(Clip),8),' RGn=',HexStr(Cardinal(RGN),8),' Mode=',dbgs(Mode));
|
||||||
Result := CombineRGN(Clip, OldC, RGN, Mode);
|
Result := CombineRGN(Clip, OldC, RGN, Mode);
|
||||||
//DebugLn('TWidgetSet.ExtSelectClipRGN B Result=',Result);
|
//DebugLn('TWidgetSet.ExtSelectClipRGN B Result=',Result);
|
||||||
If Result <> ERROR then
|
If Result <> ERROR then
|
||||||
@ -962,9 +962,10 @@ var
|
|||||||
RRGN : hRGN;
|
RRGN : hRGN;
|
||||||
begin
|
begin
|
||||||
RRGN := CreateRectRgn(Left, Top, Right, Bottom);
|
RRGN := CreateRectRgn(Left, Top, Right, Bottom);
|
||||||
//DebugLn('TWidgetSet.IntersectClipRect A RGN=',HexStr(Cardinal(RRGN),8),' ',Left,',',Top,',',Right,',',Bottom);
|
//DebugLn('TWidgetSet.IntersectClipRect A RGN=',HexStr(Cardinal(RRGN),8),
|
||||||
|
// ' ',dbgs(Left),',',dbgs(Top),',',dbgs(Right),',',dbgs(Bottom));
|
||||||
If not DCClipRegionValid(DC) then
|
If not DCClipRegionValid(DC) then
|
||||||
Result := ExtSelectClipRGN(DC, RRGN, RGN_COPY)
|
Result := SelectClipRGN(DC, RRGN)
|
||||||
else
|
else
|
||||||
Result := ExtSelectClipRGN(DC, RRGN, RGN_AND);
|
Result := ExtSelectClipRGN(DC, RRGN, RGN_AND);
|
||||||
DeleteObject(RRGN);
|
DeleteObject(RRGN);
|
||||||
@ -1414,6 +1415,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.17 2005/01/16 11:40:10 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.16 2005/01/08 11:03:18 mattias
|
Revision 1.16 2005/01/08 11:03:18 mattias
|
||||||
implemented TPen.Mode=pmXor from Jesus
|
implemented TPen.Mode=pmXor from Jesus
|
||||||
|
|
||||||
|
@ -26,13 +26,15 @@ end;
|
|||||||
procedure TPaintBox.Paint;
|
procedure TPaintBox.Paint;
|
||||||
begin
|
begin
|
||||||
if csDesigning in ComponentState then begin
|
if csDesigning in ComponentState then begin
|
||||||
Canvas.Font := Font;
|
|
||||||
Canvas.Brush.Color := Color;
|
Canvas.Brush.Color := Color;
|
||||||
with Canvas do
|
with Canvas do
|
||||||
begin
|
begin
|
||||||
Pen.Style := psDash;
|
Pen.Style := psDash;
|
||||||
|
Pen.Color:=clBlack;
|
||||||
Brush.Style := bsClear;
|
Brush.Style := bsClear;
|
||||||
Rectangle(0, 0, Width - 1, Height - 1);
|
Rectangle(0, 0, Width - 1, Height - 1);
|
||||||
|
Line(0,0,Width-1,Height-1);
|
||||||
|
Line(Width-1,0,0,Height-1);
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
@ -1631,8 +1631,9 @@ var
|
|||||||
DC: HDC;
|
DC: HDC;
|
||||||
PS: TPaintStruct; //defined in LCLIntf.pp
|
PS: TPaintStruct; //defined in LCLIntf.pp
|
||||||
ControlsNeedsClipping: boolean;
|
ControlsNeedsClipping: boolean;
|
||||||
|
CurControl: TControl;
|
||||||
begin
|
begin
|
||||||
//DebugLn('[TWinControl.PaintHandler] ',Name,':',ClassName,' DC=',HexStr(Message.DC,8));
|
//DebugLn('[TWinControl.PaintHandler] ',Name,':',ClassName,' DC=',HexStr(TheMessage.DC,8));
|
||||||
if (csDestroying in ComponentState) or (not HandleAllocated) then exit;
|
if (csDestroying in ComponentState) or (not HandleAllocated) then exit;
|
||||||
|
|
||||||
{$IFDEF VerboseDsgnPaintMsg}
|
{$IFDEF VerboseDsgnPaintMsg}
|
||||||
@ -1644,7 +1645,8 @@ begin
|
|||||||
DC := TheMessage.DC;
|
DC := TheMessage.DC;
|
||||||
if DC = 0 then DC := BeginPaint(Handle, PS);
|
if DC = 0 then DC := BeginPaint(Handle, PS);
|
||||||
try
|
try
|
||||||
// check if child controls needs clipping
|
// check if child controls need clipping
|
||||||
|
//DebugLn('[TWinControl.PaintHandler] ',DbgSName(Self),' B');
|
||||||
ControlsNeedsClipping:=false;
|
ControlsNeedsClipping:=false;
|
||||||
if FControls<>nil then
|
if FControls<>nil then
|
||||||
for I := 0 to FControls.Count - 1 do
|
for I := 0 to FControls.Count - 1 do
|
||||||
@ -1653,24 +1655,29 @@ begin
|
|||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
// exclude child controls and send new paint message
|
// exclude child controls and send new paint message
|
||||||
if not ControlsNeedsClipping then
|
if not ControlsNeedsClipping then begin
|
||||||
|
//DebugLn('[TWinControl.PaintHandler] ',DbgSName(Self),' no clipping ...');
|
||||||
PaintWindow(DC)
|
PaintWindow(DC)
|
||||||
else
|
end else
|
||||||
begin
|
begin
|
||||||
SaveIndex := SaveDC(DC);
|
SaveIndex := SaveDC(DC);
|
||||||
Clip := SimpleRegion;
|
Clip := SimpleRegion;
|
||||||
for I := 0 to FControls.Count - 1 do
|
for I := 0 to FControls.Count - 1 do begin
|
||||||
if ControlMustBeClipped(TControl(FControls[I])) then
|
CurControl:=TControl(FControls[I]);
|
||||||
with TControl(FControls[I]) do begin
|
if ControlMustBeClipped(CurControl) then
|
||||||
//DebugLn('TWinControl.PaintHandler Exclude Child ',Self.Name,':',Self.ClassName,' Control=',Name,':',ClassName);
|
with CurControl do begin
|
||||||
|
//DebugLn('TWinControl.PaintHandler Exclude Child ',DbgSName(Self),' Control=',DbgSName(CurControl),'(',dbgs(CurControl.BoundsRect),')');
|
||||||
Clip := ExcludeClipRect(DC, Left, Top, Left + Width, Top + Height);
|
Clip := ExcludeClipRect(DC, Left, Top, Left + Width, Top + Height);
|
||||||
if Clip = NullRegion then Break;
|
if Clip = NullRegion then Break;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
//DebugLn('[TWinControl.PaintHandler] ',DbgSName(Self),' with clipping ...');
|
||||||
if Clip <> NullRegion then
|
if Clip <> NullRegion then
|
||||||
PaintWindow(DC);
|
PaintWindow(DC);
|
||||||
RestoreDC(DC, SaveIndex);
|
RestoreDC(DC, SaveIndex);
|
||||||
end;
|
end;
|
||||||
// paint controls
|
// paint controls
|
||||||
|
//DebugLn('[TWinControl.PaintHandler] ',DbgSName(Self),' PaintControls ...');
|
||||||
PaintControls(DC, nil);
|
PaintControls(DC, nil);
|
||||||
finally
|
finally
|
||||||
if TheMessage.DC = 0 then EndPaint(Handle, PS);
|
if TheMessage.DC = 0 then EndPaint(Handle, PS);
|
||||||
@ -1683,7 +1690,10 @@ procedure TWinControl.PaintControls(DC: HDC; First: TControl);
|
|||||||
var
|
var
|
||||||
I, Count, SaveIndex: Integer;
|
I, Count, SaveIndex: Integer;
|
||||||
// FrameBrush: HBRUSH;
|
// FrameBrush: HBRUSH;
|
||||||
TempControl : TCOntrol;
|
TempControl : TControl;
|
||||||
|
{$IFDEF VerboseControlDCOrigin}
|
||||||
|
P: TPoint;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
//DebugLn('[TWinControl.PaintControls] ',Name,':',ClassName,' DC=',HexStr(DC,8));
|
//DebugLn('[TWinControl.PaintControls] ',Name,':',ClassName,' DC=',HexStr(DC,8));
|
||||||
if (csDestroying in ComponentState)
|
if (csDestroying in ComponentState)
|
||||||
@ -1710,7 +1720,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
TempControl := TControl(FControls.Items[I]);
|
TempControl := TControl(FControls.Items[I]);
|
||||||
//DebugLn('TWinControl.PaintControls B Self=',Self.Name,':',Self.ClassName,' Control=',TempControl.Name,':',TempControl.ClassName,' ',TempControl.Left,',',TempControl.Top,',',TempControl.Width,',',TempControl.Height);
|
//DebugLn('TWinControl.PaintControls B Self=',Self.Name,':',Self.ClassName,' Control=',TempControl.Name,':',TempControl.ClassName,' ',TempControl.Left,',',TempControl.Top,',',TempControl.Width,',',TempControl.Height);
|
||||||
with (TempControl) do
|
with TempControl do
|
||||||
if (Visible
|
if (Visible
|
||||||
or ((csDesigning in ComponentState)
|
or ((csDesigning in ComponentState)
|
||||||
and not (csNoDesignVisible in ControlStyle)))
|
and not (csNoDesignVisible in ControlStyle)))
|
||||||
@ -1720,8 +1730,16 @@ begin
|
|||||||
Include(FControlState, csPaintCopy);
|
Include(FControlState, csPaintCopy);
|
||||||
SaveIndex := SaveDC(DC);
|
SaveIndex := SaveDC(DC);
|
||||||
MoveWindowOrg(DC, Left, Top);
|
MoveWindowOrg(DC, Left, Top);
|
||||||
//DebugLn('TWinControl.PaintControls B Self=',Self.Name,':',Self.ClassName,' Control=',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height);
|
{$IFDEF VerboseControlDCOrigin}
|
||||||
|
DebugLn('TWinControl.PaintControls B Self=',DbgSName(Self),' Control=',DbgSName(TempControl),' ',dbgs(Left),',',dbgs(Top),',',dbgs(Width),',',dbgs(Height));
|
||||||
|
{$ENDIF}
|
||||||
IntersectClipRect(DC, 0, 0, Width, Height);
|
IntersectClipRect(DC, 0, 0, Width, Height);
|
||||||
|
{$IFDEF VerboseControlDCOrigin}
|
||||||
|
DebugLn('TWinControl.PaintControls C');
|
||||||
|
P:=Point(-1,-1);
|
||||||
|
GetWindowOrgEx(DC,@P);
|
||||||
|
debugln(' DCOrigin=',dbgs(P));
|
||||||
|
{$ENDIF}
|
||||||
Perform(LM_PAINT, WParam(DC), 0);
|
Perform(LM_PAINT, WParam(DC), 0);
|
||||||
RestoreDC(DC, SaveIndex);
|
RestoreDC(DC, SaveIndex);
|
||||||
Exclude(FControlState, csPaintCopy);
|
Exclude(FControlState, csPaintCopy);
|
||||||
@ -4281,6 +4299,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.298 2005/01/16 11:40:10 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.297 2005/01/13 19:52:50 mattias
|
Revision 1.297 2005/01/13 19:52:50 mattias
|
||||||
added desgntime check for TControl.Width/Height for negative values
|
added desgntime check for TControl.Width/Height for negative values
|
||||||
|
|
||||||
|
@ -1470,7 +1470,9 @@ var
|
|||||||
aRect : TGDKRectangle;
|
aRect : TGDKRectangle;
|
||||||
SimpleRGN: PGdkRegion;
|
SimpleRGN: PGdkRegion;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF DebugGDK}
|
||||||
BeginGDKErrorTrap;
|
BeginGDKErrorTrap;
|
||||||
|
{$ENDIF}
|
||||||
If RGN = nil then
|
If RGN = nil then
|
||||||
Result := ERROR
|
Result := ERROR
|
||||||
else
|
else
|
||||||
@ -1485,7 +1487,9 @@ begin
|
|||||||
Result := COMPLEXREGION;
|
Result := COMPLEXREGION;
|
||||||
gdk_region_destroy(SimpleRGN);
|
gdk_region_destroy(SimpleRGN);
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF DebugGDK}
|
||||||
EndGDKErrorTrap;
|
EndGDKErrorTrap;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -1501,7 +1505,9 @@ var
|
|||||||
begin
|
begin
|
||||||
with TDeviceContext(DC) do
|
with TDeviceContext(DC) do
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF DebugGDK}
|
||||||
BeginGDKErrorTrap;
|
BeginGDKErrorTrap;
|
||||||
|
{$ENDIF}
|
||||||
gdk_gc_set_clip_region(gc, nil);
|
gdk_gc_set_clip_region(gc, nil);
|
||||||
gdk_gc_set_clip_rectangle (gc, nil);
|
gdk_gc_set_clip_rectangle (gc, nil);
|
||||||
If (ClipRegion <> 0) then begin
|
If (ClipRegion <> 0) then begin
|
||||||
@ -1511,7 +1517,9 @@ begin
|
|||||||
gdk_gc_set_clip_region(gc, PGDIObject(ClipRegion)^.GDIRegionObject);
|
gdk_gc_set_clip_region(gc, PGDIObject(ClipRegion)^.GDIRegionObject);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF DebugGDK}
|
||||||
EndGDKErrorTrap;
|
EndGDKErrorTrap;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1523,8 +1531,8 @@ begin
|
|||||||
BeginGDKErrorTrap;
|
BeginGDKErrorTrap;
|
||||||
gdk_region_get_clipbox(RGN,@aRect);
|
gdk_region_get_clipbox(RGN,@aRect);
|
||||||
EndGDKErrorTrap;
|
EndGDKErrorTrap;
|
||||||
Result:=Result+'('+IntToStr(aRect.x)+','+IntToStr(aRect.y)+','
|
Result:=Result+'(x='+IntToStr(Integer(aRect.x))+',y='+IntToStr(Integer(aRect.y))+',w='
|
||||||
+IntToStr(aRect.Width)+','+IntToStr(aRect.Height)+' '
|
+IntToStr(aRect.Width)+',h='+IntToStr(aRect.Height)+' '
|
||||||
+'Type='+IntToStr(RegionType(RGN))+')';
|
+'Type='+IntToStr(RegionType(RGN))+')';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1536,9 +1544,13 @@ begin
|
|||||||
GDkRect.y:=ARect.Top;
|
GDkRect.y:=ARect.Top;
|
||||||
GDkRect.Width:=ARect.Right-ARect.Left;
|
GDkRect.Width:=ARect.Right-ARect.Left;
|
||||||
GDkRect.Height:=ARect.Bottom-ARect.Top;
|
GDkRect.Height:=ARect.Bottom-ARect.Top;
|
||||||
|
{$IFDEF DebugGDK}
|
||||||
BeginGDKErrorTrap;
|
BeginGDKErrorTrap;
|
||||||
|
{$ENDIF}
|
||||||
Result:=gdk_region_rectangle(@GDKRect);
|
Result:=gdk_region_rectangle(@GDKRect);
|
||||||
|
{$IFDEF DebugGDK}
|
||||||
EndGDKErrorTrap;
|
EndGDKErrorTrap;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure FreeGDIColor(GDIColor: PGDIColor);
|
Procedure FreeGDIColor(GDIColor: PGDIColor);
|
||||||
@ -7900,6 +7912,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.328 2005/01/16 11:40:10 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.327 2005/01/11 21:40:29 micha
|
Revision 1.327 2005/01/11 21:40:29 micha
|
||||||
fix gtk compilation for tstatictext.layout
|
fix gtk compilation for tstatictext.layout
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
gdk_visual_ref(GdiObject^.Visual);
|
gdk_visual_ref(GdiObject^.Visual);
|
||||||
GdiObject^.SystemVisual := False;
|
GdiObject^.SystemVisual := False;
|
||||||
|
|
||||||
// the visual is created only when needed
|
// the visual is created only when needed
|
||||||
{If GdiObject^.Visual <> nil then
|
{If GdiObject^.Visual <> nil then
|
||||||
gdk_visual_ref(GdiObject^.Visual)
|
gdk_visual_ref(GdiObject^.Visual)
|
||||||
@ -3104,19 +3104,7 @@ end;
|
|||||||
function TGtkWidgetSet.ExcludeClipRect(dc: hdc;
|
function TGtkWidgetSet.ExcludeClipRect(dc: hdc;
|
||||||
Left, Top, Right, Bottom : Integer) : Integer;
|
Left, Top, Right, Bottom : Integer) : Integer;
|
||||||
begin
|
begin
|
||||||
Result := SIMPLEREGION;
|
Result := Inherited ExcludeClipRect(DC, Left, Top, Right, Bottom);
|
||||||
If (not IsValidDC(DC)) then
|
|
||||||
Result := ERROR
|
|
||||||
else with TDeviceContext(DC) do
|
|
||||||
begin
|
|
||||||
if GC = nil
|
|
||||||
then begin
|
|
||||||
DebugLn('WARNING: [TGtkWidgetSet.ExcludeClipRect] Uninitialized GC');
|
|
||||||
Result := ERROR;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result := Inherited ExcludeClipRect(DC, Left, Top, Right, Bottom);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3153,6 +3141,7 @@ var
|
|||||||
Clip,
|
Clip,
|
||||||
Tmp : hRGN;
|
Tmp : hRGN;
|
||||||
X, Y : Longint;
|
X, Y : Longint;
|
||||||
|
DCOrigin: TPoint;
|
||||||
begin
|
begin
|
||||||
Result := SIMPLEREGION;
|
Result := SIMPLEREGION;
|
||||||
If not IsValidDC(DC) then
|
If not IsValidDC(DC) then
|
||||||
@ -3165,8 +3154,8 @@ begin
|
|||||||
Result := ERROR;
|
Result := ERROR;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
//DebugLn('TGtkWidgetSet.ExtSelectClipRGN A ClipRegValid=',DCClipRegionValid(DC),
|
//DebugLn('TGtkWidgetSet.ExtSelectClipRGN A ClipRegValid=',dbgs(DCClipRegionValid(DC)),
|
||||||
// ' Mode=',Mode,' RGN=',GDKRegionAsString(PGdiObject(RGN)^.GDIRegionObject));
|
// ' Mode=',dbgs(Mode),' RGN=',GDKRegionAsString(PGdiObject(RGN)^.GDIRegionObject));
|
||||||
If ClipRegion=0 then begin
|
If ClipRegion=0 then begin
|
||||||
// there is no clipping region in the DC
|
// there is no clipping region in the DC
|
||||||
Case Mode of
|
Case Mode of
|
||||||
@ -3181,18 +3170,19 @@ begin
|
|||||||
RGN_AND,
|
RGN_AND,
|
||||||
RGN_DIFF:
|
RGN_DIFF:
|
||||||
begin
|
begin
|
||||||
{$IFDEF DebugGDKTraps}
|
// get existing clip
|
||||||
BeginGDKErrorTrap;
|
|
||||||
{$ENDIF}
|
|
||||||
GDK_Window_Get_Size(Drawable, @X, @Y);
|
GDK_Window_Get_Size(Drawable, @X, @Y);
|
||||||
{$IFDEF DebugGDKTraps}
|
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
||||||
EndGDKErrorTrap;
|
Clip := CreateRectRGN(-DCOrigin.X,-DCOrigin.Y,X-DCOrigin.X,Y-DCOrigin.Y);
|
||||||
{$ENDIF}
|
// create target clip
|
||||||
Clip := CreateRectRGN(0,0,X,Y);
|
|
||||||
Tmp := CreateEmptyRegion;
|
Tmp := CreateEmptyRegion;
|
||||||
Result := CombineRGN(Tmp, Clip, RGN, mode);
|
// combine
|
||||||
DeleteObject(Clip);
|
Result := CombineRGN(Tmp, Clip, RGN, Mode);
|
||||||
|
// commit
|
||||||
|
//DebugLn('TGtkWidgetSet.ExtSelectClipRGN B ClipRegValid=',dbgs(ClipRegion),' TmpRGN=',GDKRegionAsString(PGdiObject(Tmp)^.GDIRegionObject));
|
||||||
SelectClipRGN(DC, Tmp);
|
SelectClipRGN(DC, Tmp);
|
||||||
|
// clean up
|
||||||
|
DeleteObject(Clip);
|
||||||
DeleteObject(Tmp);
|
DeleteObject(Tmp);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4075,26 +4065,11 @@ end;
|
|||||||
-1 = error
|
-1 = error
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Function TGtkWidgetSet.GetClipRGN(DC : hDC; RGN : hRGN) : longint;
|
Function TGtkWidgetSet.GetClipRGN(DC : hDC; RGN : hRGN) : longint;
|
||||||
|
|
||||||
function GetDefaultClipRgn: longint;
|
|
||||||
var
|
|
||||||
ARect: TRect;
|
|
||||||
GdiObject: PGDIObject;
|
|
||||||
begin
|
|
||||||
Result:=SimpleRegion;
|
|
||||||
GetClipBox(DC,@ARect);
|
|
||||||
GdiObject:=PGdiObject(RGN);
|
|
||||||
if GdiObject^.GDIRegionObject<>nil then
|
|
||||||
gdk_region_destroy(GdiObject^.GDIRegionObject);
|
|
||||||
GdiObject^.GDIRegionObject:=CreateRectGDKRegion(ARect);
|
|
||||||
//DebugLn('TGtkWidgetSet.GetClipRGN A DC=',HexStr(Cardinal(DC),8),
|
|
||||||
// ' RGN=',GDKRegionAsString(PGdiObject(RGN)^.GDIRegionObject),
|
|
||||||
// ' Result=',Result);
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
DCOrigin: TPoint;
|
DCOrigin: TPoint;
|
||||||
ClipRegionWithDCOffset: PGdkRegion;
|
ClipRegionWithDCOffset: PGdkRegion;
|
||||||
|
CurRegionObject: PGdkRegion;
|
||||||
|
ARect: TRect;
|
||||||
begin
|
begin
|
||||||
Result := SIMPLEREGION;
|
Result := SIMPLEREGION;
|
||||||
If (not IsValidDC(DC)) then
|
If (not IsValidDC(DC)) then
|
||||||
@ -4103,19 +4078,29 @@ begin
|
|||||||
Result := ERROR;
|
Result := ERROR;
|
||||||
DebugLn('WARNING: [TGtkWidgetSet.GetClipRGN] Invalid HRGN');
|
DebugLn('WARNING: [TGtkWidgetSet.GetClipRGN] Invalid HRGN');
|
||||||
end
|
end
|
||||||
else if TDeviceContext(DC).ClipRegion=0 then
|
else if (TDeviceContext(DC).ClipRegion<>0)
|
||||||
Result:=GetDefaultClipRgn
|
and (not IsValidGDIObject(TDeviceContext(DC).ClipRegion)) then
|
||||||
else if (not IsValidGDIObject(TDeviceContext(DC).ClipRegion)) then
|
|
||||||
Result := ERROR
|
Result := ERROR
|
||||||
else with TDeviceContext(DC) do
|
else with TDeviceContext(DC) do
|
||||||
begin
|
begin
|
||||||
// create a copy of the current clipregion
|
CurRegionObject:=nil;
|
||||||
ClipRegionWithDCOffset:= gdk_region_copy(PGdiObject(ClipRegion)^.GDIRegionObject);
|
if ClipRegion<>0 then
|
||||||
// move it to the DC offset
|
CurRegionObject:=PGdiObject(ClipRegion)^.GDIRegionObject;
|
||||||
// Example: if the ClipRegion is at 10,10 and the DCOrigin is at 10,10,
|
ARect:=Rect(0,0,0,0);
|
||||||
// then the ClipRegion must be moved to 0,0
|
if CurRegionObject<>nil then begin
|
||||||
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
// create a copy of the current clipregion
|
||||||
gdk_region_offset(ClipRegionWithDCOffset,-DCOrigin.x,-DCOrigin.Y);
|
ClipRegionWithDCOffset:=gdk_region_copy(CurRegionObject);
|
||||||
|
// move it to the DC offset
|
||||||
|
// Example: if the ClipRegion is at 10,10 and the DCOrigin is at 10,10,
|
||||||
|
// then the ClipRegion must be moved to 0,0
|
||||||
|
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
||||||
|
//debugln('TGtkWidgetSet.GetClipRGN DCOrigin=',dbgs(DCOrigin),' CurRegionObject=',dbgs(CurRegionObject),' ',dbgs(ARect));
|
||||||
|
gdk_region_offset(ClipRegionWithDCOffset,-DCOrigin.x,-DCOrigin.Y);
|
||||||
|
end else begin
|
||||||
|
// create a default clipregion
|
||||||
|
GetClipBox(DC,@ARect);
|
||||||
|
ClipRegionWithDCOffset:=CreateRectGDKRegion(ARect);
|
||||||
|
end;
|
||||||
// free the old region in RGN
|
// free the old region in RGN
|
||||||
if PGdiObject(RGN)^.GDIRegionObject<>nil then
|
if PGdiObject(RGN)^.GDIRegionObject<>nil then
|
||||||
gdk_region_destroy(PGdiObject(RGN)^.GDIRegionObject);
|
gdk_region_destroy(PGdiObject(RGN)^.GDIRegionObject);
|
||||||
@ -4124,7 +4109,7 @@ begin
|
|||||||
|
|
||||||
Result := RegionType(ClipRegionWithDCOffset);
|
Result := RegionType(ClipRegionWithDCOffset);
|
||||||
//DebugLn('TGtkWidgetSet.GetClipRGN B DC=',HexStr(Cardinal(DC),8),
|
//DebugLn('TGtkWidgetSet.GetClipRGN B DC=',HexStr(Cardinal(DC),8),
|
||||||
// ' DCOrigin=',DCOrigin.X,',',DCOrigin.Y,' RGN=',GDKRegionAsString(ClipRegionWithDCOffset),' Result=',Result);
|
// ' DCOrigin=',dbgs(DCOrigin),' RGN=',GDKRegionAsString(ClipRegionWithDCOffset),' Result=',dbgs(Result));
|
||||||
If Result = NULLREGION then
|
If Result = NULLREGION then
|
||||||
Result := 0
|
Result := 0
|
||||||
else If Result <> ERROR then
|
else If Result <> ERROR then
|
||||||
@ -5883,20 +5868,7 @@ end;
|
|||||||
function TGtkWidgetSet.IntersectClipRect(dc: hdc;
|
function TGtkWidgetSet.IntersectClipRect(dc: hdc;
|
||||||
Left, Top, Right, Bottom: Integer): Integer;
|
Left, Top, Right, Bottom: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
Result := SIMPLEREGION;
|
Result := Inherited IntersectClipRect(DC, Left, Top, Right, Bottom);
|
||||||
If not IsValidDC(DC) then
|
|
||||||
Result := ERROR
|
|
||||||
else with TDeviceContext(DC) do
|
|
||||||
begin
|
|
||||||
if GC = nil
|
|
||||||
then begin
|
|
||||||
DebugLn('WARNING: [TGtkWidgetSet.IntersectClipRect] Uninitialized GC');
|
|
||||||
Result := ERROR;
|
|
||||||
end
|
|
||||||
else begin
|
|
||||||
Result := Inherited IntersectClipRect(DC, Left, Top, Right, Bottom);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -7247,10 +7219,12 @@ var
|
|||||||
RegObj: PGdkRegion;
|
RegObj: PGdkRegion;
|
||||||
DCOrigin: TPoint;
|
DCOrigin: TPoint;
|
||||||
begin
|
begin
|
||||||
|
If not IsValidDC(DC) then begin
|
||||||
|
Result := ERROR;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
Result := SIMPLEREGION;
|
Result := SIMPLEREGION;
|
||||||
If not IsValidDC(DC) then
|
with TDeviceContext(DC) do
|
||||||
Result := ERROR
|
|
||||||
else with TDeviceContext(DC) do
|
|
||||||
begin
|
begin
|
||||||
if (GC = nil) and (RGN <> 0)
|
if (GC = nil) and (RGN <> 0)
|
||||||
then begin
|
then begin
|
||||||
@ -7273,9 +7247,10 @@ begin
|
|||||||
ClipRegion := CreateRegionCopy(RGN);
|
ClipRegion := CreateRegionCopy(RGN);
|
||||||
RegObj:=PGdiObject(ClipRegion)^.GDIRegionObject;
|
RegObj:=PGdiObject(ClipRegion)^.GDIRegionObject;
|
||||||
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
||||||
|
//DebugLn('TGtkWidgetSet.SelectClipRGN A RegObj=',GDKRegionAsString(RegObj),' DCOrigin=',dbgs(DCOrigin),' RGN=',GDKRegionAsString(PGdiObject(RGN)^.GDIRegionObject));
|
||||||
gdk_region_offset(RegObj,DCOrigin.x,DCOrigin.Y);
|
gdk_region_offset(RegObj,DCOrigin.x,DCOrigin.Y);
|
||||||
Result := RegionType(RegObj);
|
Result := RegionType(RegObj);
|
||||||
//DebugLn('TGtkWidgetSet.SelectClipRGN RGN=',GDKRegionAsString(RegObj),' DCOrigin=',DCOrigin.X,',',DCOrigin.Y);
|
//DebugLn('TGtkWidgetSet.SelectClipRGN B RegObj=',GDKRegionAsString(RegObj),' DCOrigin=',dbgs(DCOrigin));
|
||||||
SelectGDIRegion(DC);
|
SelectGDIRegion(DC);
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
@ -8865,6 +8840,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.385 2005/01/16 11:40:11 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.384 2005/01/08 11:03:18 mattias
|
Revision 1.384 2005/01/08 11:03:18 mattias
|
||||||
implemented TPen.Mode=pmXor from Jesus
|
implemented TPen.Mode=pmXor from Jesus
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ function CreatePixmapIndirect(const Data: Pointer; const TransColor: Longint): H
|
|||||||
Function CreatePolygonRgn(Points: PPoint; NumPts: Integer; FillMode: integer): HRGN; Override;
|
Function CreatePolygonRgn(Points: PPoint; NumPts: Integer; FillMode: integer): HRGN; Override;
|
||||||
function CreateRectRgn(X1,Y1,X2,Y2 : Integer): HRGN; override;
|
function CreateRectRgn(X1,Y1,X2,Y2 : Integer): HRGN; override;
|
||||||
|
|
||||||
Procedure DeleteCriticalSection(var CritSection: TCriticalSection); Override;
|
procedure DeleteCriticalSection(var CritSection: TCriticalSection); override;
|
||||||
function DeleteDC(hDC: HDC): Boolean; override;
|
function DeleteDC(hDC: HDC): Boolean; override;
|
||||||
function DeleteObject(GDIObject: HGDIOBJ): Boolean; override;
|
function DeleteObject(GDIObject: HGDIOBJ): Boolean; override;
|
||||||
function DestroyCaret(Handle : HWND): Boolean; override;
|
function DestroyCaret(Handle : HWND): Boolean; override;
|
||||||
@ -214,6 +214,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.92 2005/01/16 11:40:11 mattias
|
||||||
|
fixed TGtkWidgetSet.ExtSelectClipRGN for DCOrigin
|
||||||
|
|
||||||
Revision 1.91 2005/01/08 11:03:18 mattias
|
Revision 1.91 2005/01/08 11:03:18 mattias
|
||||||
implemented TPen.Mode=pmXor from Jesus
|
implemented TPen.Mode=pmXor from Jesus
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user