Changeset 14 for trunk/Components


Ignore:
Timestamp:
Jan 7, 2017, 8:54:23 PM (8 years ago)
Author:
chronos
Message:
  • Removed: Do not create file association at runtime as it is done by installer program.
  • Modified: Additional source formating using Delphi formatter.
Location:
trunk/Components
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/ButtonA.pas

    r10 r14  
    3030procedure Register;
    3131begin
    32 RegisterComponents('Samples', [TButtonA]);
     32  RegisterComponents('Samples', [TButtonA]);
    3333end;
    3434
    3535constructor TButtonA.Create(aOwner: TComponent);
    3636begin
    37 inherited Create(aOwner);
    38 FCaption:='';
    39 SetBounds(0,0,100,25);
     37  inherited Create(aOwner);
     38  FCaption := '';
     39  SetBounds(0, 0, 100, 25);
    4040end;
    4141
    4242procedure TButtonA.Paint;
    4343begin
    44 with Canvas do
    45   if FGraphic<>nil then
     44  with Canvas do
     45    if FGraphic <> nil then
    4646    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);
    5252    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
    5458end;
    5559
    5660procedure TButtonA.SetCaption(x: string);
    5761begin
    58 if x<>FCaption then
     62  if x <> FCaption then
    5963  begin
    60   FCaption:=x;
    61   Invalidate
     64    FCaption := x;
     65    Invalidate
    6266  end
    6367end;
     
    6569procedure TButtonA.SetFont(const x: TFont);
    6670begin
    67 Canvas.Font.Assign(x);
    68 Canvas.Font.Color:=$000000;
     71  Canvas.Font.Assign(x);
     72  Canvas.Font.Color := $000000;
    6973end;
    7074
    7175end.
    72 
  • trunk/Components/ButtonB.pas

    r10 r14  
    3030procedure Register;
    3131begin
    32 RegisterComponents('Samples', [TButtonB]);
     32  RegisterComponents('Samples', [TButtonB]);
    3333end;
    3434
    3535constructor TButtonB.Create(aOwner: TComponent);
    3636begin
    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);
    4040end;
    4141
    4242procedure TButtonB.Paint;
    4343begin
    44 with Canvas do
    45   if FGraphic<>nil then
     44  with Canvas do
     45    if FGraphic <> nil then
    4646    begin
    47     BitBlt(Canvas.Handle,0,0,25,25,FGraphic.Canvas.Handle,
    48       169,243+26*Byte(FDown),SRCCOPY);
    49     if FIndex>=0 then
     47      BitBlt(Canvas.Handle, 0, 0, 25, 25, FGraphic.Canvas.Handle, 169,
     48        243 + 26 * Byte(FDown), SRCCOPY);
     49      if FIndex >= 0 then
    5050      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);
    5555      end
    5656    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
    5862end;
    5963
    6064procedure TButtonB.SetIndex(x: integer);
    6165begin
    62 if x<>FIndex then
     66  if x <> FIndex then
    6367  begin
    64   FIndex:=x;
    65   Invalidate
     68    FIndex := x;
     69    Invalidate
    6670  end
    6771end;
    6872
    6973end.
    70 
  • trunk/Components/ButtonBase.pas

    r10 r14  
    1010    constructor Create(aOwner: TComponent); override;
    1111  protected
    12     FDown,FPermanent: boolean;
     12    FDown, FPermanent: boolean;
    1313    FGraphic: TBitmap;
    14 //    FDownSound, FUpSound: string;
     14    // FDownSound, FUpSound: string;
    1515    ClickProc: TNotifyEvent;
    1616    DownChangedProc: TNotifyEvent;
    1717    procedure SetDown(x: boolean);
    18 //    procedure PlayDownSound;
    19 //    procedure PlayUpSound;
     18    // procedure PlayDownSound;
     19    // procedure PlayUpSound;
    2020    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    2121      x, y: integer); override;
     
    2727  public
    2828    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;
    3131  published
    3232    property Visible;
     
    3434    property Permanent: boolean read FPermanent write FPermanent;
    3535    property OnClick: TNotifyEvent read ClickProc write ClickProc;
    36     property OnDownChanged: TNotifyEvent read DownChangedProc write DownChangedProc;
     36    property OnDownChanged: TNotifyEvent read DownChangedProc
     37      write DownChangedProc;
    3738  end;
    3839
    3940implementation
    4041
    41 //uses
    42 //  MMSystem;
     42// uses
     43// MMSystem;
    4344
    44 constructor TButtonBase.Create(AOwner: TComponent);
     45constructor TButtonBase.Create(aOwner: TComponent);
    4546begin
    4647  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;
    5155end;
    5256
    5357procedure TButtonBase.MouseDown(Button: TMouseButton; Shift: TShiftState;
    54       x, y: integer);
     58  x, y: integer);
    5559begin
    56   Active:=true;
    57   MouseMove(Shift,x,y)
     60  Active := true;
     61  MouseMove(Shift, x, y)
    5862end;
    5963
    6064procedure TButtonBase.MouseUp(Button: TMouseButton; Shift: TShiftState;
    61       x, y: integer);
     65  x, y: integer);
    6266begin
    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);
    6570  if Active and FDown then
    6671  begin
    67 // PlayUpSound;
    68   Active:=false;
    69   if FDown<>FPermanent then
     72    // PlayUpSound;
     73    Active := false;
     74    if FDown <> FPermanent then
    7075    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);
    7480    end;
    75   if (Button=mbLeft) and (@ClickProc<>nil) then ClickProc(self)
     81    if (Button = mbLeft) and (@ClickProc <> nil) then
     82      ClickProc(self)
    7683  end
    77 else
     84  else
    7885  begin
    79 // if FDown then PlayUpSound;
    80   Active:=false;
    81   if FDown then
     86    // if FDown then PlayUpSound;
     87    Active := false;
     88    if FDown then
    8289    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);
    8694    end;
    8795  end
     
    9098procedure TButtonBase.MouseMove(Shift: TShiftState; x, y: integer);
    9199begin
    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
    108119end;
    109120
    110121procedure TButtonBase.SetDown(x: boolean);
    111122begin
    112 FDown:=x;
    113 Invalidate
     123  FDown := x;
     124  Invalidate
    114125end;
    115126
    116 //procedure TButtonBase.PlayDownSound;
    117 //begin
    118 //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;
    120131
    121 //procedure TButtonBase.PlayUpSound;
    122 //begin
    123 //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;
    125136
    126137end.
    127 
  • trunk/Components/ButtonC.pas

    r10 r14  
    2727procedure Register;
    2828begin
    29 RegisterComponents('Samples', [TButtonC]);
     29  RegisterComponents('Samples', [TButtonC]);
    3030end;
    3131
    3232constructor TButtonC.Create(aOwner: TComponent);
    3333begin
    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);
    3737end;
    3838
    3939procedure TButtonC.Paint;
    4040begin
    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
    4650end;
    4751
    4852procedure TButtonC.SetIndex(x: integer);
    4953begin
    50 if x<>FIndex then
     54  if x <> FIndex then
    5155  begin
    52   FIndex:=x;
    53   Invalidate
     56    FIndex := x;
     57    Invalidate
    5458  end
    5559end;
    5660
    5761end.
    58 
  • trunk/Components/ButtonN.pas

    r10 r14  
    1212    FPossible, FLit: boolean;
    1313    FGraphic, FMask, FBackGraphic: TBitmap;
    14     FIndex,BackIndex: integer;
     14    FIndex, BackIndex: integer;
    1515    FSmartHint: string;
    1616    ChangeProc: TNotifyEvent;
     
    4040procedure Register;
    4141begin
    42 RegisterComponents('Samples', [TButtonN]);
     42  RegisterComponents('Samples', [TButtonN]);
    4343end;
    4444
    4545constructor TButtonN.Create(aOwner: TComponent);
    4646begin
    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);
    5656end;
    5757
    5858procedure TButtonN.Paint;
    5959begin
    60 with Canvas do
     60  with Canvas do
    6161  begin
    62   if FGraphic<>nil then
     62    if FGraphic <> nil then
    6363    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 then
     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 then
    6767      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);
    7272      end
    7373    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);
    7781  end
    7882end;
    7983
    8084procedure TButtonN.MouseDown(Button: TMouseButton; Shift: TShiftState;
    81       x, y: integer);
     85  x, y: integer);
    8286begin
    83 if FPossible and (Button=mbLeft) and (@ChangeProc<>nil) then
    84   ChangeProc(Self)
     87  if FPossible and (Button = mbLeft) and (@ChangeProc <> nil) then
     88    ChangeProc(Self)
    8589end;
    8690
    8791procedure TButtonN.SetPossible(x: boolean);
    8892begin
    89 if x<>FPossible then
     93  if x <> FPossible then
    9094  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
    95101  end
    96102end;
     
    98104procedure TButtonN.SetLit(x: boolean);
    99105begin
    100 if x<>FLit then
     106  if x <> FLit then
    101107  begin
    102   FLit:=x;
    103   Invalidate
     108    FLit := x;
     109    Invalidate
    104110  end
    105111end;
     
    107113procedure TButtonN.SetIndex(x: integer);
    108114begin
    109 if x<>FIndex then
     115  if x <> FIndex then
    110116  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
    115123  end
    116124end;
     
    118126procedure TButtonN.SetSmartHint(x: string);
    119127begin
    120 if x<>FSmartHint then
     128  if x <> FSmartHint then
    121129  begin
    122   FSmartHint:=x;
    123   if FPossible then Hint:=x;
     130    FSmartHint := x;
     131    if FPossible then
     132      Hint := x;
    124133  end
    125134end;
    126135
    127136end.
    128 
  • trunk/Components/EOTButton.pas

    r10 r14  
    88
    99const
    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;
    1115
    1216type
     
    1519    destructor Destroy; override;
    1620    procedure SetButtonIndexFast(x: integer);
    17     procedure SetBack(ca: TCanvas; x,y: integer);
     21    procedure SetBack(ca: TCanvas; x, y: integer);
    1822  private
    1923    FTemplate: TBitmap;
     
    3741procedure Register;
    3842begin
    39 RegisterComponents('Samples', [TEOTButton]);
     43  RegisterComponents('Samples', [TEOTButton]);
    4044end;
    4145
    42 procedure ImageOp_CBC(Dst,Src: TBitmap; xDst,yDst,xSrc,ySrc,w,h,Color0,Color2: integer);
     46procedure ImageOp_CBC(Dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, w, h, Color0,
     47  Color2: integer);
    4348// Src is template
    4449// B channel = Color0 amp
     
    4651// R channel = Color2 amp
    4752type
    48 TLine=array[0..9999,0..2] of Byte;
     53  TLine = array [0 .. 9999, 0 .. 2] of Byte;
    4954var
    50 ix,iy,amp0,amp1,trans,Value: integer;
    51 SrcLine,DstLine: ^TLine;
     55  ix, iy, amp0, amp1, trans, Value: integer;
     56  SrcLine, DstLine: ^TLine;
    5257begin
    53 for iy:=0 to h-1 do
     58  for iy := 0 to h - 1 do
    5459  begin
    55   SrcLine:=Src.ScanLine[ySrc+iy];
    56   DstLine:=Dst.ScanLine[yDst+iy];
    57   for ix:=0 to w-1 do
     60    SrcLine := Src.ScanLine[ySrc + iy];
     61    DstLine := Dst.ScanLine[yDst + iy];
     62    for ix := 0 to w - 1 do
    5863    begin
    59     trans:=SrcLine[xSrc+ix,0]*2; // green channel = transparency
    60     amp0:=SrcLine[xSrc+ix,1]*2;
    61     amp1:=SrcLine[xSrc+ix,2]*2;
    62     if trans<>$FF then
     64      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
    6368      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;
    7687      end
    7788    end
     
    8192constructor TEOTButton.Create;
    8293begin
    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);
    94105end;
    95106
    96107destructor TEOTButton.Destroy;
    97108begin
    98 Buffer.Free;
    99 Back.Free;
    100 inherited Destroy;
     109  Buffer.Free;
     110  Back.Free;
     111  inherited Destroy;
    101112end;
    102113
    103114procedure TEOTButton.Paint;
    104115begin
    105 with Canvas do
    106   if FGraphic<>nil then
     116  with Canvas do
     117    if FGraphic <> nil then
    107118    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);
    113127    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
    115133end;
    116134
    117135procedure TEOTButton.SetIndex(x: integer);
    118136begin
    119 if x<>FIndex then
     137  if x <> FIndex then
    120138  begin
    121   FIndex:=x;
    122   Invalidate
     139    FIndex := x;
     140    Invalidate
    123141  end
    124142end;
     
    126144procedure TEOTButton.SetButtonIndexFast(x: integer);
    127145begin
    128 if Visible and (x<>FIndex) then
     146  if Visible and (x <> FIndex) then
    129147  begin
    130   FIndex:=x;
    131   try
    132     Paint
    133   except
     148    FIndex := x;
     149    try
     150      Paint
     151    except
    134152    end
    135153  end
    136154end;
    137155
    138 procedure TEOTButton.SetBack(ca: TCanvas; x,y: integer);
     156procedure TEOTButton.SetBack(ca: TCanvas; x, y: integer);
    139157begin
    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);
    141159end;
    142160
    143161end.
    144 
Note: See TracChangeset for help on using the changeset viewer.