Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: Insert a table editor with a size bigger then the default line height, then insert another row: in the first one, the editor will be cutted, but from the second on, it will be ok. More information: There is a post in the newsgroup dated Jan/15 at 10h52 posted by me (Anibal Maffioletti de Deus). I'm also including some pictures and even a snippet that shows the especified problem.
Created attachment 57997 [details] Picture showing the bad drawn column
Created attachment 57998 [details] Snippet showing the bug described Snippet that shows the problem I'm facing. The idea of the snippet is simple: when you press some key, the first Table Editor is created (and appears cuted), and then, when you focus on the Text it creates another line (perfect). It resambles my problem: while I don't have an textbox, lines should appear thinner, the when I have the first Text they can get bigger. Also, I can't make thinner Texts, they need to be of that size.
Duong, looks like Windows 2000. Can you recreate this and find me.
Created attachment 58279 [details] Revised example This problem appears to happen in XP too but I believe it's a user error. The item height is set a bit too late such that when the first editor is created it's still using the old height. If you move the following lines outside of the filter handle event, the problem is fixed: table.addListener(SWT.MeasureItem, new Listener() { public void handleEvent(Event event) { if (event.type == SWT.MeasureItem) event.height = 22; } }); Please see attachment.
Created attachment 60548 [details] A new revision making the Snippet more like what happens on my app Ok, the modification worked in the Snippet, but not yet on my app. It took a bit to understand what was the problem that made the problem persist: when the textbox is created on my app, the Table is hidden (it is visible, but in another TabItem), so I think that the problem is that the SWT.MeasureItem is not called before the textbox be inserted. Do you have any new clue? I created a new snippet showing the problem (the Table is hidden until after the textbox is inserted, then, the 'cut' problem keeps happening).
If it helps, I managed a workaround with the following code: uiTable.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) { OS.SendMessage(uiTable.handle, OS.WM_HSCROLL, 0x00000004, 0x00000000); } });
This bug still exists in 3.4, I was able to fix it on windows using OS.SendMessage(uiTable.handle, OS.WM_HSCROLL, 0x00000004, 0x00000000 - Thanks Anibal for this but how to fix it in linux? any idea Mike ----------------------------------------- http://www.ldapsoft.com http://www.ldapadmintool.com
Well, if workarounds are the go, I can tell how I figured it out on Windows: I started a MessageSpy (from Visual Studio) and catched all messages sent to the handle of the grid until see it fixed (I figured it out that scrolling fixes the problem at least on Windows), so I forced a scroll repaint sending that message. But since I don't know Linux internals, I can't help you more than that. Hope it helps... And get a definitive fix soon.
If you do this in the first line of your key down filter, it works: table.setVisible(true); table.update(); The update() us needed to force the repaint (and hence the measure event) to happen before you call getItemHeight(). This should work on all platforms.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.