TVirtualStringTree and multi line headers

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33459
    Truslew
    Participant

    Hi,

    setting the coWrapCaption have no effect when skinning is active. coWrapCaption works well when SkinManger.Active=False.

    I is in my first project using AlphaSkins, so there might be something I have missed….

    Regards
    henning

    #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 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.