"Form", what is it? What's its purpose?

I’ve seen this here and there, not everywhere and tbh nothing in my stuff uses it and they’re working fine.

I’ve searched the wiki and the only two hits are javadocs for methods containing the word “Form” that isn’t in the parameters at all, so, what’s the point of it?

At the moment. it does nothing more than limit the TAB / SHIFT+TAB focus to the list of elements associated with the focus form. If you click on an element inside of another form, that one grabs focus and the TAB / SHIFT+TAB focus uses the new forms list of elements (controls)

Ok, I see. That’s what I had deduced even though it didn’t seem to work. Which probably has something to do with TABBING while not on focusing on a control.

While I’m at it, is there a plan to have modality working anytime soon?

@madjack said: While I'm at it, is there a plan to have modality working anytime soon?

O.o Explain more. Either coffee hasn’t started working yet… or I’m lost.

Dialogs, I can setIsModal on them, but it has no effect.

Actually you can set this on pretty much all elements if I’m not mistaken. Still, modality isn’t working.

Tell me, what does modal mean to you? For me and windows programming (I would imagine it’s the same way for other OSes), there are 3 modal types:

Usually modality is only applicable on panels, “parent elements” and such. There isn’t a point to put a TextField or a Checkbox modal tbh. For now, let’s call it “dialog”.

Non-modal: this is the default, the dialog will remain on top of all other elements. It will not interfere with other interactive elements around it. Of course it will stop the interaction with elements underneath it, like any other element.

App modal: As the previous except there is no possible interaction with any other control except those inside the dialog. Clicking outside the dialog usually generates a ping sound (on windows, might also do the same in other OSes).

System modal: This is as the previous except for the entire system. Think User Access Control in Windows where, as long as you haven’t made your choice, it’s not possible to do anything else. 99% of app don’t use that.

Mind if I add more stuff here?

Tooltips: there should be a time (default and settable) before it appears. Also it should disappear when an interaction starts with the control it’s tied to (like if I put a tooltip in a TextField, when I click on the field, the tip should go away.). Lastly, for some reason the tooltip is underneath the cursor. Usually it’s on top. :slight_smile:

@madjack said: Dialogs, I can setIsModal on them, but it has no effect.

Actually you can set this on pretty much all elements if I’m not mistaken. Still, modality isn’t working.

Tell me, what does modal mean to you? For me and windows programming (I would imagine it’s the same way for other OSes), there are 3 modal types:

Usually modality is only applicable on panels, “parent elements” and such. There isn’t a point to put a TextField or a Checkbox modal tbh. For now, let’s call it “dialog”.

Non-modal: this is the default, the dialog will remain on top of all other elements. It will not interfere with other interactive elements around it. Of course it will stop the interaction with elements underneath it, like any other element.

App modal: As the previous except there is no possible interaction with any other control except those inside the dialog. Clicking outside the dialog usually generates a ping sound (on windows, might also do the same in other OSes).

System modal: This is as the previous except for the entire system. Think User Access Control in Windows where, as long as you haven’t made your choice, it’s not possible to do anything else. 99% of app don’t use that.

I think I know what the issue is here. I made a (potentially bad) call with Modal.

setModal() effects elements that are contained within a control (I believe)
setGlobalModal() will have the effect you are looking for.

It is not intuitive (I know), but should work properly.

And yes… do continue to post here… will help me not have to bounce around and potentially miss something.

1 Like
@madjack said: Mind if I add more stuff here?

Tooltips: there should be a time (default and settable) before it appears. Also it should disappear when an interaction starts with the control it’s tied to (like if I put a tooltip in a TextField, when I click on the field, the tip should go away.). Lastly, for some reason the tooltip is underneath the cursor. Usually it’s on top. :slight_smile:

Ok… I like the delay and I’m not sure how the cursor thing would work… but!!! thankfully I know the guy that put together custom cursors for JME :wink:

EDIT: Side note about Global Modal… without a full screen element behind that modal object, it is only on top of all other elements. Elements beneath it are still click-able.

@t0neg0d said: setModal() effects elements that are contained within a control (I believe) setGlobalModal() will have the effect you are looking for.

From your explanation, I don’t see how setModal() can be used at all. You’d have to give me an example.

And yes... do continue to post here...

Will do.

@t0neg0d said: Ok... I like the delay and I'm not sure how the cursor thing would work.... but!!! thankfully I know the guy that put together custom cursors for JME ;)
Cursor? What? O_o
EDIT: Side note about Global Modal... without a full screen element behind that modal object, it is only on top of all other elements. Elements beneath it are still click-able.

Then modality is useless. :confused: The whole point of using modal is to stop interaction of elements underneath the dialog (a very large portion o the time anyway). Without that anyone can screw around with things that should not be. Like if you want to rename something, but the user close the window. Would that data still be valid? Etc.

Alternatively, create an invisible layer beneath the modal dialog stopping any interaction, or capture interactions before it’s passed down and deny it if it’s outside the dialog. You have access to all that data.

