popupMenus

Can the Standard Controls Menu use listbox and buttons or do I have to use the popupBuilder for that. If so can someone divulge a minimal use of the builder class as i can’t seem to get popups to work without explicitly declaring everything in the xml and i cannot seem to add controls to the Standard Controls menu it seems more like a dynamic menu list.

The current version of the standard controls Menu does not support adding any Standard Controls as menu item. So you can use it as it is or you can take a look at the source and see how you could add that feature yourself. It’s not that hard. The hard part is to get a nice API added to allow such feature. Which is not going to happen for Nifty 1.3 I’m afraid. Maybe later or you can send a patch which I will be happy to include :slight_smile:



So you’re right. A custom popup layer might be better. You can find an example in the new nifty-default-controls-examples. The console is displayed using a popup layer and it is build using the PopupBuilder. Check out the method “registerConsolePopup” in the ControlsDemo.java.

ahh thnx void after reviewing some examples in the nifty jars (btw where is your repository the one on sourceforge seems outdated) provided I was able to make the Popups successfully though not through PopupBuilder. I found an easier way is to make a Minimal Popup Template and then construct what I need from their since I need Several Popups I divided them it into two rows one for the controls and the other for button which would be adequate enough for each possible popUp. Which reminds me is it possible to store popups in another xml file like styles and controls are.



Hmm i think it would help if their was a built-in way to do this though something like maybe

PopupTemplate p = new PopupTemplate(childLayout,Amount of Rows(String array or Integer))

Element k = p.getElement(1 or “controls”);

make controls add to p etc

Element k = p.getElement(1 or “buttons”);

make controls add to row etc

nifty.showPopup

This was kind of how I used it only thing is I had to create the popupTemplate in the XML then again I have no idea how to use popupBuilder properly so theirs a chance what i said is irrelevant. (Though all the other control Builders were very nice to use)



BTW off topic is it possible to hide entries in the list menu instead of deleting them to aid in search filtering. I seems actively adding and deleting entries each keystroke is very inefficient