position dialog at upper right

14 views
Skip to first unread message

howud...@gmail.com

unread,
Jul 24, 2016, 9:26:56 PM7/24/16
to CodenameOne Discussions
I have a dialog (filter options) that shows when a command button on the right of the title bar get pressed.  Currently it pops to the center of the screen, how can I get it to pop to the upper right?
Command cmdFilter = new Command("", FontImage.createMaterial(FontImage.MATERIAL_FILTER_LIST, UIManager.getInstance().getComponentStyle("Command"))) {
public void actionPerformed(com.codename1.ui.events.ActionEvent ev) {
onFilter();
}
};
this.getToolbar().addCommandToRightBar(cmdFilter);

protected void onFilter() {
dlgFilter.show();
MessageBox.OK("canceled:" + dlgFilter.Cancelled, "Result");
}


I tried showPacked, but that only supports NORTH or EAST not NORTHEAST

Shai Almog

unread,
Jul 25, 2016, 12:02:18 AM7/25/16
to CodenameOne Discussions, howud...@gmail.com
Use Dialog.showPopup(Component) to have a dialog that points at a specific component.

howud...@gmail.com

unread,
Jul 25, 2016, 12:29:55 AM7/25/16
to CodenameOne Discussions, howud...@gmail.com
I thought to try that, but how do I get the component from a command?

Shai Almog

unread,
Jul 25, 2016, 11:57:44 PM7/25/16
to CodenameOne Discussions, howud...@gmail.com
Button b = form.getToolbar().findCommandComponent(cmd);

howud...@gmail.com

unread,
Jul 26, 2016, 1:21:41 AM7/26/16
to CodenameOne Discussions, howud...@gmail.com
excellent, thank you

On Monday, July 25, 2016 at 8:57:44 PM UTC-7, Shai Almog wrote:
Button b = form.getToolbar().findCommandComponent(cmd);
Reply all
Reply to author
Forward
0 new messages