Got to make amends… Tooltips seem to be pretty much anywhere nowadays. Sometimes it’s above, other times underneath. Not sure why and that’s just on the Windows Desktop. O_O

Anyway, an option to set it above or underneath would be great either way.

@madjack said: Alternatively, create an invisible layer beneath the modal dialog stopping any interaction, or capture interactions before it's passed down and deny it if it's outside the dialog. You have access to all that data.

Actually… it has it’s uses without this… quite a few. But that doesn’t make it “modal” now does it =)

I use a semi-transparent full-screen element that displays right beneath modal windows. It greys out the screen behind it and makes everything else un-click-able. This can be fully transparent /shrug

Ok… I’m finally heading out for just a bit. I’ll check back as soon as I am home!

@t0neg0d said: Actually... it has it's uses without this... quite a few. But that doesn't make it "modal" now does it =)

I use a semi-transparent full-screen element that displays right beneath modal windows. It greys out the screen behind it and makes everything else un-click-able. This can be fully transparent /shrug

Ok… I’m finally heading out for just a bit. I’ll check back as soon as I am home!

Well, the only thing I can judge on is the sources I have here and isModal and isGlobalModal are set/get only in Element. Their methods are only used in Screen and SubScreen and only that way:

[java]@Override
public void updateZOrder(Element topMost) {
// zOrderCurrent = zOrderInit;
String topMostUID = topMost.getUID();
float shiftZ = topMost.getLocalTranslation().getZ();

	for (Element el : elements.values()) {
		if (topMost.getIsGlobalModal()) {  } // <-------- HERE
		else if (topMost.getIsModal()) {  } // <--------- HERE
		else {
			if (!el.getIsGlobalModal() && !el.getIsModal()) { // <--------- and HERE
				if (el.getLocalTranslation().getZ() > shiftZ) {
					el.move(0,0,-zOrderStepMajor);
				}
			}
		}
	}
	topMost.setLocalTranslation(topMost.getLocalTranslation().setZ(Float.valueOf(zOrderCurrent)));
}

[/java]

In both classes it’s the same method. So… I’m at a loss to explain that “semi-transparent full-screen” you are talking about in your reply. Where is this built? Is there some code you haven’t committed? Or have my searching skills really that bad? :stuck_out_tongue:

Oh boy.

It seems you use onGetFocus() / onLostFocus() as elements get hovered with the mouse.

Usually, in GUIs, an element is said to have the focus when they are fully interactive. TextInput accepting keystrokes, checkbox toggling, etc and have no relevance to where the mouse is.

This way you can do input validation with onLostFocus and other methods.

I found this when looking for a simple way to toggle tooltips. I wanted to do something like:

[java]
@Override
public void onGetFocus(MouseMotionEvent evt) {
if (getIsEnabled()) screen.setCursor(Screen.CursorType.TEXT);
setHasFocus(true);
((Screen) screen).setUseToolTips(false);
}
[/java]

But this can’t work since the tooltip is disabled as soon as the mouse enters hovering above the element, thus the tooltips are not displayed at all.

I’m not sure how this can be fixed (tooltips)…

Speaking of this, I noticed that the tooltips are taken care of in the Screen class? Why not use a decorated label in the element that you would turn visible/hide when needed? It would be MUCH simpler than what I’ve seen.

At least that’s what I think after checking the code.

I think I might let you fix/change stuff since you most likely know better how things are working internally. (I do hope so! :D)

And finally for today, could you comment line 1193 in TextField please? Thanks.

[java]
System.out.println(caretIndex + " : " + start + " : " + end);
[/java]

@madjack said: And finally for today, could you comment line 1193 in TextField please? Thanks.

[java]
System.out.println(caretIndex + " : " + start + " : " + end);
[/java]

Done… sorry about that. I’ll look through the rest of this after I finish up a couple things.

@madjack said: Well, the only thing I can judge on is the sources I have here and isModal and isGlobalModal are set/get only in Element. Their methods are only used in Screen and SubScreen and only that way:

[java]@Override
public void updateZOrder(Element topMost) {
// zOrderCurrent = zOrderInit;
String topMostUID = topMost.getUID();
float shiftZ = topMost.getLocalTranslation().getZ();

	for (Element el : elements.values()) {
		if (topMost.getIsGlobalModal()) {  } // <-------- HERE
		else if (topMost.getIsModal()) {  } // <--------- HERE
		else {
			if (!el.getIsGlobalModal() && !el.getIsModal()) { // <--------- and HERE
				if (el.getLocalTranslation().getZ() > shiftZ) {
					el.move(0,0,-zOrderStepMajor);
				}
			}
		}
	}
	topMost.setLocalTranslation(topMost.getLocalTranslation().setZ(Float.valueOf(zOrderCurrent)));
}

[/java]

In both classes it’s the same method. So… I’m at a loss to explain that “semi-transparent full-screen” you are talking about in your reply. Where is this built? Is there some code you haven’t committed? Or have my searching skills really that bad? :stuck_out_tongue:

Ugh… I missed this. No, this is in a project I am using the library in. I’ll add the one you put together into the screen class and just make the fullscreen transparent element reusable so it is only created once.