How to use TVirtualStringTree to display multi-line items and "expanded" select item? - delphi

I'm looking to create a look similar to the image below (which I know was done using TVirtualStringTree), but I haven't found any example code on how to accomplish this.
Anyone knows how I can have multi-line items like on the example below, and "expand" the select item to show more lines?

Please take a look at VT Demos\Advenced. In there you have a Multiline nodes demo which I guess might be the thing you are looking for.
Demos can be found here
Edit: The download page is here and the third item is the demos.

I guess you've got an answer, but I'll give you a couple hints for putting this into practice because it's been a little wonky for me. (At least in Delphi 7)
If you do a #13#10 for a new line make sure you've got a space after the the #10, otherwise you will not get a line break.
VirtualTree.MultiLine[node] := true will allow multi line, but not necessarily make it multiline.
Do VirtualTree.InvalidateNode(Node) then VirtualTree.Refresh the tree to get the new size for the node after you've changed the caption.

Related

How to change the order of items in the algebra view of geogebra?

I'm using GeoGebra Classic 5 and have a bigger project where I've encountered the problem that I can't find any way to change the order of elements in the list of the algebra view after the elements are created. Sure I could of course just delete the affected elements and create them in the right order but I'm sure there must be a better solution to such a simple problem.
Here you see what it looks like right now, and how I would like it to look
I've tried looking through the properties panel and all the navbar buttons but there seems to be no way to change the order of the list. The only thing I've found is the "sort by" setting that changes the order but doesn't let the user decide the order other than some predefined sortings. I also haven't been able to find anything about this on google or the geogebra documentation. Hope you can help

XtraReport text overflow cutting text in half vertically

I have an XtraReport that overflows text on to the next page but occasionally cuts the last line of text from the first page in half when it does.
I would normally handle this with the height property of the text area but I am unsure how to target a specific table row of an XtraReport to work out what the remaining height of the page is to achieve this or whether that would even work in this instance.
I'm rather hoping there's a simple work around to achieve this, please don't go too much out of your way to help out as I won't be investing much development on this.
I don't think there are any settings I have missed within the designer, perhaps there's a golden font size or line height that the reports want to overflow correctly.
Any help or direction would be greatly appreciated, thank you.
If there is no simple way, I will just have to loop through the tr / td tags and see if by manipulating the height I can find that sweet spot, i just worry that it will hide page 1 but still be split on page 2.
It seems to me that you use the ASPx/MVCx -DocumentViewer,
this control shows you a html content which is not suitable for pixel-perfect documents.
I recommend you to try the ASPx/MVCx WebDocumentViewer which is like the the Google Docs shows pixel-perfect document and more convenient with bootstrap and other progressive web frameworks.
here are demo and docs.

nsISelectionDisplay custom highlight controller? (related to nsISelectionController)

I made an addon HiliteOnSelection, when hilight something it uses the SELECTION_FIND context to highlight other instances. The issue with this is that highlight all feature of find bar uses same controller.
http://mxr.mozilla.org/mozilla-release/source/content/base/public/nsISelectionController.idl#30
Can you please help me to figure out how to create my custom highlight controller and how to style it, the SELECTION_FIND is pink.
This is how i get the selection_find context/controller and highlight with it:
https://addons.mozilla.org/en-US/firefox/files/browse/247620/file/bootstrap.js#L147
let findSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
findSelection.addRange(aRange);
I got this reply from the addon author. He's a nice guy:
Hey Noitidart,
You might find this one helpful:
https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsISelectionController
I'm hardly the master you think I am, actually. :) To change those
colors I just change the values for preferences:
ui.textHighlightBackground ui.textHighlightForeground
ui.textSelectBackgroundAttention -> SELECTION_ATTENTION, it's not a
highlight, it's a normal selection (as you would select some text with
your mouse and it would turn the regular blue blackground, in windows
at least) but it's given "attention", so it has the green background
that the find operation reports. Basically it's a way of showing the
user "Here I am!!" after firefox automatically selecs the text he
searched for.
And I really don't know most of those contants, SELECTION_NORMAL is
for normal text selection, like it would be when you select text with
your mouse, SELECTION_FIND is for the highlights, and I only know the
ON/HIDDEN/OFF/DISABLED ones which are self-explanatory.
SELECTION_SPELLCHECK is probably for the auto-correct when you are
typing in an editable content node, but I'm just guessing that one
from the name.
Also, as far as I know, it's not possible to just create custom
selection ranges/contants, as the code simply won't recognize them
without editing the C++ code as well. Which is actually one of the
reasons I haven't implemented
https://github.com/Quicksaver/FindBar-Tweak/issues/76 yet.
Hope any of this helps. I'm sorry to disappoint on the custom
controller thing.
Luís Miguel
So he changes the colors with a simple pref change. I'm going to have to dig into how that pref changes it.
He also thinks its not possible to create custom controllers without C++, I hope this is not true I'll keep digging if anyone can help that would be great.

First node stays on top

I want the first node to stay on top and should not be affected during scroll. The first node will be like a column header(stays on top even scrolling). How can I do that?
This kind of behavior is something you can currently find in spreasheets:
Lock first column (Header.Columns[0].Options → coFixed)
Lock first row (?)
I'm trying to insert a picture for more explanation but I don't have 10 reputations. Sorry about that. Thanks in advance.
You can't as VirtualTree doesn't support such a behaviour. Besides, VT already has header support (include hoVisible to Header.Options to show it) why don't you use that? You can custom paint it (see OnHeaderDraw events) if you want it to look like ordinary node.

Replace keywords by images in TextField

I have some textfield with text like "Click #button1, then #button2". Have you got any idea how to replace keywords by images ? I must do it in AS2 :/ I know there is htmlText in textField, but useing it I can only use one image, and image can only align left or right site.
Very advanced stuff. I can tell you there is no 'out of the box' solution like using html text fields or something similar. Especially if you want to mimic nearly html behaviour you have to code advanced routines that can : 1. recognize your keywords. You should google for tokenizers and 2. layout textfields according to occuring images and textblocks. Again, thats advanced!

Resources