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

Bug 195032

Summary: [StyledText] Embedded controls in StyledText are moving on each carriage return
Product: [Eclipse Project] Platform Reporter: Andrew Eisenberg <andrew.eisenberg>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: normal    
Priority: P3 CC: akumpulainen
Version: 3.3Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Andrew Eisenberg CLA 2007-06-30 16:56:45 EDT
Build ID: 3.3

Steps To Reproduce:
1. Compile and execute the code below
2. Press carriage return
3. Both the Yellow label and the red label scrolls with each carriage return.
4. Press any other key.
5. Neither label scrolls

To me this seems to be strange.  Why should all controls move on carriage returns, but nothing else?

I would like to see one of the following:

1. no control moves on carriage return (movement of controls with respect to text modification should be controlled explicitly through listeners, etc)

2. only controls that are below the caret position should be scrolled

3. options to configure the behavior of how and when embedded controls scroll.

thanks.

More information:
public class SWTPlaying {

  public static void main(String[] args) {
    Display d = new Display();
    final Shell s = new Shell(d);
    s.setSize(400, 400);
    s.setText("Styled Text Scroll Test");

    StyledText t = new StyledText(s, 0);
    t.setSize(400, 400);
    
    Label l1 = new Label(t, 0);
    l1.setBackground(new Color(Display.getDefault(), new RGB(255,0,0)));
    l1.setLocation(50, 200);
    l1.setSize(50, 50);

    Label l2 = new Label(t, 0);
    l2.setBackground(new Color(Display.getDefault(), new RGB(255,255,0)));
    l2.setLocation(50, 0);
    l2.setSize(50, 50);
    
    t.setText("line1\nline2\nline3\nline4\nline5\n");

    
    
    s.open();
    while (!s.isDisposed())
      while (!d.readAndDispatch())
        d.sleep();
  }

}
Comment 1 Grant Gayed CLA 2007-07-04 11:03:50 EDT
FH what's the expected behaviour here?
Comment 2 Felipe Heidrich CLA 2009-08-21 16:50:49 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 3 Felipe Heidrich CLA 2009-08-21 16:51:09 EDT
We need new API to stop children from scrolling along with pixels.
Comment 4 Felipe Heidrich CLA 2009-08-21 17:04:36 EDT
*** Bug 135878 has been marked as a duplicate of this bug. ***
Comment 5 Leo Ufimtsev CLA 2017-08-03 12:29:25 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 6 Eclipse Genie CLA 2020-07-03 19:17:40 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.