Tree dataTipFunction tooltip Change position,Flex3 - apache-flex

I am doing dataTipFunction on Tree in Flex3 Air,
At present the tooltip hides the present node, i need to reposition the tooltip above the node, how can change the x,y position of the tooltip.
Thanks in Advance

The way I did this was to add the toolTipShown listener on the tree itemRenderer, not on the tree. I have a blog post that shows you how to do it, including the code for positioning the tooltip below or above the node.

Hook into the tooltipShow event on the Tree and move the tooltip yourself (a reference to the tooltip is in the event)
tooltipShow
You might need to do a bit of logic to position it correctly, and you'll probably want to check if repositioning it would move it off screen and move it below instead in that case.

Related

How to temporarily hide elements while designing in Gluon Scene Builder?

I have complex design that has several layers on top of each other. Problem is that if I click on object, other object that on top of it gets selected. How I can switch off visibility of my top objects while working on my bottom layer, so that they won't get in the way?
I finally found how to achieve what I wanted. Just select element that in the way and in properties remove tick from visible. Now you can design without anything obstructing your view! Just don't forget to make visible all elements before you save your work.

Show child QWidget out of parent QWidget area

I've got QListWidget as a child inside QPlainTextEdit for purposes of completion suggestions.
Suggestion list is displayed under cursor and when line is almost full, part of list widget is cropped by the border of text edit. Is there any possibility to force child widget show out of parent widget region?
An idea I have, is to make the text and list edit elements "siblings", i. e. add them to the same parent. But this would require my event handling mechanism (as I suppose parent-child relation between those two elements).
I think there must be a way to achieve this, as I studied Katepart component and there is KateCompletionWidget (displays suggestions) that is direct child of KateView and when I run it (e. g. Kate text editor), the list is shown across text edit border.
There's no way for a child to paint outside of a parent's QWidget rect, unfortunately. Your sibling approach is a popular solution to this problem. Another approach is for the child to notify the parent of what it wants to draw, but this can be a bit more advanced because you have to re-implement paint events.
Today I found a possibly viable way -- it's based on setWindowFlags(Qt::ToolTip) method of QListWidget element. There's, however, some slight change in positioning and event handling.

adding child on canvas and set it "on-top" when clicking the mouse

I need to add an UIComponent (Label for example) as a child on a canvas and I need to set it on-top (when user click on the label with the mouse, the target event will be the label and not the canvas)
I'm sure flash has a solution for that but I can't find it on the net.
any help?
Best regards.
elad.
I'm not entirely sure I understand what "Set it on top" means.
If you want a Label to respond to mouse events, you may have to set the buttomMode property to true.
If you want to swap the Z-Order of different components in your canvas, you can use the swapChildren or swapChildrenAt methods.
If you want to the label to somehow become the parent of the canvas, and the canvas a child of the label, you have a long and difficult road ahead of you.

Flex 4 ItemRenderer Question

I have a DataGroup with a Custom ItemRenderer. Within the itemrenderer, there are 2 states. normal and hovered. I have a <s:Group> within the itemrenderer that shows a bunch of data but i only want to be shown when hovered so I can do includeIn="hovered" which is good.
the problem is the x,y position of this group needs to be outside the bounds of the container itself. much like a tooltip only that this is not a tooltip.
whatever i do, it stays within the bounds of the datagroup. any ideas? or am I missing something simple here?
The behavior you are describing sounds an awful lot like a tooltip/datatip. Why not create your own tooltip skin and assign it to your renderer instead of re-inventing tooltips?
EDIT: Based on the comment below, the approach I would consider is to show a custom skinned Panel or ToolTip when entering the hovered state using the PopUpManager.addPopUp method. After adding it, then position it where ever you like. You'll probably need to change the local coordinates to the global coordinates when moving your popup. Then call PopUpManager.removePopUp when exiting the hovered state. Hope that helps.

Flex: Setting the resgistration point on a display object

What is the best way to change/set a registration point on a Flex 3 display object? I know this isn't really built in to easily change, but does anyone have any suggestions on how I could extend UIComponent to achieve this?
For some reason, the Flash Player API doesn't expose the registration point of DisplayObjects (and the Flash IDE makes them a pain to modify once an object is created). The best solution, as David pointed out, is to add your component as a child of another component (UIComponent would be fine). So, for example, if I had a Button and I wanted its registration point at its center, I'd add it as a child of a UIComponent (not Canvas) and offset the child by setting its position to (-button.width/2, -button.height/2).
Put your DisplayObject inside a sprite and set the DisplayObject's x & y positions to the negitive of your target registration point. Apply all transforms to the Sprite container.
Put it inside a Canvas container, with its clipContent attribute set to false. Within the canvas, you can put your object wherever you like.

Resources