Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to create a vertical toolbar?
How to create a vertical toolbar? [message #371652] Sun, 13 July 2003 13:27 Go to next message
Yuri Magrisso is currently offline Yuri MagrissoFriend
Messages: 33
Registered: July 2009
Member
How can I create a vertical toolbar? I mean a toolbar that displays on
the left or right side of the window vertically.
I tried the following code, but the toolbar is always displayed
horizontally.

toolBar = new ToolBar (shell, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);

ToolItem item = new ToolItem(toolBar, SWT.PUSH); item.setImage(imgOrders);
item.setToolTipText("View Orders");
....
toolBar.pack();
....
Re: How to create a vertical toolbar? [message #371665 is a reply to message #371652] Mon, 14 July 2003 12:17 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Yuri,

Your ToolBar creation line looks right. I've verified that if you get
snippet
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet36.html
and add SWT.VERTICAL to its creation style bits that it will display
vertically. If this example doesn't help you then you'll have to post a
more complete snippet since the problem likely resides elsewhere.

Grant

Yuri Magrisso wrote:

> How can I create a vertical toolbar? I mean a toolbar that displays on
> the left or right side of the window vertically.
> I tried the following code, but the toolbar is always displayed
> horizontally.

> toolBar = new ToolBar (shell, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);

> ToolItem item = new ToolItem(toolBar, SWT.PUSH); item.setImage(imgOrders);
> item.setToolTipText("View Orders");
> ....
> toolBar.pack();
> ....
Re: How to create a vertical toolbar? [message #371673 is a reply to message #371665] Mon, 14 July 2003 15:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: steve_northover.ca.ibm.com

This was just fixed for 3.0. SWT.VERTICAL for toolbars didn't work quite
right on Windows until just recently ...

"Grant Gayed" <grant_gayed@ca.ibm.com> wrote in message
news:beu71m$ngs$1@eclipse.org...
> Yuri,
>
> Your ToolBar creation line looks right. I've verified that if you get
> snippet
>
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/sn
ippits/snippet36.html
> and add SWT.VERTICAL to its creation style bits that it will display
> vertically. If this example doesn't help you then you'll have to post a
> more complete snippet since the problem likely resides elsewhere.
>
> Grant
>
> Yuri Magrisso wrote:
>
> > How can I create a vertical toolbar? I mean a toolbar that displays on
> > the left or right side of the window vertically.
> > I tried the following code, but the toolbar is always displayed
> > horizontally.
>
> > toolBar = new ToolBar (shell, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);
>
> > ToolItem item = new ToolItem(toolBar, SWT.PUSH);
item.setImage(imgOrders);
> > item.setToolTipText("View Orders");
> > ....
> > toolBar.pack();
> > ....
>
>
Re: How to create a vertical toolbar? [message #371737 is a reply to message #371673] Tue, 15 July 2003 17:13 Go to previous messageGo to next message
Yuri Magrisso is currently offline Yuri MagrissoFriend
Messages: 33
Registered: July 2009
Member
Steve Northover wrote:
> This was just fixed for 3.0. SWT.VERTICAL for toolbars didn't work quite
> right on Windows until just recently ...

Is there a workaround for 2.1.1? May be I can use a layout manager or
CoolBar instead?
The problem is that I may need it for a project that has to finish
before the final 3.0 is released.

Thanks,
Yuri
PDA Mouse RightClick Event [message #436217 is a reply to message #371652] Thu, 13 May 2004 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gabollado.gabollado.com

Hello,

Is there a way to detect the RightClick on the Mouse on a PDA? holding the
pencil for a while, the way to do a rightmouse click in a PDA, I get the
same mouse event values that doing the normal click.

Thanks a lot.
Re: PDA Mouse RightClick Event [message #436220 is a reply to message #436217] Thu, 13 May 2004 13:04 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi Gonzalo,

If you are referring to the PocketPC SWT port, here is the recipe below.

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;

public class PR {

public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("PR");
shell.setLayout(new FillLayout());
shell.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event e) {
System.out.println("MenuDetect");
}
});
shell.open();

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

Additional details about the Pocket PC stylus hold gesture at:
http://www.eclipse.org/articles/Article-small-cup-of-swt/poc ket-PC.html
(look up the section "Application using a pop-up menu")

Chris
Re: PDA Mouse RightClick Event [message #436253 is a reply to message #436220] Thu, 13 May 2004 20:41 Go to previous message
Eclipse UserFriend
Originally posted by: gabollado.gabollado.com

Dear Christophe,

Thanks a lot. That will do...

Gonzalo.


"Christophe Cornu" <christophe_cornu@ca.ibm.com> escribi
Previous Topic:SWT
Next Topic:KTable 1.2 now under LGPL
Goto Forum:
  


Current Time: Thu Apr 25 20:56:35 GMT 2024

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

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

Back to the top