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.
File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.