Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » CTabFolder minimize
CTabFolder minimize [message #453538] Thu, 07 April 2005 14:25 Go to next message
kiran is currently offline kiranFriend
Messages: 15
Registered: July 2009
Junior Member
Hi,

I am using CTabFolder as top and bottom composites in a SashFrom within a
standalone application. When I set the "CTabFolder.setMinimized( true )"
in the lower CTabFolder, I could see the minimize icon in the top-right
corner for the corresponding CTabFolder.

Inside the action listener's minimize method I have the code as follows

public void minimize( CTabFolderEvent event ) {
if ( !bottomTabFolder.getMinimized() ) {
tabsForm.setMaximizedControl( topTabFolder );
bottomTabFolder.setMinimized( true );
} else {
tabsForm.setMaximizedControl( null );
bottomTabFolder.setMinimized( false );
}
}

when clicking on the minimize "-" button, the topTabFolder is occupying
the complete SashForm, but I am not able to see the tabs portion of the
bottomTabFolder as in eclipse views. Instead the bottomTabFolder is
completely hidden and I cannot restore it.

Can anyone guide me where I am going wrong with this functionality.

Thanks,
kiran
Re: CTabFolder minimize [message #453903 is a reply to message #453538] Wed, 13 April 2005 17:21 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You also need to manage the size of the children. Have a look at the
following snippet:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet165.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

With a SashForm, minimize does not make too much sense. You would need to
be able to disable the sashes when one of the children was minimized and
there is no API to do this. Maximize, however does work very well with
SashForm:


public static void main (String [] args) {
Display display = new Display ();
final Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
final SashForm form = new SashForm(shell, SWT.BORDER |
SWT.VERTICAL);

final CTabFolder folder1 = new CTabFolder(form, SWT.BORDER);
folder1.setMaximizeVisible(true);
CTabItem itemA = new CTabItem(folder1, SWT.NONE);
itemA.setText("Item A");
itemA.setControl(new Text(folder1, SWT.BORDER | SWT.MULTI |
SWT.H_SCROLL | SWT.V_SCROLL));
folder1.setSelection(0);

final CTabFolder folder2 = new CTabFolder(form, SWT.BORDER);
folder2.setMaximizeVisible(true);
CTabItem itemB = new CTabItem(folder2, SWT.NONE);
itemB.setText("Item B");
itemB.setControl(new Text(folder2, SWT.BORDER | SWT.MULTI |
SWT.H_SCROLL | SWT.V_SCROLL));
folder2.setSelection(0);

folder1.addCTabFolder2Listener(new CTabFolder2Adapter() {
public void restore(CTabFolderEvent event) {
folder1.setMaximized(false);
form.setMaximizedControl(null);
}
public void maximize(org.eclipse.swt.custom.CTabFolderEvent
event) {
folder1.setMaximized(true);
form.setMaximizedControl(folder1);
}
});

folder2.addCTabFolder2Listener(new CTabFolder2Adapter() {
public void restore(CTabFolderEvent event) {
folder2.setMaximized(false);
form.setMaximizedControl(null);
}
public void maximize(org.eclipse.swt.custom.CTabFolderEvent
event) {
folder2.setMaximized(true);
form.setMaximizedControl(folder2);
}
});


shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}

"kiran" <bkiran123@yahoo.com> wrote in message
news:5ecfd9cfdc8d3ba8801ed7d93633ae03$1@www.eclipse.org...
>
> Hi,
>
> I am using CTabFolder as top and bottom composites in a SashFrom within a
> standalone application. When I set the "CTabFolder.setMinimized( true )"
> in the lower CTabFolder, I could see the minimize icon in the top-right
> corner for the corresponding CTabFolder.
> Inside the action listener's minimize method I have the code as follows
>
> public void minimize( CTabFolderEvent event ) {
> if ( !bottomTabFolder.getMinimized() ) {
> tabsForm.setMaximizedControl( topTabFolder );
> bottomTabFolder.setMinimized( true );
> } else {
> tabsForm.setMaximizedControl( null );
> bottomTabFolder.setMinimized( false );
> }
> }
>
> when clicking on the minimize "-" button, the topTabFolder is occupying
> the complete SashForm, but I am not able to see the tabs portion of the
> bottomTabFolder as in eclipse views. Instead the bottomTabFolder is
> completely hidden and I cannot restore it.
>
> Can anyone guide me where I am going wrong with this functionality.
>
> Thanks,
> kiran
>
>
>
Previous Topic:Error: No more Handles when I push keys quickly.
Next Topic:Problem with Swing application plug-in on Mac OS X
Goto Forum:
  


Current Time: Sun Mar 07 21:14:28 GMT 2021

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

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

Back to the top