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_win.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/wincallback.inc svneol=native#text/pascal
lcl/interfaces/fpgui/Makefile.compiled svneol=native#text/plain

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff