Hi Dennis,

Sorry for my late answer.

I looked at the following method:

ROPopup>>createElementFor: element
^ ROElement new
add: (ROElement new 
+ ((ROLabel 
text: (text roValue: element model)) color: textColor))
+ box copy;
yourself


and noticed some things:
• A ROElement is create inside another. Out of curiosity: why is this necessary?

Look at the following example:


The popup shows "hello" in a gray background. There are two elements here. The gray background and the white text.

• When doing ROElement new, these elements are NOT added to the same view, the given element is in, thus these elements dont use the same zOrdering. What view is this? Where is it from and why is it a different one?

You are very right. The two elements are not added in the same view. It took us some time to come up with that solution. The reason is that you do not want to have the same camera for the view and the popup. Consider the following example:

-=-=-=-=-=-=-=-=-=-=-=-=
| view el stack |
stack := ROViewStack new.
view := ROView new.
el := ROElement on: 123.
el + ROBox.
el @ (ROPopup new receivingView: stack).
el @ RODraggable.

view on: ROMouseClick do: [ :event | ROZoomInMove new on: view ].

view add: el.
stack addView: view.
stack open
-=-=-=-=-=-=-=-=-=-=-=-=

Do a bit of clicking on the background and raise the popup. You get something like:
The node is large and the popup has its original size.

Now, if you remove the "receivingView: stack" as in:
-=-=-=-=-=-=-=-=-=-=-=-=
| view el stack |
stack := ROViewStack new.
view := ROView new.
el := ROElement on: 123.
el + ROBox.
el @ (ROPopup new).
el @ RODraggable.

view on: ROMouseClick do: [ :event | ROZoomInMove new on: view ].

view add: el.
stack addView: view.
stack open
-=-=-=-=-=-=-=-=-=-=-=-=


You will have a big popup. Rather ugly isn't it?





• The created elements will have a zIndex of zero, since none is set.
To make popups work in the case a view uses ROBasicZOrdering I changed the method in the following way:

ROPopup>>createElementFor: element
^ (ROElement new view: element view; zIndex: element zIndex + 1; yourself)
add: ((ROElement new view: element view; zIndex: element zIndex + 1; yourself)
+ ((ROLabel 
text: (text roValue: element model)) color: textColor))
+ box copy;
yourself


These changes should not affect the normal use case.

I don't know if this is the correct way to do this, or if there are maybe underlaying issues with zIndex in general which should be adressed first.

What do you think?

If I understand correctly, you want to use the zIndex to always have the popup above the pointed element. Normally, this is not necessary since the popup is the last in the drawing queue (since it is added when a MOMouseEnter is raised). However, I see this is not always the case since you are using zIndexes: you may have elements with a different zIndex and the popup has still 0 as zIndex.

But why "+1" ? The popup should be above all the other nodes shouldn't it? It could therefore be 10000 instead no? 

I attached the code if you want to merge it in.

I have no problem to include your change, I am just trying to figure out the usage scenario first.

Cheers,
Alexandre


-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.