| Summary: | TableCombo drop down height problems | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Andreas Ehret <andreas.ehret> | ||||
| Component: | Nebula | Assignee: | Marty Jones <martybjones> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | wim.jongman | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 187106 [details]
Path that fixes TableCombo drop down height problem
Sorry for the delay. I have been out of town for the past week. I will take a look at this in the next day or so. Marty Update: I have verified that the patch fixes the issue on Windows 7. I am going to test on windows xp and vista and then I will apply the patch to git. Thanks Andreas for the patch. I will let you know once it has been applied to source. Marty I have pushed the patch up to the remote git repository. Thanks Andreas for the patch. Marty |
Build Identifier: 20100617-1415 If I create a TableCombo with a number of items less or equals the visibleItemCount, the height of the drop down part of the combo is not correct, but too small, which leads to a unneccessary scroll bar. In case of having only a single item, its even not possible to select the item at all using the mouse, as the height of the drop down area seems to be zero. I found the problem in the dropDown(boolean drop) method where the itemCount is computed. For some reason the itemCount is decremented by 1 in cases where the item count is smaller than the visibleItemCount. If I remove the -1 in the line itemCount = (itemCount == 0) ? visibleItemCount : Math.min(visibleItemCount, itemCount) - 1; that seems to solve this problem. There is, however, still an empty row at the end, which appears to me the space for the horizontal scroll bar. In my case no scroll bar is required as the combo item is smaller that the combo itself, so code like the following solves this issue: if (itemCount <= visibleItemCount) { if (table.getHorizontalBar() != null && !table.getHorizontalBar().isVisible()) { itemHeight -= table.getHorizontalBar().getSize().y; } } Reproducible: Always Steps to Reproduce: 1. create a TableCombo snippet (don't modify the visibleItemCount which is 7 by default) 2. fill the combo with a single item 3. run the snippet and try to select the item using the mouse