customdrawnws: Updates the X11 backend to paint child wincontrols

git-svn-id: trunk@33748 -
This commit is contained in:
sekelsenmat 2011-11-24 07:57:05 +00:00
parent 42f8712413
commit d3a2cf706c
2 changed files with 12 additions and 5 deletions

View File

@ -20,7 +20,7 @@ type
public
Window: X.TWindow;
LCLControl: TWinControl;
CDWinControl: TCDWinControl;
Children: TFPList; // of TCDWinControl;
// Used and valid only during event processing
XEvent: PXEvent;
// X11 extra objects

View File

@ -7,14 +7,17 @@ var
lWindowInfo: TX11WindowInfo;
begin
lWindowInfo := TX11WindowInfo(AForm.Handle);
lWindowInfo.CDWinControl := ACDWinControl;
if lWindowInfo.Children = nil then lWindowInfo.Children := TFPList.Create;
lWindowInfo.Children.Add(ACDWinControl);
end;
class function TCDWSCustomForm.BackendGetCDWinControlList(const AForm: TCustomForm): TFPList;
var
lWindowInfo: TX11WindowInfo;
begin
{ lwin := TCocoaWindow(AForm.Handle);
if lwin.Children = nil then lwin.Children := TFPList.Create;
Result := lwin.Children;}
lWindowInfo := TX11WindowInfo(AForm.Handle);
if lWindowInfo.Children = nil then lWindowInfo.Children := TFPList.Create;
Result := lWindowInfo.Children;
end;
class procedure TCDWSCustomForm.UpdateMotifWMHints(const AWinControl: TWinControl; CanMaximize: Boolean);
@ -641,6 +644,10 @@ begin
DebugLn('[TCDWSCustomForm.EvPaint] OnPaint event ended');
{$ENDIF}
// Now paint all child win controls
RenderChildWinControls(AWindowInfo.Image, AWindowInfo.Canvas,
BackendGetCDWinControlList(TCustomForm(AWinControl)));
// Now render it into the control
AWindowInfo.Image.GetRawImage(lRawImage);
DrawRawImageToGC(lRawImage, AWindowInfo, 0, 0, lWidth, lHeight);