87
function TFpGuiWidgetSet.DrawFrameControl(DC: HDC; const Rect: TRect; uType,
88
uState: Cardinal): Boolean;
90
ADC: TFPGUIDeviceContext absolute DC;
91
ControlType: Cardinal;
92
ControlStyle: Cardinal;
94
Style: TfpgButtonFlags;
100
DFCS_BUTTONCHECK = 0;
101
DFCS_BUTTONRADIOIMAGE = 1;
102
DFCS_BUTTONRADIOMASK = 2;
103
DFCS_BUTTONRADIO = 4;
104
DFCS_BUTTON3STATE = 8;
105
DFCS_BUTTONPUSH = 16;
108
DFCS_ALLSTATES=DFCS_BUTTONCHECK or DFCS_BUTTONRADIOIMAGE or DFCS_BUTTONRADIOMASK
109
or DFCS_BUTTONRADIO or DFCS_BUTTON3STATE or DFCS_BUTTONPUSH;
112
if Assigned(ADC.fpgCanvas) then begin
114
ControlStyle:=uState and DFCS_ALLSTATES;
115
TRectTofpgRect(Rect,fpgRect);
116
AdjustRectToOrg(fpgRect,ADC.FOrg);
120
if (ControlStyle and DFCS_BUTTONPUSH)=DFCS_BUTTONPUSH then begin
122
if (uState and DFCS_INACTIVE) <> 0 then
123
Style:=Style+[btfIsEmbedded] //Disabled ?
125
if (uState and DFCS_PUSHED) <> 0 then
126
Style:=Style+[btfIsPressed]
128
if (uState and DFCS_HOT) <> 0 then
129
Style:=Style+[btfHover];
130
ADC.fpgCanvas.DrawButtonFace(fpgRect,Style);
87
140
{------------------------------------------------------------------------------
88
141
Method: TFpGuiWidgetSet.CreateTimer
245
298
// Include(AComponent.ComponentState, csDesigning);
301
function TFpGuiWidgetSet.RawImage_CreateBitmaps(const ARawImage: TRawImage; out
302
ABitmap, AMask: HBitmap; ASkipMask: Boolean): Boolean;
304
OutBitmap: TFPGUIWinAPIBitmap;
305
fpgBitmap: TfpgImage;
306
ImgData: Pointer absolute ARawImage.Data;
307
ImgMask: Pointer absolute ARawImage.Mask;
308
ImgWidth: Cardinal absolute ARawImage.Description.Width;
309
ImgHeight: Cardinal absolute ARawImage.Description.Height;
310
ImgDepth: Byte absolute ARawImage.Description.Depth;
311
ImgDataSize: PtrUInt absolute ARawImage.DataSize;
312
function min(const a,b: SizeInt): SizeInt;
314
if a>b then Result:=b else Result:=a;
320
OutBitmap:=TFPGUIWinAPIBitmap.Create(ARawImage.Description.BitsPerPixel,ARawImage.Description.Width,ARawImage.Description.Height);
321
fpgBitmap:=OutBitmap.Image;
322
ABitmap:=HBITMAP(OutBitmap);
323
move(ARawImage.Data^,pbyte(fpgBitmap.ImageData)^,min(ARawImage.DataSize,fpgBitmap.ImageDataSize));
324
fpgBitmap.UpdateImage;
328
function TFpGuiWidgetSet.RawImage_DescriptionFromDevice(ADC: HDC; out
329
ADesc: TRawImageDescription): Boolean;
331
DC: TFPGUIDeviceContext;
334
DC:=TFPGUIDeviceContext(ADC);
338
if Assigned(DC) and Assigned(DC.fpgCanvas) then begin
339
dc.fpgCanvas.GetWinRect(r);
346
Depth:= 24; // used bits per pixel
347
BitOrder:= riboBitsInOrder;
348
ByteOrder:= riboMSBFirst;
349
LineOrder:= riloTopToBottom;
350
LineEnd:= rileByteBoundary;
351
BitsPerPixel:=32; // bits per pixel. can be greater than Depth.
352
RedPrec:= 8; // red or gray precision. bits for red
353
RedShift:= 8; // bitshift. Direction: from least to most significant
248
364
{------------------------------------------------------------------------------
249
365
Function: TFpGuiWidgetSet.IsValidDC
250
366
Params: DC - handle to a device context (TFpGuiDeviceContext)