1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

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
    Offline

    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