Ignore:
Timestamp:
Jan 7, 2017, 8:54:23 PM (7 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.