Changeset 14 for trunk/Components/ButtonC.pas
- Timestamp:
- Jan 7, 2017, 8:54:23 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/ButtonC.pas
r10 r14 27 27 procedure Register; 28 28 begin 29 RegisterComponents('Samples', [TButtonC]);29 RegisterComponents('Samples', [TButtonC]); 30 30 end; 31 31 32 32 constructor TButtonC.Create(aOwner: TComponent); 33 33 begin 34 inherited Create(aOwner);35 ShowHint:=true;36 SetBounds(0,0,12,12);34 inherited Create(aOwner); 35 ShowHint := true; 36 SetBounds(0, 0, 12, 12); 37 37 end; 38 38 39 39 procedure TButtonC.Paint; 40 40 begin 41 with Canvas do 42 if FGraphic<>nil then 43 BitBlt(Canvas.Handle,0,0,12,12,FGraphic.Canvas.Handle, 44 169+13*Byte(FDown),159+13*FIndex,SRCCOPY) 45 else begin Brush.Color:=$0000FF; FrameRect(Rect(0,0,12,12)) end 41 with Canvas do 42 if FGraphic <> nil then 43 BitBlt(Canvas.Handle, 0, 0, 12, 12, FGraphic.Canvas.Handle, 44 169 + 13 * Byte(FDown), 159 + 13 * FIndex, SRCCOPY) 45 else 46 begin 47 Brush.Color := $0000FF; 48 FrameRect(Rect(0, 0, 12, 12)) 49 end 46 50 end; 47 51 48 52 procedure TButtonC.SetIndex(x: integer); 49 53 begin 50 if x<>FIndex then54 if x <> FIndex then 51 55 begin 52 FIndex:=x;53 Invalidate56 FIndex := x; 57 Invalidate 54 58 end 55 59 end; 56 60 57 61 end. 58
Note:
See TracChangeset
for help on using the changeset viewer.