santoshko / codenameone

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

The act as spinner option for combo boxes is too transparent #705

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I add a combobox on my form and in the iPhone themes I would like it to act 
like a spinner to better act like a native iPhone app would. I can do that by 
setting the setActAsSpinnerDialog(true) function and it looks like it will work 
great but the default transparency of the spinner produced seems to be wrong 
and all screen behind makes it look too confusing (see attached screenshot). I 
am not sure which theme I should be changing to fix this up but it would be 
good to have this work by default. Thanks. 

It also appears to be a problem for the Android themes although perhaps these 
themes might not generally use the act as spinned option?

Also is there a reason the act as spinner property is not in the GUI Builder?

I am using the GUI designer with version 1.0.0.201305011553 on eclipse on a Mac

Original issue reported on code.google.com by jason.la...@gmail.com on 9 May 2013 at 10:46

GoogleCodeExporter commented 9 years ago
You forgot the attachment. Its a relatively old property which we haven't 
maintained and I frankly forgot about it until now.

Original comment by shai.almog on 9 May 2013 at 4:12

GoogleCodeExporter commented 9 years ago
Sorry. Screen shot attached

Original comment by jason.la...@gmail.com on 10 May 2013 at 2:28

Attachments:

GoogleCodeExporter commented 9 years ago
Looking at the code, I'm not sure if this is something we want to fix. This 
predated the "new" spinner classes and GenericSpinner. Adapting it to use that 
code would be problematic in many regards, currently I'm inclined to deprecate 
the method entirely.

Original comment by shai.almog on 10 May 2013 at 6:07

GoogleCodeExporter commented 9 years ago
OK is there a better way to get the iPhone native effect of clicking on a 
button or combo and getting a spinner pop up so that an item can be selected? 
The current standard combo box behaviour doesn't really seem too native?

Original comment by jason.la...@gmail.com on 10 May 2013 at 11:45

GoogleCodeExporter commented 9 years ago
Just place a button and show a dialog (or popup if isTablet() is true) 
containing a GenericSpinner instance. 
        GenericSpinner types = new GenericSpinner();
        types.setModel(new DefaultListModel(new String[] {
              ...
        }));

        types.getModel().setSelectedIndex(...);

        Dialog dlg = new Dialog();
        dlg.setScrollable(false);
        dlg.setLayout(new BorderLayout());
        dlg.addComponent(BorderLayout.CENTER, types);
        dlg.addComponent(BorderLayout.SOUTH, new Button(new Command("OK")));
        if(Display.getInstance().isTablet()) {
            dlg.showPopupDialog(c);
        } else {
            dlg.show();
        }

Original comment by shai.almog on 12 May 2013 at 4:42