Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Vertical ToolBar on Application Window


Hi, Jonquil.

Please ask this question on the eclipse.platform newsgroup.
You are asking on the swt mailing list, and the classes in your example are not SWT classes at all.
ApplicationWindow, MenuManager, ToolBarManager, and CoolBarManager are all JFace classes.
The JFace newsgroup is eclipse.platform.
To get a password for, and read news on, the eclipse.platform newsgroup, see http://www.eclipse.org/newsgroups/index.html

Thank-you,
Carolyn



Jonquil Swann <swann@xxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

05/04/2004 12:38 PM

Please respond to
platform-swt-dev

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] Vertical ToolBar on Application Window







I am trying to add a vertical toolbar to an application window.  This
seems simple enough but I am getting a horizontal toolbar with the items
arranged vertically.  Any suggestions?

Also another item.  If I comment the addToolBar line and uncomment the
addCoolBar line, I don't get a coolbar at all.

Help, please.

Thanks,
Jonquil

public class MyWindow extends ApplicationWindow {

   public MyWindow() {
       super(null);
       addMenuBar();
       addToolBar(SWT.VERTICAL);
       //addCoolBar(SWT.VERTICAL);
   }

   public static void main(String[] args) {
       MyWindow app = new MyWindow();
       app.setBlockOnOpen(true);
       app.open();
       Display.getCurrent().dispose();
   }

   protected MenuManager createMenuManager() {

       MenuManager topManager = new MenuManager();
       
       MenuManager manager = new MenuManager("Fake");
       Action action = "">        action.setText ("Fake");
       
       manager.add(action);
 
       topManager.add(manager);
       return topManager;
   }

   protected ToolBarManager createToolBarManager(int style) {

       ToolBarManager manager = new ToolBarManager(style);
       
       Action action1 = makeFakeAction();
       action1.setText ("Fake 1");
       manager.add(action1);
       
       Action action2 = makeFakeAction();
       action2.setText ("Fake 2");
       manager.add(action2);
       
       return manager;
   }

   protected CoolBarManager createCoolBarManager(int style) {

       CoolBarManager manager = new CoolBarManager(style);
       
       Action action = "">        action.setText ("Fake");
       
       manager.add(action);
       return manager;
   }

   private Action makeFakeAction() {
       return new Action() {
           public void run() {
               System.out.println("my action");
           }
       };
   }

   protected Control createContents(Composite composite) {
       
       Button button = new Button (composite, SWT.PUSH);
       button.setText("here");
       
       return button;
   }
}
--

.........................
MIT Lincoln Laboratory
Group 33
(781) 981 5245
swann@xxxxxxxxxx

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


Back to the top