Changeset 184 for trunk/Packages/CevoComponents/ButtonB.pas
- Timestamp:
- May 4, 2020, 10:24:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ButtonB.pas
r165 r184 4 4 5 5 uses 6 ButtonBase, 7 Classes, Graphics, LCLIntf, LCLType; 6 ButtonBase, Classes, Graphics, LCLIntf, LCLType; 8 7 9 8 type … … 13 12 FMask: TBitmap; 14 13 FIndex: integer; 15 procedure SetIndex( x: integer);14 procedure SetIndex(Text: integer); 16 15 public 17 16 property Mask: TBitmap read FMask write FMask; … … 26 25 procedure Register; 27 26 27 28 28 implementation 29 29 … … 36 36 begin 37 37 inherited Create(aOwner); 38 ShowHint := true;38 ShowHint := True; 39 39 SetBounds(0, 0, 25, 25); 40 40 end; … … 43 43 begin 44 44 with Canvas do 45 if FGraphic <> nil then 46 begin 45 if FGraphic <> nil then begin 47 46 BitBlt(Canvas.Handle, 0, 0, 25, 25, FGraphic.Canvas.Handle, 169, 48 47 243 + 26 * Byte(FDown), SRCCOPY); 49 if FIndex >= 0 then 50 begin 48 if FIndex >= 0 then begin 51 49 BitBlt(Canvas.Handle, 0, 0, 25, 25, FMask.Canvas.Handle, 52 50 1 + FIndex mod 12 * 26, 337 + FIndex div 12 * 26, SRCAND); … … 54 52 1 + FIndex mod 12 * 26, 337 + FIndex div 12 * 26, SRCPAINT); 55 53 end 56 end 57 else 58 begin 54 end else begin 59 55 Brush.Color := $0000FF; 60 FrameRect(Rect(0, 0, 25, 25)) 61 end 56 FrameRect(Rect(0, 0, 25, 25)); 57 end; 62 58 end; 63 59 64 procedure TButtonB.SetIndex( x: integer);60 procedure TButtonB.SetIndex(Text: integer); 65 61 begin 66 if x <> FIndex then 67 begin 68 FIndex := x; 69 Invalidate 70 end 62 if Text <> FIndex then begin 63 FIndex := Text; 64 Invalidate; 65 end; 71 66 end; 72 67
Note:
See TracChangeset
for help on using the changeset viewer.