Saturday, October 23, 2010

Tips About Compatibility Issues With My Latest Commits

I just committed some major refactoring to the LWUIT code base the other day, I changed the way Dialogs work so the style of the Dialog UIID actually surrounds the "dialog" as one would expect... This works really well but is highly incompatible since the change required quite a bit of hacks. I also moved the alignment attribute into the Style class which doesn't seem like something that would break compatibility but it does.

If you are running into problems with your existing code try the following:

You can use the old Dialog logic by invoking Dialog.setDialogTitleCompatibilityMode(true);
This is mostly intended as an intermediate solution until you can fix your theme/code.
If you used Dialog style manipulations by changing the Dialog's content pane this will no longer work as expected! You will need to use the Dialog.setDialogStyle/UIID() methods instead.

If you find that alignment is broken for some use cases its usually triggered by changing the style after setting alignment. The solutions for this are to either define the alignment in the theme or just move the alignment setting code to a point after you change the style e.g.:
cmp.setAlignment(LEFT);
cmp.setUIID("SomethingElse");

Will replace the style component in the component and break its alignment, you need to make sure this doesn't happen.

1 comment:

  1. Hi rajesh i was just recently started j2me apps with LWUIT.i got one problem with Dialogs,i am unable to change size,position of dialog on screen even if i used dialog.setPreferredH() ,dialog.setPreferredW() method and setX() and setY() methods.

    I got another problem that if set bg imge with show method to the dialog the components present on dialog not visible on the dialog.
    Plz sir give solutions to my problem

    ReplyDelete