Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] CTabFolder & setTopRight

In the future, please ask this kind of question on the SWT newsgroup:

        news://news.eclipse.org/eclipse.platform.swt

This mailing list is for the discussion of the implementation of SWT.

In answer to your question, you need to hide the old control and set the 
new control as shown below:

        folder.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                        int selection = folder.getSelectionIndex();
                        switch (selection) {
                        case 0: {
                                Control c = folder.getTopRight();
                                if (c != null) c.setVisible(false);
                                b1.setVisible(true);
                                folder.setTopRight(b1); break;
                        }
                        case 1: {
                                Control c = folder.getTopRight();
                                if (c != null) c.setVisible(false);
                                b2.setVisible(true);
                                folder.setTopRight(b2); break;
                        }
                        case 2: {
                                Control c = folder.getTopRight();
                                if (c != null) c.setVisible(false);
                                b3.setVisible(true);
                                folder.setTopRight(b3); break;
                        }
                        default: {
                                Control c = folder.getTopRight();
                                if (c != null) c.setVisible(false);
                                folder.setTopRight(null); break;
                        }
                        }
                }
        });




bs <balajis@xxxxxxxxxxx> 
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
11/29/2004 07:23 PM
Please respond to
platform-swt-dev


To
platform-swt-dev@xxxxxxxxxxx
cc

Subject
[platform-swt-dev] CTabFolder & setTopRight






Hi,
Depending on which CTabItem is visible, I want to change what appears
on the topRight next to the min/max buttons, just like the Eclipse IDE
does for the Console/Debug/Progress/Task etc panel.

I set up selection events on the CTabFolder and based on the item(the 
tab item), I try to do a setTopRight(null), setTopRight(control).
It does not change it.

thx
bal
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev




Back to the top