Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TElXTree: How to display multi-line text for a memo field?

In the forum article   Another TElXTree bug with UseCustomScrollBar = false, the memo field is displayed on several lines and the Item's rowheight is increased to accommodate it.
How is this done?
Is it possible to have a fixed number of rows displayed or the full number? It would be nice to have these as options.
Does it print multi-line? If so, how?
Thanks.
Raymond

Comments

  • 7 Comments sorted by Votes Date Added
  • >>How is this done?<<
    Actually you can specify this feature for each indidual item (see e.g. the designtime editor for item). Example:
    ElXTree.Items[0].Multiline := false;
    ElXTree.Items[0].WordWrap := false;
    ElXTree.Items[0].Height := 50;



  • I would like an option to set the number of MaximumLines for each row as a default for new items and be able to alter this quantity for individual items.

    Using the Height for this is for the component code, not for developer code.

    I tried 
        NewItem.MultiLine       := True;
        NewItem.WordWrap        := False;
        NewItem.Height          := 50; // 3 * NewItem.Height;
    and
        NewItem.MultiLine       := False;
        NewItem.WordWrap        := False;
        NewItem.Height          := 50; // 3 * NewItem.Height;

    but I do not see more than one line.

    AdjustMultiLineHeight := True.

    What else needs to be done?

    Raymond

  • I am sorry, example was certainly perfectly wrong (copy&paste error):
    ElXTree.Items[0].Multiline := true;
    ElXTree.Items[0].WordWrap := true;
    ElXTree.Items[0].Height := 50;

    If you don't enable Wordwap, there will be certainly no lines.
  • Also, it would be useful to have a property named like ElXTree.AutoItemHeight : Boolean that the XTree would then, if true, include as many lines as is necessary to display all the lines.

    Raymond
  • I have set the following for all lines as they are read in from a file.

    NewItem.Multiline := true;
    NewItem.WordWrap := true;
    NewItem.Height := 50;

    All rows are wordwrapped and multi-line, but only the first is 3 lines in height. All of the other lines show the tops of the 2nd line, but are still only one line in height.

    What can I do to make this work?

    Thanks.

    Raymond


  • >>What can I do to make this work?<<
    Without seeing the effect / parths of the code one can only guess. 
    Only issue I can imagine that you don't switch of/prohibit repaints (using the Update) pattern while you are reading in the lines.
Sign In or Register to comment.