wei-spring / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Toolbar throws: IllegalArgumentException #1306

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a Toolbar to a Form
2. Set a back command to the toolbar: tb.addCommandToLeftBar(cmdBack);
3. Add menu commands to the toolbar: tb.addCommandToOverflowMenu(cmd1);
4. Run the application in the simulator
5. Navigate to a form other than the original to which the toobar was added
6. Select the menu command.

What is the expected output? What do you see instead?
I expect the dialog for the menu command to display items, but instead I get an 
exception.

What version of the product are you using? On what operating system?
The most current.  Windows 7.

Please provide any additional information below.

java.lang.IllegalArgumentException: margin cannot be negative
    at com.codename1.ui.plaf.Style.setMargin(Style.java:1623)
    at com.codename1.ui.Form.showModal(Form.java:1581)
    at com.codename1.ui.Dialog.showModal(Dialog.java:1089)
    at com.codename1.ui.Dialog.show(Dialog.java:470)
    at com.codename1.ui.Dialog.show(Dialog.java:414)
    at com.codename1.ui.Toolbar.showOverflowMenu(Toolbar.java:257)
    at com.codename1.ui.Toolbar$ToolbarSideMenu.showMenuDialog(Toolbar.java:541)
    at com.codename1.ui.MenuBar.showMenu(MenuBar.java:708)
    at com.codename1.ui.Toolbar$ToolbarSideMenu$2.actionPerformed(Toolbar.java:488)
    at com.codename1.ui.Form.dispatchCommand(Form.java:1318)
    at com.codename1.ui.SideMenuBar$CommandWrapper$ShowWaiter.run(SideMenuBar.java:1554)
    at com.codename1.ui.Display.processSerialCalls(Display.java:1110)
    at com.codename1.ui.Display.edtLoopImpl(Display.java:1054)
    at com.codename1.ui.Display.mainEDTLoop(Display.java:960)
    at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
    at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Original issue reported on code.google.com by tuga...@gmail.com on 24 Jan 2015 at 6:26

GoogleCodeExporter commented 9 years ago
Can you please share your code, I don't understand how you got this trace.

Original comment by cf27...@gmail.com on 25 Jan 2015 at 10:20

GoogleCodeExporter commented 9 years ago
I rearranged the way in which I am using this control, and since then, I have 
not seen the error reappear. Please close this issue.

Original comment by tuga...@gmail.com on 25 Jan 2015 at 2:35

GoogleCodeExporter commented 9 years ago
Ok, I'm closing it.
Thanks

Original comment by cf27...@gmail.com on 25 Jan 2015 at 4:15