From 73b7aedc0b51fcdee72d8ad1a67ec51b105ed8af Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Mon, 28 Nov 2011 10:27:59 +0000 Subject: [PATCH] customdrawn-android: Painting via paint events already partially works, there is now a pixel format missmatch git-svn-id: trunk@33821 - --- .../customdrawn/customdrawnproc.pas | 10 +++++--- .../customdrawnwsforms_android.inc | 23 ++++++++----------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/lcl/interfaces/customdrawn/customdrawnproc.pas b/lcl/interfaces/customdrawn/customdrawnproc.pas index c6a7f9ad59..644b4954a7 100644 --- a/lcl/interfaces/customdrawn/customdrawnproc.pas +++ b/lcl/interfaces/customdrawn/customdrawnproc.pas @@ -98,18 +98,19 @@ begin lFormInfo.LCLForm := AForm; lFormInfo.Children := TFPList.Create; NonNativeForms.Insert(0, lFormInfo); + Result := lFormInfo; end; procedure ShowForm(ACDForm: TCDNonNativeForm); var lCount, lCurIndex: Integer; begin - {$IFDEF VerboseWinAPI} - DebugLn('ShowForm'); - {$ENDIF} InitNonNativeForms(); lCount := NonNativeForms.Count; lCurIndex := NonNativeForms.IndexOf(ACDForm); + {$IFDEF VerboseWinAPI} + DebugLn(Format('ShowForm lOldIndex=%d lNewIndex=%d', [lCurIndex, lCount-1])); + {$ENDIF} NonNativeForms.Move(lCurIndex, lCount-1); end; @@ -120,6 +121,9 @@ begin InitNonNativeForms(); lCount := NonNativeForms.Count; lCurIndex := NonNativeForms.IndexOf(ACDForm); + {$IFDEF VerboseWinAPI} + DebugLn(Format('HideForm lOldIndex=%d lNewIndex=0', [lCurIndex])); + {$ENDIF} NonNativeForms.Move(lCurIndex, 0); end; diff --git a/lcl/interfaces/customdrawn/customdrawnwsforms_android.inc b/lcl/interfaces/customdrawn/customdrawnwsforms_android.inc index d02b03270d..c30de2d77c 100644 --- a/lcl/interfaces/customdrawn/customdrawnwsforms_android.inc +++ b/lcl/interfaces/customdrawn/customdrawnwsforms_android.inc @@ -33,17 +33,17 @@ var lWindowInfo: TAndroidWindowInfo; AForm: TCustomForm absolute AWinControl; begin -(* {$ifdef VerboseCDWindow} + {$ifdef VerboseCDWindow} DebugLn(Format(':>[TCDWSCustomForm.CreateHandle] AWinControl=%x Name=%s: %s', [PtrInt(AWinControl), AWinControl.Name, AWinControl.ClassName])); - {$endif}*) + {$endif} Result := TLCLIntfhandle(AddNewForm(TCustomForm(AWinControl))); -(* {$ifdef VerboseCDWindow} + {$ifdef VerboseCDWindow} DebugLn(Format(':<[TCDWSCustomForm.CreateHandle] Result=%x', [Result])); - {$endif}*) + {$endif} end; class procedure TCDWSCustomForm.DestroyHandle(const AWinControl: TWinControl); @@ -86,23 +86,20 @@ end; class procedure TCDWSCustomForm.ShowHide(const AWinControl: TWinControl); begin -// lWindowInfo := TX11WindowInfo(AWinControl.Handle); -// lWindow := lWindowInfo.Window; - if AWinControl.Visible then begin - ShowForm(TCDNonNativeForm(AWinControl.Handle)); -(* {$ifdef VerboseCDWindow} + {$ifdef VerboseCDWindow} DebugLn(Format('[TCDWSCustomForm.ShowHide] Visible=True AWinControl=%x Handle=%x', [PtrInt(AWinControl), PtrInt(AWinControl.Handle)])); - {$endif}*) + {$endif} + ShowForm(TCDNonNativeForm(AWinControl.Handle)); end else begin - HideForm(TCDNonNativeForm(AWinControl.Handle)); -(* {$ifdef VerboseCDWindow} + {$ifdef VerboseCDWindow} DebugLn(Format('[TCDWSCustomForm.ShowHide] Visible=False AWinControl=%x', [PtrInt(AWinControl)])); - {$endif}*) + {$endif} + HideForm(TCDNonNativeForm(AWinControl.Handle)); end; end;