mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 05:19:31 +02:00
customdrawn: Starts the support for TButton, it already shows
git-svn-id: trunk@33869 -
This commit is contained in:
parent
afe0cc0ae5
commit
fdf484944c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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;
|
||||
|
@ -40,6 +40,7 @@ uses
|
||||
// Widgetset
|
||||
customdrawnproc,
|
||||
// LCL
|
||||
customdrawn_common,
|
||||
lazcanvas, lazregions,
|
||||
InterfaceBase, Translations,
|
||||
Controls, Forms, lclproc, IntfGraphics, GraphType,
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
1601
lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas
Normal file
1601
lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user