Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CTabFolder using GridLayout(CTabFolder using GridLayout)
CTabFolder using GridLayout [message #714383] Wed, 10 August 2011 13:11 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 6
Registered: August 2011
Location: India
Junior Member
Hi All,

How can I add single composite say CTabFolder on ScrolledForm using GridLayout.
I do not want to add any other Composite on ScrolledForm.

FillLayout is working fine. But do not want to use FillLayout.



Code is |:-

Display display = new Display();
Shell parent = new Shell( display, SWT.RESIZE );

ScrolledForm form = new ScrolledForm( parent, SWT.H_SCROLL );
FormToolkit formToolkit = new FormToolkit( parent.getDisplay() );
form.setSize( 100, 100 );
form.setBackground( formToolkit.getColors().getBackground() );
form.setExpandHorizontal( true );
form.setExpandVertical( true );

final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
form.getBody().setLayout( gridLayout );

CTabFolder tabFolder = new CTabFolder( form.getBody(), SWT.BORDER );
Composite composite = new Composite( tabFolder, SWT.NONE );
CTabItem item = new CTabItem( tabFolder, SWT.NONE );
item.setText( "Tab 1" );
item.setControl( composite );
item = new CTabItem( tabFolder, SWT.NONE );
item.setText( "Tab 2" );
item = new CTabItem( tabFolder, SWT.NONE );
item.setText( "Tab 3" );
item = new CTabItem( tabFolder, SWT.NONE );
item.setText( "Tab 4" );
tabFolder.setMinimizeVisible( true );
tabFolder.setMaximizeVisible( true );
parent.open();



When i am using ScrolledForm with CtabFolder using GridLayout,Chevron functionality is not shown on the Form. Tab window get displayed till the end of the Tab.But when i use fillLayout it is shown properly.

Please provide some reference on this topic.

Thanks

[Updated on: Wed, 10 August 2011 13:14]

Report message to a moderator

Re: CTabFolder using GridLayout [message #718214 is a reply to message #714383] Tue, 23 August 2011 16:01 Go to previous messageGo to next message
John Steele is currently offline John SteeleFriend
Messages: 33
Registered: June 2010
Location: Seattle, WA
Member
If you have a ScrolledForm and you put a CTabFolder onto it then it will not show the chevron because the area is scrolled. The chevron becomes visible only when there is not enough space for the CTabItems (i.e., when the CTabFolder has reached the maximum width within the parent composite). But since the parent composite is scrollable, the CTabFolder will not reach a maximum width, so it continues to grow.

If you use a Form instead of a ScrolledForm then you will get the chevron.

I could not get the code snippet you provided working properly until I set the Shell's layout. If you don't set the Shell's layout it doesn't know how to layout the children.

Re: CTabFolder using GridLayout [message #905436 is a reply to message #718214] Thu, 30 August 2012 11:31 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 6
Registered: August 2011
Location: India
Junior Member
Thanks.
Previous Topic:eclipse JUNO performance problem
Next Topic:Product with updateable features
Goto Forum:
  


Current Time: Thu Mar 28 10:16:08 GMT 2024

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

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

Back to the top