C++Builder 5 Set TDBChart Series Visible - c++builder

Does anyone know how you can configure the visibility of a TeeChart Series programmatically in C++? I can't seem to find the right proprety using the auto completion.
I basically want to set Series1 visible at certain times and Series2 invisible, and the other way round following different conditions.
What I basically want is something to this effect :
Series1->Visible = false;
Series2->Visible = true;
except that this doesn't work.
If anyone could help, that would be greatly appreciated.
Chris

Found the answer to my own question. The property is "Active" - don't know why I didn't think of it before.
C++ :
Series1->Active = False;
Series2->Active = True;
EDIT : Beware, even if you change the title of your series, the "real" name to use in this code will probably still be Series1/2/... . This is because every Series you create (by right clicking on the TDBChart->Chart->Series->Add) creates a TBarSerie which seemingly can only be accessed from the Object inspector. The title you give it doesn't affect its real name.
Thanks for your comment, Narcis Calvet.

Related

How to revert/reverse/undo setSize() in Highcharts

Question asked because I spent a while trying to solve this and the answer isn't easily Google-able:
If I've manually set the size of a chart how do I make it go back to how it was before I did so?
(Question left deliberately ambiguous as I have found two distinct answers).
You might want to do one of 2 things:
Go back to the previous fixed size.
Go back to the size being variable according the size of the containing element.
For #1, you can collect (and thus store for later resetting) the current size of the chart BEFORE you call the setSize() by calling chart.chartHeight or chart.chartWidth (where var chart = $('#chart-container').highcharts();), then just call setSize() again with the original values.
For #2, after you've called setSize() post-print, the chart will no-longer auto-size itself if the window changes. You can fix that by using the 'hack' detailed here: Is modifying chart.hasUserSize a bad idea after calling Chart.setSize()?
Which consists of setting chart.hasUserSize = false;

TListBoxItem.ItemData.Details doesn't work

My situation is illustrated/explained with this screenshot :
http://www.evolutiongraph.fr/chevereto/images/2015/02/11/Capture.jpg
In my ListBox, I want to display a text (titles), and details (articles) ; but it doesn't work : titles work perfectly, but ItemData.Details is not displayed, I don't know why :/
The variable desc is not empty, I've tested it. ItemData.Details still not appear.
Help me please :)
You need to modify the TListBoxItem's StyleLookup to one which supports showing details. For example, listboxitembottomdetail. Keep in mind this property is changed on an item-by-item basis, not necessarily the entire list. You can specify this to be the default item style (for all new items) by modifying TListBox.DefaultItemStyles.ItemStyle rather than each individual item.

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.

How to remove all the grips on a coolbar if I have several coolbands?

If I set mycoolbar.fixedorder to true,only the grip on the first band will be hidden.
Well,If you use Delphi 7 to create an VCL Forms application,then put a coolbar on it and create 3 coolbans to hold other controls,only the grip and the top coolbands can be hidden by setting mycoolbar.fixedorder:=true.
I've uploaded a picture to make things clear.
You probably got a FixedOrder property wrong. The fixed property does not allow bands to be rearranged if set to True.
Setting up property of CoolBar to True keep user from changing the bands order at runtime, but the user can still move and resize the bands. I can actually give you advice what you can do, but the actual solution for your problem, well, you will have to wait for another answer.
My advice is to use three CoolBars in a row and setting their "FixedOrder" property to True and BandBorderStyle to bsNone. That way the grip will be hidden on all of them.
About the property, it's not a bug of IDE, it is the actual preference of the property.

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

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.

Resources