Creating a 'Popup'

Sorry … another request :S

I am trying to write an alternative to the Menu control (but I don’t want to extend Menu) itself. This is all fine, and it all works except for one thing, where you click anywhere else on the Screen to dismiss the menu.

The problem is, Screen.java explicitly checks for instanceof Menu in a large number of places. I wondered, would you consider creating the following interface? …

[java]
package tonegod.gui.controls.menuing;

/**

  • Tag interface to denote the control is a ‘popup’, and the screen should hide
  • it when something else gets focus.
    */
    public interface Popup {

}

[/java]

Then have Menu implement this interface, then have Screen and Subscreen use Popup in it’s instanceof conditions. I can’t think this would interfere with anything else, and would allow anything to be dismissed when focus changes just be implement this interface.

RR

Not sure how I missed this. I see no problem with this at all. I’ll need a bit to get this update out as it will have to wait to be pushed out with the 1000+ minor updates to styles for more accurate placement and ways of fixing alignment issues with BitmapText in the style info itself.

You can expect this to be part of the new update once it is out.

I’ll post specifics on the changes soon. Very few if any should effect custom style info, as most are using setXByKey methods which will check for both float values or Vector4f if defined (things like textPadding, textClipPadding, clipPadding, etc, etc… where the 4 values should have been individually definable from the get go).

1 Like
@t0neg0d said: Not sure how I missed this. I see no problem with this at all. I'll need a bit to get this update out as it will have to wait to be pushed out with the 1000+ minor updates to styles for more accurate placement and ways of fixing alignment issues with BitmapText in the style info itself.

You can expect this to be part of the new update once it is out.

I’ll post specifics on the changes soon. Very few if any should effect custom style info, as most are using setXByKey methods which will check for both float values or Vector4f if defined (things like textPadding, textClipPadding, clipPadding, etc, etc… where the 4 values should have been individually definable from the get go).

You were posting a lot of stuff at the time, it’s understandable :slight_smile: Great news, thanks as ever.

1 Like

There is now an Interface in tonegod.gui.controls.menuing called AutoHide. If you need a control to function like a Menu/Drop-down list… just implement this interface.

Perfect :slight_smile:

Just a heads up, and I don’t actually use them, but it looks like you forgot SubScreen. This still uses “instanceof Menu”

@rockfire said: Just a heads up, and I don't actually use them, but it looks like you forgot SubScreen. This still uses "instanceof Menu"

Right you are… thanks for the catch.