Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scroll problem in TextBox
Scroll problem in TextBox [message #463760] Mon, 14 November 2005 15:57 Go to next message
Eclipse UserFriend
Originally posted by: ronin.msn.gmail.com

Hi, i'm trying to make an Messenger sistem, and whem i try to implement an
TextBox where goes the text wrrited by the user, the box has a scroll that
doens't follow the text that appears. So whem i want to read the last
messages sended i must scroll the Vertical Scroll bar with the mouse.



I send here some parts of the code.....



public class ChatBox extends Composite
{
final Text sendArea;
final Text recvArea;
Composite parent;

public ChatBox(final Composite parent, int style)
{
super(parent, style);
this.parent=parent;

GridLayout layout = new GridLayout(1,false);
layout.makeColumnsEqualWidth = true;

this.setLayout(layout);

GridData menuData = new GridData(GridData.FILL_HORIZONTAL);
menuData.heightHint = 25;
ChatMenu chatMenu = new ChatMenu(this, SWT.MULTI);
chatMenu.setLayoutData(menuData);

GridData recvData = new GridData(GridData.FILL_HORIZONTAL);
recvData.heightHint = 130;

recvArea = new Text(this,SWT.SHELL_TRIM | SWT.H_SCROLL |
SWT.V_SCROLL |SWT.DOWN);
recvArea.setEditable(false);

Color white = new Color(null,255,255,255);
recvArea.setBackground(white);

recvArea.setLayoutData(recvData);
recvArea.setText(new String());
Re: Scroll problem in TextBox [message #463768 is a reply to message #463760] Mon, 14 November 2005 19:27 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You can use a) Text.setTopIndex() or b) Text.setSelection() with
Text.showSelection() to programmatically scroll the text.

"Ronin" <ronin.msn@gmail.com> wrote in message
news:9ce36f153bdca43ff03efcc98887caea$1@www.eclipse.org...
> Hi, i'm trying to make an Messenger sistem, and whem i try to implement an
> TextBox where goes the text wrrited by the user, the box has a scroll that
> doens't follow the text that appears. So whem i want to read the last
> messages sended i must scroll the Vertical Scroll bar with the mouse.
>
>
>
> I send here some parts of the code.....
>
>
>
> public class ChatBox extends Composite { final Text sendArea;
> final Text recvArea;
> Composite parent;
>
> public ChatBox(final Composite parent, int style) {
> super(parent, style);
> this.parent=parent;
>
> GridLayout layout = new GridLayout(1,false);
> layout.makeColumnsEqualWidth = true;
>
> this.setLayout(layout);
>
> GridData menuData = new GridData(GridData.FILL_HORIZONTAL);
> menuData.heightHint = 25;
> ChatMenu chatMenu = new ChatMenu(this, SWT.MULTI);
> chatMenu.setLayoutData(menuData);
>
> GridData recvData = new GridData(GridData.FILL_HORIZONTAL);
> recvData.heightHint = 130;
>
> recvArea = new Text(this,SWT.SHELL_TRIM | SWT.H_SCROLL |
> SWT.V_SCROLL |SWT.DOWN);
> recvArea.setEditable(false);
> Color white = new Color(null,255,255,255);
> recvArea.setBackground(white);
> recvArea.setLayoutData(recvData);
> recvArea.setText(new String());
>
>
>
>
>
Previous Topic:swt Browser accents problem
Next Topic:SWT group scrolling (help !!!)
Goto Forum:
  


Current Time: Fri Apr 26 21:12:24 GMT 2024

Powered by FUDForum. Page generated in 0.03513 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top