Changeset 115 for trunk/UGame.pas


Ignore:
Timestamp:
Dec 10, 2016, 3:52:26 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: In Debug mode also check executed classes references.
  • Modified: Better About dialog.
  • Modified: About and Help dialogs are created in time when they are shown.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r106 r115  
    139139
    140140  TCanvasEx = class(TCanvas)
    141     procedure TextOutEx(X,Y: Integer; const Text: string; MovePen: Boolean = True);
    142     procedure PolygonEx(const Points: array of TPoint; Winding: Boolean);
     141    class procedure TextOutEx(Canvas: TCanvas; X,Y: Integer; const Text: string; MovePen: Boolean = True);
     142    class procedure PolygonEx(Canvas: TCanvas; const Points: array of TPoint; Winding: Boolean);
    143143  end;
    144144
     
    874874{ TCanvasEx }
    875875
    876 procedure TCanvasEx.TextOutEx(X, Y: Integer; const Text: string;
     876class procedure TCanvasEx.TextOutEx(Canvas: TCanvas; X, Y: Integer; const Text: string;
    877877  MovePen: Boolean);
    878878var
    879879  Flags : Cardinal;
    880880begin
    881   Changing;
    882   RequiredState([csHandleValid, csFontValid, csBrushValid]);
    883   Flags := 0;
    884   if TextStyle.Opaque then
    885     Flags := ETO_Opaque;
    886   ExtUTF8Out(Handle, X, Y, Flags, nil, PChar(Text), Length(Text), nil);
    887   if MovePen then MoveTo(X + TextWidth(Text), Y);
    888   Changed;
    889 end;
    890 
    891 procedure TCanvasEx.PolygonEx(const Points: array of TPoint; Winding: Boolean);
     881  with Canvas do begin
     882    Changing;
     883    RequiredState([csHandleValid, csFontValid, csBrushValid]);
     884    Flags := 0;
     885    if TextStyle.Opaque then
     886      Flags := ETO_Opaque;
     887    ExtUTF8Out(Handle, X, Y, Flags, nil, PChar(Text), Length(Text), nil);
     888    if MovePen then MoveTo(X + TextWidth(Text), Y);
     889    Changed;
     890  end;
     891end;
     892
     893class procedure TCanvasEx.PolygonEx(Canvas: TCanvas; const Points: array of TPoint; Winding: Boolean);
    892894begin
    893895  //Changing;
    894896  //RequiredState([csHandleValid, csBrushValid, csPenValid]);
    895   LCLIntf.Polygon(Handle, @Points[0], Length(Points), Winding);
     897  LCLIntf.Polygon(Canvas.Handle, @Points[0], Length(Points), Winding);
    896898  //Changed;
    897899end;
     
    12971299    Brush.Style := bsSolid;
    12981300    //Polygon(Points, False, 0, Length(Points));
    1299     TCanvasEx(Canvas).PolygonEx(Points, False);
     1301    TCanvasEx.PolygonEx(Canvas, Points, False);
    13001302    //MoveTo(Points[0].X, Points[0].Y);
    13011303    //LineTo(Points[1].X, Points[1].Y);
     
    13091311      TextPos := View.CellToCanvasPos(Pos);
    13101312      TextSize := TextExtent(Text);
    1311       TCanvasEx(Canvas).TextOutEx(Round(TextPos.X) - TextSize.cx div 2,
     1313      TCanvasEx.TextOutEx(Canvas, Round(TextPos.X) - TextSize.cx div 2,
    13121314        Round(TextPos.Y) - TextSize.cy div 2, Text, False);
    13131315    end;
Note: See TracChangeset for help on using the changeset viewer.