mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 07:59:35 +02:00
customdrawn-android: Renames VerboseWinAPI to VerboseCDWinAPI and starts implementing invalidaterect
git-svn-id: trunk@33831 -
This commit is contained in:
parent
8fc57de450
commit
f76122ed92
@ -693,11 +693,11 @@ begin
|
||||
struct.hdc := HDC(TCocoaCustomControl(Owner).Canvas);
|
||||
|
||||
// Send the paint message to the LCL
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWinAPI}
|
||||
DebugLn(Format('[TLCLCommonCallback.Draw] OnPaint event started context: %x', [struct.hdc]));
|
||||
{$ENDIF}
|
||||
LCLSendPaintMsg(Target, struct.hdc, @struct);
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWinAPI}
|
||||
DebugLn('[TLCLCommonCallback.Draw] OnPaint event ended');
|
||||
{$ENDIF}
|
||||
|
||||
|
@ -208,6 +208,7 @@ var
|
||||
curJavaClass: JClass = nil;
|
||||
curJavaObject: jobject = nil;
|
||||
nativeCodeLoaded:JfieldID=nil;
|
||||
eventResult: Integer = 0;
|
||||
{$endif}
|
||||
|
||||
implementation
|
||||
|
@ -15,6 +15,11 @@
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
|
||||
procedure TCDWidgetSet.AccumulatingDebugOut(AStr: string);
|
||||
begin
|
||||
AccumulatedStr := AccumulatedStr + AStr;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TQtWidgetSet.Create
|
||||
Params: None
|
||||
@ -29,10 +34,6 @@ begin
|
||||
CDWidgetSet := Self;
|
||||
FTerminating := False;
|
||||
|
||||
// Setup DebugLn
|
||||
DebugLnProc := @AndroidDebugLn;
|
||||
DebugOutProc := @AccumulatingDebugOut;
|
||||
|
||||
BackendCreate;
|
||||
end;
|
||||
|
||||
|
@ -37,7 +37,7 @@ var
|
||||
lCurForm: TCDNonNativeForm;
|
||||
lTarget: TWinControl;
|
||||
begin
|
||||
Result := 0;
|
||||
eventResult := 0;
|
||||
|
||||
__android_log_write(ANDROID_LOG_INFO,'nativetest','LCLOnTouch called');
|
||||
{ curJavaClass := env^^.GetObjectClass(env, this);
|
||||
@ -56,6 +56,8 @@ begin
|
||||
LCLSendClickedMsg(lTarget);
|
||||
end;
|
||||
end;
|
||||
|
||||
Result := eventResult;
|
||||
end;
|
||||
|
||||
function Java_com_pascal_lclproject_LCLActivity_LCLDrawToBitmap(
|
||||
@ -164,11 +166,6 @@ begin
|
||||
AccumulatedStr := '';
|
||||
end;
|
||||
|
||||
procedure TCDWidgetSet.AccumulatingDebugOut(AStr: string);
|
||||
begin
|
||||
AccumulatedStr := AccumulatedStr + AStr;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCDWidgetSet.Create
|
||||
Params: None
|
||||
@ -178,7 +175,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCDWidgetSet.BackendCreate;
|
||||
begin
|
||||
|
||||
// Setup DebugLn
|
||||
DebugLnProc := @AndroidDebugLn;
|
||||
DebugOutProc := @AccumulatingDebugOut;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -78,7 +78,7 @@ function GetCurrentForm(): TCDNonNativeForm;
|
||||
var
|
||||
lCount: Integer;
|
||||
begin
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWindow}
|
||||
DebugLn('GetCurrentForm');
|
||||
{$ENDIF}
|
||||
InitNonNativeForms();
|
||||
@ -91,7 +91,7 @@ function AddNewForm(AForm: TCustomForm): TCDNonNativeForm;
|
||||
var
|
||||
lFormInfo: TCDNonNativeForm;
|
||||
begin
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWindow}
|
||||
DebugLn('AddNewForm');
|
||||
{$ENDIF}
|
||||
InitNonNativeForms();
|
||||
@ -109,7 +109,7 @@ begin
|
||||
InitNonNativeForms();
|
||||
lCount := NonNativeForms.Count;
|
||||
lCurIndex := NonNativeForms.IndexOf(ACDForm);
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWindow}
|
||||
DebugLn(Format('ShowForm lOldIndex=%d lNewIndex=%d', [lCurIndex, lCount-1]));
|
||||
{$ENDIF}
|
||||
NonNativeForms.Move(lCurIndex, lCount-1);
|
||||
@ -122,7 +122,7 @@ begin
|
||||
InitNonNativeForms();
|
||||
lCount := NonNativeForms.Count;
|
||||
lCurIndex := NonNativeForms.IndexOf(ACDForm);
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWindow}
|
||||
DebugLn(Format('HideForm lOldIndex=%d lNewIndex=0', [lCurIndex]));
|
||||
{$ENDIF}
|
||||
NonNativeForms.Move(lCurIndex, 0);
|
||||
@ -135,7 +135,7 @@ var
|
||||
lRawImage: TRawImage;
|
||||
lPixelSize: Byte;
|
||||
begin
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWindow}
|
||||
DebugLn(Format(':>[UpdateControlLazImageAndCanvas] Input Image: %x Canvas: %x',
|
||||
[PtrInt(AImage), PtrInt(ACanvas)]));
|
||||
{$ENDIF}
|
||||
@ -178,7 +178,7 @@ begin
|
||||
if (ACanvas <> nil) then ACanvas.Free;
|
||||
ACanvas := TLazCanvas.Create(AImage);
|
||||
end;
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWindow}
|
||||
DebugLn(Format(':<[UpdateControlLazImageAndCanvas] Output Image: %x Canvas: %x',
|
||||
[PtrInt(AImage), PtrInt(ACanvas)]));
|
||||
{$ENDIF}
|
||||
|
@ -34,7 +34,7 @@ function TCDWidgetSet.Arc(DC: HDC; Left,Top,Right,Bottom,angle1,angle2 : Integer
|
||||
var
|
||||
LazDC: TLazCanvas absolute DC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[WinAPI Polygon] DC=%s', [dbghex(DC)]));
|
||||
{$endif}
|
||||
|
||||
@ -69,7 +69,7 @@ end;*)
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.BeginPaint(Handle: hWnd; Var PS : TPaintStruct): hdc;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:> [WinAPI BeginPaint] Handle=', dbghex(Handle));
|
||||
{$endif}
|
||||
Result := 0;
|
||||
@ -394,7 +394,7 @@ function TCDWidgetSet.CreateBrushIndirect(const LogBrush: TLogBrush): HBRUSH;
|
||||
var
|
||||
lBrush: TFPCustomBrush;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[TCDWidgetSet.CreateBrushIndirect] Style: %d, Color: %8x',
|
||||
[LogBrush.lbStyle, LogBrush.lbColor]));
|
||||
{$endif}
|
||||
@ -468,7 +468,7 @@ begin
|
||||
DebugLn('TQtWidgetSet.CreateBrushIndirect: Failed');
|
||||
end;*)
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[WinAPI CreateBrushIndirect] Result: ', dbghex(Result));
|
||||
{$endif}
|
||||
end;
|
||||
@ -488,7 +488,7 @@ end;*)
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.CreateCompatibleDC(DC: HDC): HDC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI CreateCompatibleDC] DC: ', dbghex(DC));
|
||||
{$endif}
|
||||
Result := 0;//HDC(TQtDeviceContext.Create(nil, True));
|
||||
@ -666,7 +666,7 @@ function TCDWidgetSet.CreatePenIndirect(const LogPen: TLogPen): HPEN;
|
||||
var
|
||||
lPen: TFPCustomPen;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[TCDWidgetSet.CreatePenIndirect] Style: %d, Color: %8x',
|
||||
[LogPen.lopnStyle, LogPen.lopnColor]));
|
||||
{$endif}
|
||||
@ -791,11 +791,11 @@ var
|
||||
aObject: TObject;
|
||||
// APaintEngine: QPaintEngineH;
|
||||
// APainter: QPainterH;
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
ObjType: string;
|
||||
{$endif}
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:> [WinAPI DeleteObject] GDIObject: ', dbghex(GDIObject));
|
||||
ObjType := 'Unidentifyed';
|
||||
{$endif}
|
||||
@ -816,7 +816,7 @@ begin
|
||||
------------------------------------------------------------------------------}
|
||||
if aObject is TFPCustomFont then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
ObjType := 'Font';
|
||||
{$endif}
|
||||
end
|
||||
@ -825,7 +825,7 @@ begin
|
||||
------------------------------------------------------------------------------}
|
||||
else if aObject is TFPCustomBrush then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
ObjType := 'Brush';
|
||||
{$endif}
|
||||
end
|
||||
@ -884,7 +884,7 @@ begin
|
||||
|
||||
Result := True;
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:< [WinAPI DeleteObject] Result=', dbgs(Result), ' ObjectType=', ObjType);
|
||||
{$endif}
|
||||
end;
|
||||
@ -1487,13 +1487,13 @@ var
|
||||
LazDC: TLazCanvas absolute DC;
|
||||
R: TRect;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[WinAPI Ellipse] DC=%s', [dbghex(DC)]));
|
||||
{$endif}
|
||||
|
||||
if not IsValidDC(DC) then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[WinAPI Rectangle] Invalid DC!');
|
||||
{$endif}
|
||||
Exit(False);
|
||||
@ -2239,7 +2239,7 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('[WinAPI FillRect Rect=', dbgs(Rect),' Brush=', dbghex(Brush));
|
||||
{$endif}
|
||||
|
||||
@ -2509,7 +2509,7 @@ begin
|
||||
// ToDO check if the window is native or not and process accordingly
|
||||
// For now just assume it is native
|
||||
Result := BackendGetClientBounds(Handle, ARect);
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format('[WinAPI GetClientBounds] ARect.Left=%d ARect.Top=%d'
|
||||
+ ' ARect.Right=%d ARect.Bottom=%d',
|
||||
[ARect.Left, ARect.Top, ARect.Right, ARect.Bottom]));
|
||||
@ -2529,7 +2529,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.GetClientRect(handle : HWND; var ARect : TRect) : Boolean;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('[WinAPI GetClientRect]');
|
||||
{$endif}
|
||||
GetClientBounds(Handle, ARect);
|
||||
@ -4732,7 +4732,7 @@ var
|
||||
PenPos, LastPos: TPoint;
|
||||
LazDC: TLazCanvas absolute DC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('[TCDWidgetSet.LineTo]');
|
||||
{$endif}
|
||||
|
||||
@ -4804,7 +4804,7 @@ function TCDWidgetSet.MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolea
|
||||
var
|
||||
LazDC: TLazCanvas absolute DC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('[WinAPI MoveToEx]',
|
||||
' DC:', dbghex(DC),
|
||||
' X:', dbgs(X),
|
||||
@ -4863,7 +4863,7 @@ end;*)
|
||||
function TCDWidgetSet.PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer;
|
||||
Filled, Continuous: Boolean): Boolean;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI PolyBezier] DC: ', dbghex(DC));
|
||||
{$endif}
|
||||
Result := inherited PolyBezier(DC, Points, NumPts, Filled, Continuous);
|
||||
@ -4881,7 +4881,7 @@ var
|
||||
lPoints: array of TPoint;
|
||||
i: Integer;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[WinAPI Polygon] DC=%s', [dbghex(DC)]));
|
||||
{$endif}
|
||||
|
||||
@ -4906,7 +4906,7 @@ var
|
||||
lPoints: array of TPoint;
|
||||
i: Integer;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[WinAPI Polygon] DC=%s', [dbghex(DC)]));
|
||||
{$endif}
|
||||
|
||||
@ -4956,13 +4956,13 @@ function TCDWidgetSet.Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Boolean;
|
||||
var
|
||||
LazDC: TLazCanvas absolute DC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[WinAPI Rectangle] DC=%s', [dbghex(DC)]));
|
||||
{$endif}
|
||||
|
||||
if not IsValidDC(DC) then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[WinAPI Rectangle] Invalid DC!');
|
||||
{$endif}
|
||||
Exit(False);
|
||||
@ -5301,11 +5301,11 @@ var
|
||||
lPen: TFPCustomPen absolute AObject;
|
||||
lBrush: TFPCustomBrush absolute AObject;
|
||||
lOrigBrush: TFPCustomBrush;
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
ObjType: string;
|
||||
{$endif}
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[TCDWidgetSet.SelectObject] DC=%s GDIObj=%s',
|
||||
[dbghex(DC), dbghex(GDIObj)]));
|
||||
{$endif}
|
||||
@ -5314,7 +5314,7 @@ begin
|
||||
|
||||
if not IsValidDC(DC) then
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[TCDWidgetSet.SelectObject] Invalid DC');
|
||||
{$endif}
|
||||
|
||||
@ -5344,7 +5344,7 @@ begin
|
||||
end
|
||||
else*) if aObject is TFPCustomPen then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}ObjType := 'Pen';{$endif}
|
||||
{$ifdef VerboseCDWinAPI}ObjType := 'Pen';{$endif}
|
||||
|
||||
Result := HGDIOBJ(TLazCanvas(DC).AssignedPen);
|
||||
TLazCanvas(DC).AssignPenData(lPen); // := doesn't work
|
||||
@ -5352,7 +5352,7 @@ begin
|
||||
end
|
||||
else if aObject is TFPCustomBrush then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}ObjType := 'Brush';{$endif}
|
||||
{$ifdef VerboseCDWinAPI}ObjType := 'Brush';{$endif}
|
||||
|
||||
Result := HGDIOBJ(TLazCanvas(DC).AssignedBrush);
|
||||
TLazCanvas(DC).AssignBrushData(lBrush); // := doesn't work
|
||||
@ -5375,7 +5375,7 @@ begin
|
||||
SelectClipRGN(DC, HRGN(GDIObj));
|
||||
end*);
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[TCDWidgetSet.SelectObject] Result=', dbghex(Result), ' ObjectType=', ObjType);
|
||||
{$endif}
|
||||
end;
|
||||
|
@ -2729,7 +2729,7 @@ end;*)
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.GetDC(hWnd: HWND): HDC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:> [WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||
{$endif}
|
||||
Result := 0;
|
||||
@ -2745,7 +2745,7 @@ begin
|
||||
end else
|
||||
Result := HDC(QtScreenContext);}
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:< [WinAPI GetDC] Result: ', dbghex(Result));
|
||||
{$endif}
|
||||
end;
|
||||
@ -4308,7 +4308,7 @@ function TCDWidgetSet.GetWindowRelativePosition(Handle: HWND; var Left, Top: int
|
||||
var
|
||||
R: TRect;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI GetWindowRelativePosition]');
|
||||
{$endif}
|
||||
{ if Handle = 0 then}
|
||||
@ -4328,7 +4328,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.GetWindowSize(Handle: hwnd; var Width, Height: integer): boolean;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI GetWindowSize]');
|
||||
{$endif}
|
||||
if Handle = 0 then Exit(False);
|
||||
@ -4640,7 +4640,7 @@ end;
|
||||
function TQtWidgetSet.IsZoomed(Handle: HWND): boolean;
|
||||
begin
|
||||
Result := TQtWidget(Handle).isMaximized;
|
||||
end;
|
||||
end;*)
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: InvalidateRect
|
||||
@ -4650,26 +4650,27 @@ end;
|
||||
Returns:
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
||||
function TCDWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI InvalidateRect]');
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[TCDWidgetSet.InvalidateRect]');
|
||||
{$endif}
|
||||
if AHandle = 0 then
|
||||
exit(False);
|
||||
if Rect <> nil then
|
||||
if AHandle = 0 then exit(False);
|
||||
|
||||
eventResult := eventResult or 1;
|
||||
(* if Rect <> nil then
|
||||
begin
|
||||
with TQtWidget(aHandle).getClientOffset do
|
||||
OffsetRect(Rect^, x, y);
|
||||
// no need to handle bErase. Qt automatically erase rect on paint event according to docs
|
||||
TQtWidget(aHandle).Update(Rect);
|
||||
end else
|
||||
TQtWidget(aHandle).Update;
|
||||
TQtWidget(aHandle).Update;*)
|
||||
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
(*{------------------------------------------------------------------------------
|
||||
Function: InvalidateRgn
|
||||
Params: aHandle:
|
||||
Rect:
|
||||
@ -4931,7 +4932,7 @@ var
|
||||
begin
|
||||
if DC = 0 then Exit;
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
// DebugLn(Format('[WinAPI Rectangle] DC=%s DC.Width=%d DC.Height=%d', [dbghex(DC), LazDC.Width, LazDC.Height]));
|
||||
DebugLn(Format('[WinAPI Rectangle] DC=%s', [dbghex(DC)]));
|
||||
DebugLn(Format('[WinAPI Rectangle] DC.Width=%d DC.Height=%d', [LazDC.Width, LazDC.Height]));
|
||||
@ -4951,7 +4952,7 @@ function TQtWidgetSet.RectVisible(dc : hdc; const ARect: TRect) : Boolean;
|
||||
var
|
||||
QtDC: TQtDeviceContext;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
writeln('[WinAPI RectVisible] ');
|
||||
{$endif}
|
||||
Result := False;
|
||||
|
@ -75,7 +75,7 @@ function TCocoaWidgetSet.CreateBitmap(Width, Height: Integer;
|
||||
var
|
||||
bmpType: TCocoaBitmapType;
|
||||
begin
|
||||
{$IFDEF VerboseWinAPI}
|
||||
{$IFDEF VerboseCDWinAPI}
|
||||
DebugLn('TCocoaWidgetSet.CreateBitmap');
|
||||
{$ENDIF}
|
||||
|
||||
|
@ -1669,7 +1669,7 @@ function TCDWidgetSet.GetDC(hWnd: HWND): HDC;
|
||||
var
|
||||
lWindowInfo: PWindowInfo;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:> [WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||
{$endif}
|
||||
|
||||
@ -1689,7 +1689,7 @@ begin
|
||||
// end else
|
||||
// Result := HDC(QtScreenContext);
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:< [WinAPI GetDC] Result: ', dbghex(Result));
|
||||
{$endif}
|
||||
end;
|
||||
@ -2274,7 +2274,7 @@ var
|
||||
end;
|
||||
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':>[TCDWidgetSet.GetWindowSize] Handle=%x', [Handle]));
|
||||
{$endif}
|
||||
|
||||
@ -2283,7 +2283,7 @@ begin
|
||||
|
||||
if not Result then
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[TCDWidgetSet.GetWindowSize] GetWindowPlacement failed');
|
||||
{$endif}
|
||||
Exit;
|
||||
@ -2293,7 +2293,7 @@ begin
|
||||
begin
|
||||
Width := 0;
|
||||
Height := 0;
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(':<[TCDWidgetSet.GetWindowSize] Minimized');
|
||||
{$endif}
|
||||
Exit;
|
||||
@ -2354,7 +2354,7 @@ begin
|
||||
|
||||
ExcludeCaption;
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn(Format(':<[TCDWidgetSet.GetWindowSize] Width=%d Height=%d', [Width, Height]));
|
||||
{$endif}
|
||||
end;
|
||||
|
@ -2729,7 +2729,7 @@ end;*)
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.GetDC(hWnd: HWND): HDC;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:> [WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||
{$endif}
|
||||
Result := 0;
|
||||
@ -2745,7 +2745,7 @@ begin
|
||||
end else
|
||||
Result := HDC(QtScreenContext);}
|
||||
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
DebugLn('Trace:< [WinAPI GetDC] Result: ', dbghex(Result));
|
||||
{$endif}
|
||||
end;
|
||||
@ -4308,7 +4308,7 @@ function TCDWidgetSet.GetWindowRelativePosition(Handle: HWND; var Left, Top: int
|
||||
var
|
||||
R: TRect;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI GetWindowRelativePosition]');
|
||||
{$endif}
|
||||
{ if Handle = 0 then}
|
||||
@ -4328,7 +4328,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.GetWindowSize(Handle: hwnd; var Width, Height: integer): boolean;
|
||||
begin
|
||||
{$ifdef VerboseWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI GetWindowSize]');
|
||||
{$endif}
|
||||
if Handle = 0 then Exit(False);
|
||||
@ -4640,7 +4640,7 @@ end;
|
||||
function TQtWidgetSet.IsZoomed(Handle: HWND): boolean;
|
||||
begin
|
||||
Result := TQtWidget(Handle).isMaximized;
|
||||
end;
|
||||
end;*)
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: InvalidateRect
|
||||
@ -4650,26 +4650,26 @@ end;
|
||||
Returns:
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
||||
function TCDWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn('[WinAPI InvalidateRect]');
|
||||
{$endif}
|
||||
if AHandle = 0 then
|
||||
exit(False);
|
||||
if Rect <> nil then
|
||||
{ if Rect <> nil then
|
||||
begin
|
||||
with TQtWidget(aHandle).getClientOffset do
|
||||
OffsetRect(Rect^, x, y);
|
||||
// no need to handle bErase. Qt automatically erase rect on paint event according to docs
|
||||
TQtWidget(aHandle).Update(Rect);
|
||||
end else
|
||||
TQtWidget(aHandle).Update;
|
||||
TQtWidget(aHandle).Update;}
|
||||
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
(*{------------------------------------------------------------------------------
|
||||
Function: InvalidateRgn
|
||||
Params: aHandle:
|
||||
Rect:
|
||||
|
@ -144,10 +144,10 @@ function GetWindowSize(Handle: hwnd; var Width, Height: Integer): boolean; overr
|
||||
(*function GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint;
|
||||
Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean; override;
|
||||
|
||||
function HideCaret(hWnd: HWND): Boolean; override;
|
||||
function HideCaret(hWnd: HWND): Boolean; override;*)
|
||||
|
||||
function InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean) : Boolean; override;
|
||||
function InvalidateRgn(aHandle: HWND; Rgn: HRGN; Erase: Boolean): Boolean; override;
|
||||
(*function InvalidateRgn(aHandle: HWND; Rgn: HRGN; Erase: Boolean): Boolean; override;
|
||||
procedure InitializeCriticalSection(var CritSection: TCriticalSection); override;
|
||||
function IntersectClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; override;
|
||||
function IsIconic(Handle: HWND): boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user