Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316112

Summary: a relayout grows control
Product: z_Archived Reporter: Enrico Schnepel <enrico.schnepel>
Component: NebulaAssignee: Marty Jones <martybjones>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: m.hoffmann
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to ignore the table width while computing the control size
wim.jongman: iplog+
Modified Snippet watch combo #6
wim.jongman: iplog+
image 1
wim.jongman: iplog-
gif 2
wim.jongman: iplog-
image 3
wim.jongman: iplog-
Model wim.jongman: iplog-

Description Enrico Schnepel CLA 2010-06-08 07:28:21 EDT
I am using the TableCompeViewer in a GridLayout or TableWrapLayout. Independently from the wrapping layout the TableCombo grows every time (by 18 px) when a selection is made in table in the drop down shell. This happens only when an image (in my case 18 px wide) is displayed as provided by the LabelProvider. In the collapsed mode and when using keyboard cursor movements or the mouse wheel everything works fine.
Comment 1 Marty Jones CLA 2010-06-08 07:58:46 EDT
(In reply to comment #0)
> I am using the TableCompeViewer in a GridLayout or TableWrapLayout.
> Independently from the wrapping layout the TableCombo grows every time (by 18
> px) when a selection is made in table in the drop down shell. This happens only
> when an image (in my case 18 px wide) is displayed as provided by the
> LabelProvider. In the collapsed mode and when using keyboard cursor movements
> or the mouse wheel everything works fine.

enrico,

Can you provide me with a reproducible snippet that shows the issue you are seeing?

Thanks,

Marty
Comment 2 Enrico Schnepel CLA 2010-06-08 08:26:17 EDT
currently not - the "snippet" would be our application... I will see if i can create one.
Comment 3 Enrico Schnepel CLA 2010-08-13 09:01:32 EDT
Created attachment 176551 [details]
Patch to ignore the table width while computing the control size

I have investigated the issue a bit. When I ignore the table width while computing the controls size everything goes right. I don't know what happens if there are multiple columns in the table.
Comment 4 Marty Jones CLA 2010-08-13 10:14:38 EDT
(In reply to comment #3)
> Created an attachment (id=176551) [details]
> Patch to ignore the table width while computing the control size
> 
> I have investigated the issue a bit. When I ignore the table width while
> computing the controls size everything goes right. I don't know what happens if
> there are multiple columns in the table.

That seems strange that ignoring the table width fixes the problem.  I still would like to have a reproducible snippet that shows the issue you are seeing.  I have not been able to reproduce.

Marty
Comment 5 Mark Hoffmann CLA 2010-11-23 11:33:46 EST
Hi, 
I have multiple columns and the patch doesn't worked.

I found out the resize problem only appears at me, when my input size is smaller than the visible count size. You can take the TableComboViewerSnippet1 and reduce the input list size from 20 model down to 5. Than watch example comboviewer #6.
It resizes every time dropDown is called.

If the vertical scrollbar appears, everything works as expected. If the scrollbar is not there, the table resizes.

Example in TableCombo#dropDown(boolean):
- I have two columns 50 and 100px width
- totalColumnWidth = 150 in line 680
- in TableCombo line 682 the table size is x=167
- now the table will be resized to width of 167

- at the next call of dropdown the totalColumnWidth is 167
- in TableCombo line 682 the table size is now x=184
- the table will resized again

I hope this info helps.

Regards,
Mark
Comment 6 Mark Hoffmann CLA 2010-11-23 11:38:05 EST
Created attachment 183682 [details]
Modified Snippet watch combo #6

Modified TableComboViewerSnippet1 watch combo #6. I just have an input consisting of 5 models instead of 20. Now  combo#6 grow with each dropDown call.
Comment 7 Marty Jones CLA 2010-11-23 12:04:35 EST
(In reply to comment #6)
> Created an attachment (id=183682) [details]
> Modified Snippet watch combo #6
> 
> Modified TableComboViewerSnippet1 watch combo #6. I just have an input
> consisting of 5 models instead of 20. Now  combo#6 grow with each dropDown
> call.

Mark,

Can you attach the 3 gif images that you are using in the snippet you attached?

Thanks,

Marty
Comment 8 Mark Hoffmann CLA 2010-11-23 13:06:51 EST
(In reply to comment #7)
> 
> Mark,
> 
> Can you attach the 3 gif images that you are using in the snippet you attached?
> 
> Thanks,
> 
> Marty

You can check it out from CVS:
:pserver:anonymous@dev.eclipse.org:/cvsroot/technology 
org.eclipse.swt.nebula/org.eclipse.swt.nebula.snippets

Regards,
Mark
Comment 9 Mark Hoffmann CLA 2010-11-23 13:08:31 EST
Created attachment 183686 [details]
image 1
Comment 10 Mark Hoffmann CLA 2010-11-23 13:08:52 EST
Created attachment 183688 [details]
gif 2
Comment 11 Mark Hoffmann CLA 2010-11-23 13:09:27 EST
Created attachment 183690 [details]
image 3
Comment 12 Mark Hoffmann CLA 2010-11-23 13:09:56 EST
Created attachment 183691 [details]
Model
Comment 13 Marty Jones CLA 2010-11-25 09:31:23 EST
(In reply to comment #12)
> Created an attachment (id=183691) [details]
> Model

Mark,

Sorry about the image attachment requests.  I didn't realize that they are the example images that I included with the snippet.  I see the problem with the Widget now and will work on a fix for it over the Holiday weekend.

I will let you know when it has been fixed.

Thanks for the reproducable.

Marty
Comment 14 Marty Jones CLA 2010-11-26 08:50:19 EST
(In reply to comment #13)
> (In reply to comment #12)
> > Created an attachment (id=183691) [details] [details]
> > Model
> 
> Mark,
> 
> Sorry about the image attachment requests.  I didn't realize that they are the
> example images that I included with the snippet.  I see the problem with the
> Widget now and will work on a fix for it over the Holiday weekend.
> 
> I will let you know when it has been fixed.
> 
> Thanks for the reproducable.
> 
> Marty

I have found the bug and have added logic that fixes it.  Thanks Enrico and Mark for your input.

Please let me know if you guys have any problems with the patch.

Marty