Changeset 14 for trunk/Components
- Timestamp:
- Jan 7, 2017, 8:54:23 PM (8 years ago)
- Location:
- trunk/Components
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/ButtonA.pas
r10 r14 30 30 procedure Register; 31 31 begin 32 RegisterComponents('Samples', [TButtonA]);32 RegisterComponents('Samples', [TButtonA]); 33 33 end; 34 34 35 35 constructor TButtonA.Create(aOwner: TComponent); 36 36 begin 37 inherited Create(aOwner);38 FCaption:='';39 SetBounds(0,0,100,25);37 inherited Create(aOwner); 38 FCaption := ''; 39 SetBounds(0, 0, 100, 25); 40 40 end; 41 41 42 42 procedure TButtonA.Paint; 43 43 begin 44 with Canvas do45 if FGraphic<>nil then44 with Canvas do 45 if FGraphic <> nil then 46 46 begin 47 BitBlt(Canvas.Handle,0,0,100,25,Graphic.Canvas.Handle,48 195,243+26*Byte(Down),SRCCOPY);49 Canvas.Brush.Style:=bsClear;50 Textout(50-(TextWidth(FCaption)+1) div 2,12-textheight(FCaption) div 2,51 FCaption);47 BitBlt(Canvas.Handle, 0, 0, 100, 25, Graphic.Canvas.Handle, 195, 48 243 + 26 * Byte(Down), SRCCOPY); 49 Canvas.Brush.Style := bsClear; 50 Textout(50 - (TextWidth(FCaption) + 1) div 2, 12 - textheight(FCaption) 51 div 2, FCaption); 52 52 end 53 else begin Brush.Color:=$0000FF; FrameRect(Rect(0,0,100,25)) end 53 else 54 begin 55 Brush.Color := $0000FF; 56 FrameRect(Rect(0, 0, 100, 25)) 57 end 54 58 end; 55 59 56 60 procedure TButtonA.SetCaption(x: string); 57 61 begin 58 if x<>FCaption then62 if x <> FCaption then 59 63 begin 60 FCaption:=x;61 Invalidate64 FCaption := x; 65 Invalidate 62 66 end 63 67 end; … … 65 69 procedure TButtonA.SetFont(const x: TFont); 66 70 begin 67 Canvas.Font.Assign(x);68 Canvas.Font.Color:=$000000;71 Canvas.Font.Assign(x); 72 Canvas.Font.Color := $000000; 69 73 end; 70 74 71 75 end. 72 -
trunk/Components/ButtonB.pas
r10 r14 30 30 procedure Register; 31 31 begin 32 RegisterComponents('Samples', [TButtonB]);32 RegisterComponents('Samples', [TButtonB]); 33 33 end; 34 34 35 35 constructor TButtonB.Create(aOwner: TComponent); 36 36 begin 37 inherited Create(aOwner);38 ShowHint:=true;39 SetBounds(0,0,25,25);37 inherited Create(aOwner); 38 ShowHint := true; 39 SetBounds(0, 0, 25, 25); 40 40 end; 41 41 42 42 procedure TButtonB.Paint; 43 43 begin 44 with Canvas do45 if FGraphic<>nil then44 with Canvas do 45 if FGraphic <> nil then 46 46 begin 47 BitBlt(Canvas.Handle,0,0,25,25,FGraphic.Canvas.Handle,48 169,243+26*Byte(FDown),SRCCOPY);49 if FIndex>=0 then47 BitBlt(Canvas.Handle, 0, 0, 25, 25, FGraphic.Canvas.Handle, 169, 48 243 + 26 * Byte(FDown), SRCCOPY); 49 if FIndex >= 0 then 50 50 begin 51 BitBlt(Canvas.Handle,0,0,25,25,FMask.Canvas.Handle,52 1+FIndex mod 12 *26,337+FIndex div 12 *26,SRCAND);53 BitBlt(Canvas.Handle,0,0,25,25,FGraphic.Canvas.Handle,54 1+FIndex mod 12 *26,337+FIndex div 12 *26,SRCPAINT);51 BitBlt(Canvas.Handle, 0, 0, 25, 25, FMask.Canvas.Handle, 52 1 + FIndex mod 12 * 26, 337 + FIndex div 12 * 26, SRCAND); 53 BitBlt(Canvas.Handle, 0, 0, 25, 25, FGraphic.Canvas.Handle, 54 1 + FIndex mod 12 * 26, 337 + FIndex div 12 * 26, SRCPAINT); 55 55 end 56 56 end 57 else begin Brush.Color:=$0000FF; FrameRect(Rect(0,0,25,25)) end 57 else 58 begin 59 Brush.Color := $0000FF; 60 FrameRect(Rect(0, 0, 25, 25)) 61 end 58 62 end; 59 63 60 64 procedure TButtonB.SetIndex(x: integer); 61 65 begin 62 if x<>FIndex then66 if x <> FIndex then 63 67 begin 64 FIndex:=x;65 Invalidate68 FIndex := x; 69 Invalidate 66 70 end 67 71 end; 68 72 69 73 end. 70 -
trunk/Components/ButtonBase.pas
r10 r14 10 10 constructor Create(aOwner: TComponent); override; 11 11 protected 12 FDown, FPermanent: boolean;12 FDown, FPermanent: boolean; 13 13 FGraphic: TBitmap; 14 //FDownSound, FUpSound: string;14 // FDownSound, FUpSound: string; 15 15 ClickProc: TNotifyEvent; 16 16 DownChangedProc: TNotifyEvent; 17 17 procedure SetDown(x: boolean); 18 //procedure PlayDownSound;19 //procedure PlayUpSound;18 // procedure PlayDownSound; 19 // procedure PlayUpSound; 20 20 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; 21 21 x, y: integer); override; … … 27 27 public 28 28 property Graphic: TBitmap read FGraphic write FGraphic; 29 //property DownSound: string read FDownSound write FDownSound;30 //property UpSound: string read FUpSound write FUpSound;29 // property DownSound: string read FDownSound write FDownSound; 30 // property UpSound: string read FUpSound write FUpSound; 31 31 published 32 32 property Visible; … … 34 34 property Permanent: boolean read FPermanent write FPermanent; 35 35 property OnClick: TNotifyEvent read ClickProc write ClickProc; 36 property OnDownChanged: TNotifyEvent read DownChangedProc write DownChangedProc; 36 property OnDownChanged: TNotifyEvent read DownChangedProc 37 write DownChangedProc; 37 38 end; 38 39 39 40 implementation 40 41 41 // uses42 // 42 // uses 43 // MMSystem; 43 44 44 constructor TButtonBase.Create( AOwner: TComponent);45 constructor TButtonBase.Create(aOwner: TComponent); 45 46 begin 46 47 inherited; 47 //FDownSound:=''; 48 //FUpSound:=''; 49 FGraphic:=nil; Active:=false; FDown:=false; FPermanent:=false; 50 ClickProc:=nil; 48 // FDownSound:=''; 49 // FUpSound:=''; 50 FGraphic := nil; 51 Active := false; 52 FDown := false; 53 FPermanent := false; 54 ClickProc := nil; 51 55 end; 52 56 53 57 procedure TButtonBase.MouseDown(Button: TMouseButton; Shift: TShiftState; 54 58 x, y: integer); 55 59 begin 56 Active :=true;57 MouseMove(Shift, x,y)60 Active := true; 61 MouseMove(Shift, x, y) 58 62 end; 59 63 60 64 procedure TButtonBase.MouseUp(Button: TMouseButton; Shift: TShiftState; 61 65 x, y: integer); 62 66 begin 63 if ssLeft in Shift then exit; 64 MouseMove(Shift,x,y); 67 if ssLeft in Shift then 68 exit; 69 MouseMove(Shift, x, y); 65 70 if Active and FDown then 66 71 begin 67 //PlayUpSound;68 Active:=false;69 if FDown<>FPermanent then72 // PlayUpSound; 73 Active := false; 74 if FDown <> FPermanent then 70 75 begin 71 FDown:=FPermanent; 72 Invalidate; 73 if @DownChangedProc<>nil then DownChangedProc(self); 76 FDown := FPermanent; 77 Invalidate; 78 if @DownChangedProc <> nil then 79 DownChangedProc(self); 74 80 end; 75 if (Button=mbLeft) and (@ClickProc<>nil) then ClickProc(self) 81 if (Button = mbLeft) and (@ClickProc <> nil) then 82 ClickProc(self) 76 83 end 77 else84 else 78 85 begin 79 //if FDown then PlayUpSound;80 Active:=false;81 if FDown then86 // if FDown then PlayUpSound; 87 Active := false; 88 if FDown then 82 89 begin 83 FDown:=false; 84 Invalidate; 85 if @DownChangedProc<>nil then DownChangedProc(self); 90 FDown := false; 91 Invalidate; 92 if @DownChangedProc <> nil then 93 DownChangedProc(self); 86 94 end; 87 95 end … … 90 98 procedure TButtonBase.MouseMove(Shift: TShiftState; x, y: integer); 91 99 begin 92 if Active then 93 if (x>=0) and (x<Width) and (y>=0) and (y<Height) then 94 if (ssLeft in Shift) and not FDown then 95 begin 96 {PlayDownSound;} 97 FDown:=true; 98 Paint; 99 if @DownChangedProc<>nil then DownChangedProc(self); 100 end 101 else else if FDown and not FPermanent then 102 begin 103 {PlayUpSound;} 104 FDown:=false; 105 Paint; 106 if @DownChangedProc<>nil then DownChangedProc(self); 107 end 100 if Active then 101 if (x >= 0) and (x < Width) and (y >= 0) and (y < Height) then 102 if (ssLeft in Shift) and not FDown then 103 begin 104 { PlayDownSound; } 105 FDown := true; 106 Paint; 107 if @DownChangedProc <> nil then 108 DownChangedProc(self); 109 end 110 else 111 else if FDown and not FPermanent then 112 begin 113 { PlayUpSound; } 114 FDown := false; 115 Paint; 116 if @DownChangedProc <> nil then 117 DownChangedProc(self); 118 end 108 119 end; 109 120 110 121 procedure TButtonBase.SetDown(x: boolean); 111 122 begin 112 FDown:=x;113 Invalidate123 FDown := x; 124 Invalidate 114 125 end; 115 126 116 // procedure TButtonBase.PlayDownSound;117 // begin118 // if DownSound<>'' then SndPlaySound(pchar(DownSound),SND_ASYNC)119 // end;127 // procedure TButtonBase.PlayDownSound; 128 // begin 129 // if DownSound<>'' then SndPlaySound(pchar(DownSound),SND_ASYNC) 130 // end; 120 131 121 // procedure TButtonBase.PlayUpSound;122 // begin123 // if UpSound<>'' then SndPlaySound(pchar(UpSound),SND_ASYNC)124 // end;132 // procedure TButtonBase.PlayUpSound; 133 // begin 134 // if UpSound<>'' then SndPlaySound(pchar(UpSound),SND_ASYNC) 135 // end; 125 136 126 137 end. 127 -
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 -
trunk/Components/ButtonN.pas
r10 r14 12 12 FPossible, FLit: boolean; 13 13 FGraphic, FMask, FBackGraphic: TBitmap; 14 FIndex, BackIndex: integer;14 FIndex, BackIndex: integer; 15 15 FSmartHint: string; 16 16 ChangeProc: TNotifyEvent; … … 40 40 procedure Register; 41 41 begin 42 RegisterComponents('Samples', [TButtonN]);42 RegisterComponents('Samples', [TButtonN]); 43 43 end; 44 44 45 45 constructor TButtonN.Create(aOwner: TComponent); 46 46 begin 47 inherited Create(aOwner);48 ShowHint:=true;49 FGraphic:=nil;50 FBackGraphic:=nil;51 FPossible:=true;52 FLit:=false;53 FIndex:=-1;54 ChangeProc:=nil;55 SetBounds(0,0,42,42);47 inherited Create(aOwner); 48 ShowHint := true; 49 FGraphic := nil; 50 FBackGraphic := nil; 51 FPossible := true; 52 FLit := false; 53 FIndex := -1; 54 ChangeProc := nil; 55 SetBounds(0, 0, 42, 42); 56 56 end; 57 57 58 58 procedure TButtonN.Paint; 59 59 begin 60 with Canvas do60 with Canvas do 61 61 begin 62 if FGraphic<>nil then62 if FGraphic <> nil then 63 63 begin 64 BitBlt(Canvas.Handle,1,1,40,40,FBackGraphic.Canvas.Handle,65 1+80*BackIndex+40*byte(FPossible and FLit),176,SRCCOPY);66 if FPossible then64 BitBlt(Canvas.Handle, 1, 1, 40, 40, FBackGraphic.Canvas.Handle, 65 1 + 80 * BackIndex + 40 * byte(FPossible and FLit), 176, SRCCOPY); 66 if FPossible then 67 67 begin 68 BitBlt(Canvas.Handle,3,3,36,36,FMask.Canvas.Handle,69 195+37*(FIndex mod 3),21+37*(FIndex div 3),SRCAND);70 BitBlt(Canvas.Handle,3,3,36,36,FGraphic.Canvas.Handle,71 195+37*(FIndex mod 3),21+37*(FIndex div 3),SRCPAINT);68 BitBlt(Canvas.Handle, 3, 3, 36, 36, FMask.Canvas.Handle, 69 195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCAND); 70 BitBlt(Canvas.Handle, 3, 3, 36, 36, FGraphic.Canvas.Handle, 71 195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCPAINT); 72 72 end 73 73 end; 74 MoveTo(0,41); 75 Pen.Color:=$B0B0B0;LineTo(0,0);LineTo(41,0); 76 Pen.Color:=$FFFFFF;LineTo(41,41);LineTo(0,41); 74 MoveTo(0, 41); 75 Pen.Color := $B0B0B0; 76 LineTo(0, 0); 77 LineTo(41, 0); 78 Pen.Color := $FFFFFF; 79 LineTo(41, 41); 80 LineTo(0, 41); 77 81 end 78 82 end; 79 83 80 84 procedure TButtonN.MouseDown(Button: TMouseButton; Shift: TShiftState; 81 85 x, y: integer); 82 86 begin 83 if FPossible and (Button=mbLeft) and (@ChangeProc<>nil) then84 ChangeProc(Self)87 if FPossible and (Button = mbLeft) and (@ChangeProc <> nil) then 88 ChangeProc(Self) 85 89 end; 86 90 87 91 procedure TButtonN.SetPossible(x: boolean); 88 92 begin 89 if x<>FPossible then93 if x <> FPossible then 90 94 begin 91 FPossible:=x; 92 if x then Hint:=FSmartHint 93 else Hint:=''; 94 Invalidate 95 FPossible := x; 96 if x then 97 Hint := FSmartHint 98 else 99 Hint := ''; 100 Invalidate 95 101 end 96 102 end; … … 98 104 procedure TButtonN.SetLit(x: boolean); 99 105 begin 100 if x<>FLit then106 if x <> FLit then 101 107 begin 102 FLit:=x;103 Invalidate108 FLit := x; 109 Invalidate 104 110 end 105 111 end; … … 107 113 procedure TButtonN.SetIndex(x: integer); 108 114 begin 109 if x<>FIndex then115 if x <> FIndex then 110 116 begin 111 FIndex:=x; 112 if x<6 then BackIndex:=1 113 else BackIndex:=0; 114 Invalidate 117 FIndex := x; 118 if x < 6 then 119 BackIndex := 1 120 else 121 BackIndex := 0; 122 Invalidate 115 123 end 116 124 end; … … 118 126 procedure TButtonN.SetSmartHint(x: string); 119 127 begin 120 if x<>FSmartHint then128 if x <> FSmartHint then 121 129 begin 122 FSmartHint:=x; 123 if FPossible then Hint:=x; 130 FSmartHint := x; 131 if FPossible then 132 Hint := x; 124 133 end 125 134 end; 126 135 127 136 end. 128 -
trunk/Components/EOTButton.pas
r10 r14 8 8 9 9 const 10 eotBlinkOff=-1; eotCancel=0; eotGray=1; eotBlinkOn=2; eotBackToNego=3; 10 eotBlinkOff = -1; 11 eotCancel = 0; 12 eotGray = 1; 13 eotBlinkOn = 2; 14 eotBackToNego = 3; 11 15 12 16 type … … 15 19 destructor Destroy; override; 16 20 procedure SetButtonIndexFast(x: integer); 17 procedure SetBack(ca: TCanvas; x, y: integer);21 procedure SetBack(ca: TCanvas; x, y: integer); 18 22 private 19 23 FTemplate: TBitmap; … … 37 41 procedure Register; 38 42 begin 39 RegisterComponents('Samples', [TEOTButton]);43 RegisterComponents('Samples', [TEOTButton]); 40 44 end; 41 45 42 procedure ImageOp_CBC(Dst,Src: TBitmap; xDst,yDst,xSrc,ySrc,w,h,Color0,Color2: integer); 46 procedure ImageOp_CBC(Dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, w, h, Color0, 47 Color2: integer); 43 48 // Src is template 44 49 // B channel = Color0 amp … … 46 51 // R channel = Color2 amp 47 52 type 48 TLine=array[0..9999,0..2] of Byte;53 TLine = array [0 .. 9999, 0 .. 2] of Byte; 49 54 var 50 ix,iy,amp0,amp1,trans,Value: integer;51 SrcLine,DstLine: ^TLine;55 ix, iy, amp0, amp1, trans, Value: integer; 56 SrcLine, DstLine: ^TLine; 52 57 begin 53 for iy:=0 to h-1 do58 for iy := 0 to h - 1 do 54 59 begin 55 SrcLine:=Src.ScanLine[ySrc+iy];56 DstLine:=Dst.ScanLine[yDst+iy];57 for ix:=0 to w-1 do60 SrcLine := Src.ScanLine[ySrc + iy]; 61 DstLine := Dst.ScanLine[yDst + iy]; 62 for ix := 0 to w - 1 do 58 63 begin 59 trans:=SrcLine[xSrc+ix,0]*2; // green channel = transparency60 amp0:=SrcLine[xSrc+ix,1]*2;61 amp1:=SrcLine[xSrc+ix,2]*2;62 if trans<>$FF then64 trans := SrcLine[xSrc + ix, 0] * 2; // green channel = transparency 65 amp0 := SrcLine[xSrc + ix, 1] * 2; 66 amp1 := SrcLine[xSrc + ix, 2] * 2; 67 if trans <> $FF then 63 68 begin 64 Value:=(DstLine[xDst+ix][0]*trans+(Color2 shr 16 and $FF)*amp1+(Color0 shr 16 and $FF)*amp0) div $FF; 65 if Value<256 then 66 DstLine[xDst+ix][0]:=Value 67 else DstLine[xDst+ix][0]:=255; 68 Value:=(DstLine[xDst+ix][1]*trans+(Color2 shr 8 and $FF)*amp1+(Color0 shr 8 and $FF)*amp0) div $FF; 69 if Value<256 then 70 DstLine[xDst+ix][1]:=Value 71 else DstLine[xDst+ix][1]:=255; 72 Value:=(DstLine[xDst+ix][2]*trans+(Color2 and $FF)*amp1+(Color0 and $FF)*amp0) div $FF; 73 if Value<256 then 74 DstLine[xDst+ix][2]:=Value 75 else DstLine[xDst+ix][2]:=255; 69 Value := (DstLine[xDst + ix][0] * trans + (Color2 shr 16 and $FF) * amp1 70 + (Color0 shr 16 and $FF) * amp0) div $FF; 71 if Value < 256 then 72 DstLine[xDst + ix][0] := Value 73 else 74 DstLine[xDst + ix][0] := 255; 75 Value := (DstLine[xDst + ix][1] * trans + (Color2 shr 8 and $FF) * amp1 76 + (Color0 shr 8 and $FF) * amp0) div $FF; 77 if Value < 256 then 78 DstLine[xDst + ix][1] := Value 79 else 80 DstLine[xDst + ix][1] := 255; 81 Value := (DstLine[xDst + ix][2] * trans + (Color2 and $FF) * amp1 + 82 (Color0 and $FF) * amp0) div $FF; 83 if Value < 256 then 84 DstLine[xDst + ix][2] := Value 85 else 86 DstLine[xDst + ix][2] := 255; 76 87 end 77 88 end … … 81 92 constructor TEOTButton.Create; 82 93 begin 83 inherited Create(aOwner);84 Buffer:=TBitmap.Create;85 Buffer.PixelFormat:=pf24bit;86 Buffer.Width:=48;87 Buffer.Height:=48;88 Back:=TBitmap.Create;89 Back.PixelFormat:=pf24bit;90 Back.Width:=48;91 Back.Height:=48;92 ShowHint:=true;93 SetBounds(0,0,48,48);94 inherited Create(aOwner); 95 Buffer := TBitmap.Create; 96 Buffer.PixelFormat := pf24bit; 97 Buffer.Width := 48; 98 Buffer.Height := 48; 99 Back := TBitmap.Create; 100 Back.PixelFormat := pf24bit; 101 Back.Width := 48; 102 Back.Height := 48; 103 ShowHint := true; 104 SetBounds(0, 0, 48, 48); 94 105 end; 95 106 96 107 destructor TEOTButton.Destroy; 97 108 begin 98 Buffer.Free;99 Back.Free;100 inherited Destroy;109 Buffer.Free; 110 Back.Free; 111 inherited Destroy; 101 112 end; 102 113 103 114 procedure TEOTButton.Paint; 104 115 begin 105 with Canvas do106 if FGraphic<>nil then116 with Canvas do 117 if FGraphic <> nil then 107 118 begin 108 BitBlt(Buffer.Canvas.Handle,0,0,48,48,Back.Canvas.Handle,0,0,SRCCOPY); 109 ImageOp_CBC(Buffer, Template, 0, 0, 133, 149+48*byte(FDown), 48, 48, $000000, $FFFFFF); 110 if FIndex>=0 then 111 ImageOp_CBC(Buffer, Template, 8, 8, 1+32*byte(FIndex), 246, 32, 32, $000000, $FFFFFF); 112 BitBlt(Canvas.Handle,0,0,48,48,Buffer.Canvas.Handle,0,0,SRCCOPY); 119 BitBlt(Buffer.Canvas.Handle, 0, 0, 48, 48, Back.Canvas.Handle, 0, 120 0, SRCCOPY); 121 ImageOp_CBC(Buffer, Template, 0, 0, 133, 149 + 48 * Byte(FDown), 48, 48, 122 $000000, $FFFFFF); 123 if FIndex >= 0 then 124 ImageOp_CBC(Buffer, Template, 8, 8, 1 + 32 * Byte(FIndex), 246, 32, 32, 125 $000000, $FFFFFF); 126 BitBlt(Canvas.Handle, 0, 0, 48, 48, Buffer.Canvas.Handle, 0, 0, SRCCOPY); 113 127 end 114 else begin Brush.Color:=$0000FF; FrameRect(Rect(0,0,48,48)) end 128 else 129 begin 130 Brush.Color := $0000FF; 131 FrameRect(Rect(0, 0, 48, 48)) 132 end 115 133 end; 116 134 117 135 procedure TEOTButton.SetIndex(x: integer); 118 136 begin 119 if x<>FIndex then137 if x <> FIndex then 120 138 begin 121 FIndex:=x;122 Invalidate139 FIndex := x; 140 Invalidate 123 141 end 124 142 end; … … 126 144 procedure TEOTButton.SetButtonIndexFast(x: integer); 127 145 begin 128 if Visible and (x<>FIndex) then146 if Visible and (x <> FIndex) then 129 147 begin 130 FIndex:=x;131 try132 Paint133 except148 FIndex := x; 149 try 150 Paint 151 except 134 152 end 135 153 end 136 154 end; 137 155 138 procedure TEOTButton.SetBack(ca: TCanvas; x, y: integer);156 procedure TEOTButton.SetBack(ca: TCanvas; x, y: integer); 139 157 begin 140 BitBlt(Back.Canvas.Handle,0,0,48,48,ca.Handle,x,y,SRCCOPY);158 BitBlt(Back.Canvas.Handle, 0, 0, 48, 48, ca.Handle, x, y, SRCCOPY); 141 159 end; 142 160 143 161 end. 144
Note:
See TracChangeset
for help on using the changeset viewer.