Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Is dynamic resize of Combo possible?
Is dynamic resize of Combo possible? [message #461282] Tue, 20 September 2005 11:14 Go to next message
Bhavani is currently offline BhavaniFriend
Messages: 5
Registered: July 2009
Junior Member
Hi all,
My scenario is : I have 2 combos in a Composite. Depending on the value
selected in the first Combo, the second Combo is populated. Now the values
in the second combo are of variable length, so i need to resize the combo
depending on the length of the text. Is it possible, since we place the
combos on the composite in the beginning itself ?

Code:

msgFmtCmb = new Combo(paramComp, SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan = 2;
msgFmtCmb.setLayoutData(gridData);
msgFmtCmb.addModifyListener(this);

msgTypeCmb = new Combo(paramComp, SWT.READ_ONLY);
final GridData grdDataMsgType = new GridData();
grdDataMsgType.horizontalSpan = 2;
msgTypeCmb.setLayoutData(grdDataMsgType);
msgTypeCmb.addModifyListener(this);

In the modifyText method, i am removing all values from the second combo
and adding new values.
Re: Is dynamic resize of Combo possible? [message #461299 is a reply to message #461282] Tue, 20 September 2005 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddana78ar.yahoo.com.ar

try to call to the "pack()" method of the combo that you want to resize dynamically into the listener.
Re: Is dynamic resize of Combo possible? [message #461321 is a reply to message #461282] Tue, 20 September 2005 19:20 Go to previous messageGo to next message
Stephane  fournier is currently offline Stephane fournierFriend
Messages: 340
Registered: July 2009
Senior Member
did you try to layout the parent composite when the values of your 2nd
combo are modified ?

Bhavani wrote:
> Hi all,
> My scenario is : I have 2 combos in a Composite. Depending on the value
> selected in the first Combo, the second Combo is populated. Now the
> values in the second combo are of variable length, so i need to resize
> the combo depending on the length of the text. Is it possible, since we
> place the combos on the composite in the beginning itself ?
>
> Code:
>
> msgFmtCmb = new Combo(paramComp, SWT.READ_ONLY);
> gridData = new GridData();
> gridData.horizontalSpan = 2;
> msgFmtCmb.setLayoutData(gridData);
> msgFmtCmb.addModifyListener(this);
>
> msgTypeCmb = new Combo(paramComp, SWT.READ_ONLY);
> final GridData grdDataMsgType = new GridData();
> grdDataMsgType.horizontalSpan = 2;
> msgTypeCmb.setLayoutData(grdDataMsgType);
> msgTypeCmb.addModifyListener(this);
>
> In the modifyText method, i am removing all values from the second combo
> and adding new values.
>
>
Re: Is dynamic resize of Combo possible? [message #461354 is a reply to message #461299] Wed, 21 September 2005 09:22 Go to previous message
Bhavani is currently offline BhavaniFriend
Messages: 5
Registered: July 2009
Junior Member
Thanks ddana78ar !
pack() method in the listener works perfect for me.
Previous Topic:Push buttons in column of TableTree
Next Topic:Limit on HTMLTransfer?
Goto Forum:
  


Current Time: Fri Apr 26 12:28:39 GMT 2024

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

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

Back to the top