How to modify the focus-box color in TVirtualStringTree? - delphi

I need to modify the focus-box's border color of TVirtualStringTree,
just like this pic:

You can't control the color of the dotted focus rectangle. That's determined automatically by inverting the color of whatever it's drawn on. The OS provides ā€” and the tree control uses ā€” an API for that. (You could edit the source code and replace calls to DrawFocusRect with your own function, if you want.)
If you're talking about the color of the whole node, then first check to make sure the toUseBlendedSelection paint option is set the way you want it. It defaults off, but since it makes the selection rectangle look cool when dragging a box around items, you might have turned it on without realizing what it does to ordinary selected nodes, too.
If that's not it, then adjust one of the values in the tree control's Colors property, probably either FocusedSelectionColor or UnfocusedSelectionColor. But please don't make such a change lightly; the user has chosen the selection color through the OS options, so you probably shouldn't change it. If you do use a different color, make sure the text is still readable against whatever new color you select.

You can set treeview's option toHideFocusRectangle to true and paint your focus rectangle by yourself in one of several paint events (basically it is enough to use OnBeforeCellPaint).

Related

How to style the transform anchors on a Konva element?

How do I style the transform anchors (e.g., blue boxes) on a transformable Konva element? Note I'm using Konva with konva-react.
Example 1:
In other words, what if I wanted to make the boxes grey, and semi-transparent? Or change the size?
Example 2:
Or, what if I waned to remove the anchors and make the entire edge of a Rect able to be grabbed to resize? In other words, make the anchor transparent and full-height/full-width.
Iā€™d start your research using the elements from this example:
https://konvajs.org/docs/sandbox/Image_Resize.html
It shows that the transformer has various bits you can style in your own way. Good luck with that.

Different colored segmented lines imagej

I'm trying to make assign colors to individual segmented lines using ROI Manager. Every time I make a selection and change the color in properties, the line reverts to its original color as soon as I click back on my image. How can I assign colors to individual lines and get them to stick? Thanks

how to change a point color, style or size in line chart using achartengine android

I'm developing an app now with achartengine to draw a line chart. Now I have a problem with an effect that I hope to fix. The effect is, when users touch a point on the line chart the color or style of point can be changed to different color or style. But the other points should remain the same as before.
I was not able to find any function to set a point color or style on achartengine API document.
Can someone please point me to any documentation that can help me with my problem?
There isn't such API available. However, you could create a temporary series that would contain one single point (the selected one), add it only as long as you need it and when no longer needed, just remove it from the dataset.

Implementing a 'tag panel' control in Delphi?

Please have a look at this screenshot
alt text http://www.maclife.com/files/u18/Yep3-big.jpg
I think these are the main features of such a 'tag panel':
1) Each tag on the panel is a standalone control and can be clicked
2) Auto line wrapping when there is not enough space to show the next tag in the current line.
3) Rounded corner rectangle border for each tag is a nice-to-have feature.
I want to implement the similar function in Delphi, Is there an existing control to do this? If not, what's the best way to implement such a control?
Thank you.
When you are on a recent Delphi version use a TFlowPanel and some appropriate controls for the tags. A simple TButton or a TLinkLabel should do for that.
Each clickable tag doesn't necessarily have to be its own control. It just has to be a region that you can detect being clicked.
Suppose you represent each area as a Windows region. You can figure out how wide each one should be based on its text with the TCanvas.TextExtent function. Then create a region with a function like CreateRectRgn. For rounded corners, try CreateRoundRectRgn instead. You can test for mouse events in each region with the PtInRegion function. You can paint borders around them with FrameRgn. The last obstacle is to draw them on the screen so they'll all fit. You're creating the regions and you know their widths, so assign tags to a row until you run out of space, and then start the next line.
There are two possible solutions to custom alignment in Delphi 7. You can make your own flowpanel by deriving from TCustomPanel and override the AlignControls( )-method, or you can set alignment to alCustom and handle the OnAlignPosition-event.
I guess I would have gone for the TCustomPanel-derivative option. TFlowPanel in form Delphi 2007 uses that option- I have to admit, though, that I have never tried either my self...

BiDi text in Delphi - How do you select text to edit by language like this pic?

I saw this picture and now wondering if/how you can do this in Delphi. The highlighted/selected text shows two forms of formatting, i.e. highlight color and hash lines.
http://img9.imageshack.us/img9/4121/easilyselecttextofonela.jpg
I've done something very similar recently in a bible application, also done in Delphi.
The user can select a single verse and single words of the selected verses. (But this feature is not released yet, so don't bother looking for it)
I used the web browser control from Microsoft and added my own kind of selection handling.
I've done the formatting by enclosing the relevant parts with span elements and changing their CSS style. When the selection gets removed, I also remove the enclosing elements.
The hard part was backing the "visual" selections with a selection data structure and handling all the selection events (clicking, shift-clicking, shift-ctrl-clicking, ...)
Embedding IE seems to be an easier way to do this as DR says, but you can also do this manually by drawing it all on a canvas, an easy way would be to create two bitmaps (one without a selection and another selected (could be as complicated as you like - dashed, colored, ... )), and you need to know the positions/rects of all your characters which would be somewhat difficult for long texts.
You basically show the unselected bitmap, and overlap the selected parts by portions of the second image.
You would also need to handle the selection manually by OnMouseDown, OnMouseMove, OnMouseUp...

Resources