sjPlot / macwidgets

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

HUDComboBox ignores disabled #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create new HudComboBox
2. set it enabled(false)
3. still able to change selected item after setEnabled(false)

What is the expected output? What do you see instead?
same as JComboBox

What version of the product are you using? On what operating system?
0.9.5 on Windows and Mac
Please provide any additional information below.

Original issue reported on code.google.com by denver...@gmail.com on 3 Nov 2009 at 6:53

GoogleCodeExporter commented 9 years ago
I'll look into this. This is more than just a rendering issue, right?

Original comment by kenneth....@gmail.com on 10 Nov 2009 at 1:46

GoogleCodeExporter commented 9 years ago
Ken, A partial fix for this is to alter the togglePopup() method in 
EPComboPopup to include a line c hecking of 
the combobox is enabled.

    private void togglePopup() {
        if (! fComboBox.isEnabled()) { return; }
        if (isVisible()) {
            hide();
        } else {
            show();
        }
    }

However, this only patches the functionality issue. The appearance of the 
disabled popup also needs to be 
fixed in HudComboBoxUI to reflect that this the CB is disabled. As is, the 
painting of the CB is fugly because 
the foreground color of the box is being set to some shade of gray ratherr than 
what HudComboBoxUI 
normally uses. See attached screenshot...

Original comment by rbs10025@gmail.com on 11 Nov 2009 at 2:22

Attachments:

GoogleCodeExporter commented 9 years ago
Well, perhaps that should be

    private void togglePopup() {
        if (isVisible()) {
            hide();
        } else if (fComboBox.isEnabled()) {
            show();
        }
    }

Original comment by rbs10025@gmail.com on 11 Nov 2009 at 2:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Preventing the selection changing is easy. Unfortunately, the disabled text 
drawing is hard-coded into Swing. I'll 
work around it though.

Original comment by kenneth....@gmail.com on 17 Nov 2009 at 2:05

GoogleCodeExporter commented 9 years ago
I've fixed this issue -- both the functional (clicking the combo) and aesthetic 
(visual rendering) parts. Download 
the latest build here:

http://www.macwidgetsforjava.com/downloads/latest/mac_widgets.jar

Let me know if this is satisfactory and I will close this issue.

Original comment by kenneth....@gmail.com on 17 Nov 2009 at 2:29

GoogleCodeExporter commented 9 years ago
That seem to be working.  Thank you!

Original comment by denver...@gmail.com on 17 Nov 2009 at 4:53

GoogleCodeExporter commented 9 years ago

Original comment by kenneth....@gmail.com on 17 Nov 2009 at 5:25