customdrawn: Starts the support for TButton, it already shows

git-svn-id: trunk@33869 -
This commit is contained in:
sekelsenmat 2011-11-30 11:27:44 +00:00
parent afe0cc0ae5
commit fdf484944c
6 changed files with 1634 additions and 15 deletions

1
.gitattributes vendored
View File

@ -5480,6 +5480,7 @@ lcl/interfaces/customdrawn/customdrawnwsforms_android.inc svneol=native#text/pas
lcl/interfaces/customdrawn/customdrawnwsforms_cocoa.inc svneol=native#text/pascal lcl/interfaces/customdrawn/customdrawnwsforms_cocoa.inc svneol=native#text/pascal
lcl/interfaces/customdrawn/customdrawnwsforms_win.inc svneol=native#text/pascal lcl/interfaces/customdrawn/customdrawnwsforms_win.inc svneol=native#text/pascal
lcl/interfaces/customdrawn/customdrawnwsforms_x11.inc svneol=native#text/pascal lcl/interfaces/customdrawn/customdrawnwsforms_x11.inc svneol=native#text/pascal
lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas svneol=native#text/pascal
lcl/interfaces/customdrawn/interfaces.pas svneol=native#text/pascal lcl/interfaces/customdrawn/interfaces.pas svneol=native#text/pascal
lcl/interfaces/customdrawn/wincallback.inc svneol=native#text/pascal lcl/interfaces/customdrawn/wincallback.inc svneol=native#text/pascal
lcl/interfaces/fpgui/Makefile.compiled svneol=native#text/plain lcl/interfaces/fpgui/Makefile.compiled svneol=native#text/plain

View File

@ -819,7 +819,6 @@ end;
procedure TCDControl.DrawToCanvas(ACanvas: TCanvas); procedure TCDControl.DrawToCanvas(ACanvas: TCanvas);
var var
ABmp: TBitmap;
lSize: TSize; lSize: TSize;
lControlId: TCDControlID; lControlId: TCDControlID;
begin begin
@ -829,7 +828,7 @@ begin
lControlId := GetControlId(); lControlId := GetControlId();
PrepareControlState; PrepareControlState;
PrepareControlStateEx; PrepareControlStateEx;
FDrawer.DrawControl(Canvas, lSize, lControlId, FState, FStateEx); FDrawer.DrawControl(ACanvas, lSize, lControlId, FState, FStateEx);
end; end;
procedure TCDControl.MouseEnter; procedure TCDControl.MouseEnter;

View File

@ -40,6 +40,7 @@ uses
// Widgetset // Widgetset
customdrawnproc, customdrawnproc,
// LCL // LCL
customdrawn_common,
lazcanvas, lazregions, lazcanvas, lazregions,
InterfaceBase, Translations, InterfaceBase, Translations,
Controls, Forms, lclproc, IntfGraphics, GraphType, Controls, Forms, lclproc, IntfGraphics, GraphType,

View File

@ -10,9 +10,9 @@ uses
fpimage, fpcanvas, fpimage, fpcanvas,
// Custom Drawn Canvas // Custom Drawn Canvas
IntfGraphics, lazcanvas, lazregions, IntfGraphics, lazcanvas, lazregions,
// // LCL
GraphType, Controls, LCLMessageGlue, WSControls, LCLType, LCLProc, GraphType, Controls, LCLMessageGlue, WSControls, LCLType, LCLProc,
Forms; Forms, Graphics, customdrawncontrols;
type type
TUpdateLazImageFormat = ( TUpdateLazImageFormat = (
@ -24,7 +24,7 @@ type
public public
Region: TLazRegionWithChilds; Region: TLazRegionWithChilds;
WinControl: TWinControl; WinControl: TWinControl;
//CDControl: TCDControl; CDControl: TCDControl;
end; end;
TCDNonNativeForm = class TCDNonNativeForm = class
@ -199,6 +199,7 @@ var
lCDWinControl: TCDWinControl; lCDWinControl: TCDWinControl;
lWinControl: TWinControl; lWinControl: TWinControl;
struct : TPaintStruct; struct : TPaintStruct;
lCanvas: TCanvas;
begin begin
lChildrenCount := ACDControlsList.Count; lChildrenCount := ACDControlsList.Count;
{$ifdef VerboseCDWinControl} {$ifdef VerboseCDWinControl}
@ -231,10 +232,26 @@ begin
ACanvas.SaveState; ACanvas.SaveState;
ACanvas.ResetCanvasState; ACanvas.ResetCanvasState;
{$ifdef VerboseCDWinControl} // For custom controls
DebugLn(Format('[RenderChildWinControls] i=%d before LCLSendPaintMsg', [i])); if lCDWinControl.CDControl = nil then
{$endif} begin
LCLSendPaintMsg(lCDWinControl.WinControl, struct.hdc, @struct); {$ifdef VerboseCDWinControl}
DebugLn(Format('[RenderChildWinControls] i=%d before LCLSendPaintMsg', [i]));
{$endif}
LCLSendPaintMsg(lCDWinControl.WinControl, struct.hdc, @struct);
end
// For LCL native controls
else
begin
lCanvas := TCanvas.Create;
try
lCanvas.Handle := struct.hdc;
lCDWinControl.CDControl.DrawToCanvas(lCanvas);
finally
lCanvas.Handle := 0;
lCanvas.Free;
end;
end;
// Now restore it // Now restore it
ACanvas.RestoreState; ACanvas.RestoreState;

View File

@ -106,11 +106,11 @@ uses
CustomDrawnWSControls, CustomDrawnWSControls,
{ WinCEWSDialogs, { WinCEWSDialogs,
WinCEWSExtCtrls,} WinCEWSExtCtrls,}
CustomDrawnWSForms{, CustomDrawnWSForms,
WinCEWSImgList, { WinCEWSImgList,
WinCEWSMenus, WinCEWSMenus,
WinCEWSSpin, WinCEWSSpin,}
WinCEWSStdCtrls, CustomDrawnWSStdCtrls{,
WinCEWSGrids}; WinCEWSGrids};
// imglist // imglist
@ -296,8 +296,8 @@ end;
function RegisterCustomButton: Boolean; alias : 'WSRegisterCustomButton'; function RegisterCustomButton: Boolean; alias : 'WSRegisterCustomButton';
begin begin
// RegisterWSComponent(TCustomButton, TWinCEWSButton); RegisterWSComponent(TCustomButton, TCDWSButton);
Result := False; Result := True;
end; end;
function RegisterCustomCheckBox: Boolean; alias : 'WSRegisterCustomCheckBox'; function RegisterCustomCheckBox: Boolean; alias : 'WSRegisterCustomCheckBox';

File diff suppressed because it is too large Load Diff