Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Firemonkey Grid align text columns to right!?

Discussion in 'Delphi Help&Requests' started by pumidru, Sep 30, 2014.

  1. pumidru
    Online

    pumidru DF Junior

    I use this code for align text columns to right:

    Code:
    procedure TfrmListArt.StringGrid1DrawColumnCell(Sender: TObject;
      const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF;
      const Row: Integer; const Value: TValue; const State: TGridDrawStates);
    const
    HorzTextMargin = 0;
    VertTextMargin = 0;
    var
    TextLayout : TTextLayout;
    TextRect: TRectF;
    i :integer;
    s : string;
    begin
    if  (Column.Header = 'PREZZO1')   then  begin
        TextRect := Bounds;
        Canvas.FillRect(Bounds, 0, 0, AllCorners, 2);
    
        TextLayout := TTextLayoutManager.DefaultTextLayout.Create;
        try
          TextLayout.BeginUpdate;
          try
            TextLayout.WordWrap := False;
            TextLayout.Opacity := Column.AbsoluteOpacity;
            TextLayout.HorizontalAlign := TTextAlign.taTrailing;
            TextLayout.VerticalAlign := StringGrid1.TextSettings.VertAlign;
            TextLayout.Trimming := TTextTrimming.Character;
            TextLayout.TopLeft := TextRect.TopLeft;
            s := Value.ToString;
            TextLayout.Text := S;
            TextLayout.MaxSize := PointF(TextRect.Width, TextRect.Height+4);
    
    
            TextLayout.Font.Family := 'Times New Roman';
      
            TextLayout.Color :=  TAlphaColorRec.Black;
          finally
            TextLayout.EndUpdate;
          end;
          TextLayout.RenderLayout(Canvas);
        finally
          TextLayout.Free;
        end;
      end;
    
    end;
    
    This procedure redraw columns PREZZO but not draw color focus row with image 

    Please, help me!

    Thanks
     

    Attached Files:

    • gr1.PNG
      gr1.PNG
      File size:
      7.5 KB
      Views:
      19
  2. gald3
    Offline

    gald3 DF Member

    Fimonkey don't have even a RichView. You can wait for a webbrowser on XE3423 to Android 98.2.34 in next century. Use TMS grid. Native controls has development troubles. Maybe it's another team that was not fired yet!

    Also, your labels are in the same way as here, like non anti-aliasing. I don't know how to explain, but is soo diffent...

    Look at this image that i did now to compare:

    [img=563x207]http://s27.postimg.org/pb3e5s0oz/Difference.png[/img]
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block