TVirtualStringTree and multi line headers

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #41346
    Support
    Keymaster

      Hello and thanks for message.
      I will check it soon, but I think now, that you are right and a problem is in the AlphaControls package.

      #41354
      Truslew
      Participant

        I created a fix that works for me. See code market with //HTG

        procedure TacVirtualTreeViewWnd.AdvancedHeaderDraw(Sender: TPersistent; var PaintInfo: THeaderPaintInfo; const Elements: THeaderPaintElements);


        if hpeDropMark in Elements then begin
        {$IFDEF TNTUNICODE}
        Text := GetWideStrProp(PaintInfo.Column, 'Text');
        {$ELSE}
        Text := GetStrProp(PaintInfo.Column, 'Text');
        {$ENDIF}
        if Text <> '' then begin
        TextRC := PaintInfo.TextRectangle;
        OffsetRect(TextRC, -PaintInfo.PaintRectangle.Left, -PaintInfo.PaintRectangle.Top);

        HeaderProp := GetObjProp(SkinData.FOwnerControl, 'Header');
        if HeaderProp <> nil then begin
        FontProp := GetObjProp(HeaderProp, 'Font');
        if FontProp <> nil then begin
        Bmp.Canvas.Font.Assign(TFont(FontProp));
        end;
        end;

        // HTG
        Flag:=DT_VCENTER or DT_END_ELLIPSIS;
        if WrapCaption(PaintInfo.Column) then
        Flag:=Flag + DT_WORDBREAK
        else
        Flag:=Flag + DT_SINGLELINE;

        acWriteTextEx(Bmp.Canvas, PacChar(Text), True, TextRC, Flag, Si, (State <> 0), DefaultManager);
        // HTG
        end;
        end;

        function TacVirtualTreeViewWnd.WrapCaption(Column: TCollectionItem): Boolean;
        begin
        Result:= Pos('coWrapCaption', GetSetProp(PaintInfo.Column, 'Options'))>0;
        end;

        #41358
        Support
        Keymaster

          Thank you for this fix. I'll check it and code will be changed in the nearest release, I think.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.