06-08-2010 07:27 AM
Hi I'm developing an application that has Popup screen with a a BasicEditfield.
My problem is with users that have a SureType keyboard - I want them to be able to switch to multi-tap on some fields instead of the auto-complete. I know i can force this with a
TextField.NO_COMPLEX_INPUT, but i want the user to be able to change it dynamically and by his choice.
Usually ( For example in the native browser ), clicking the menu button opens options such as Change Language, and more importantly Switch To MultiTap. But in my applcation clicking the Menu Button does nothing, when my Editbox Popup-Screen is open.
So - Is there any way to show these options to the user?
Thanks,
Dan.
Solved! Go to Solution.
06-08-2010 07:50 AM - edited 06-08-2010 07:51 AM
I had to add menu items to the BasicEditField before and simply used an override to the makeMenu() method to add the items I wanted. ... however I have never been stuck with having no menu come up at all. Have you somehow suppressed the menu? The code I used was very simple as below ... you just need to have your menu item hide itself if the currently focussed field is not a basiceditfield:
private final MenuItem m_closeItem = new MenuItem("Close", 200000, 10)
{
public void run()
{
onClose();
}
};
protected void makeMenu(Menu menu, int instance)
{
if (menu.getSize() > 0)
{
menu.addSeparator();
}
menu.add(m_closeItem);
}
MenuItem m_closeItem = new MenuItem("Close", 200000, 10)
06-08-2010 08:37 AM
Thanks for answer.
I guess i'm so how suppressing it.
But is there no way to get the default EditBox options?
06-08-2010 10:08 AM
I'm not familiar with the multi-tap vs SureType commands, but for the Storm there is a Show Keyboard / Hide Keyboard command that is associated with all textboxes. I imagine it works the same way for multi-tap. To access show keyboard, all I did was add a textbox to my screen ... I didn't have to do anything special, a working menu was the default behaviour.
Have you tried playing with any of the sample apps in the developer zone? I have found that they all have the menu working. You may want to take a look there for a starting point.
Good luck!!
06-08-2010 10:12 AM
I will try, thanks
06-08-2010 04:46 PM
I note you seem to have a popup screen. A Popup Screen will normally not have a menu and I think the default PopupScreen does not provide a way of creating one. However it is possible, and then you can add the Context Menu Items from the EditField. I think you will have to make the menu and show it yourself. Is this what you want?
06-09-2010 05:11 AM - edited 06-09-2010 05:12 AM
Hi, Thanks Peter, Helpful as always ![]()
Anyway, your advice got me somehow in the right direction - Indeed i am using a popup screen, so to make the menu appear i added
DEFAULT_MENU in the Screen constructor,
and overrided makeMenu :
public void makeMenu(Menu menu, int instance)
{
super.makeMenu(menu, instance);
}
Works perfectly now! I get the wished for Switch language, Switch to Multi-tap, Clear field, etc. options.