Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ToolBar in CoolBar
ToolBar in CoolBar [message #441352] Fri, 13 August 2004 12:32 Go to next message
Sergiy Uvarov is currently offline Sergiy UvarovFriend
Messages: 13
Registered: July 2009
Junior Member
Hi, All.

I have problems when getting toolbar prefered size. When
I call computeSize(SWT.DEFAULT, SWT.DEFAULT) method it returns
a size of ToolItem not a size of itselt.
So this size goes to CoolItem and if I dinamically add a new ToolBar
in the CoolBar then previous CoolItem changes size so only one ToolItem
is visible.

Have you any suggestions how I can solve this problem?

Thanks for answers.

--
Sergiy Uvarov
Re: ToolBar in CoolBar [message #441360 is a reply to message #441352] Fri, 13 August 2004 14:22 Go to previous messageGo to next message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Have you looked at this snippet?
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform -swt-home/snippits/snippet150.html

Carolyn

"Sergiy Uvarov" <colonel@rts-ukraine.com> wrote in message
news:411CB4E5.2090706@rts-ukraine.com...
> Hi, All.
>
> I have problems when getting toolbar prefered size. When
> I call computeSize(SWT.DEFAULT, SWT.DEFAULT) method it returns
> a size of ToolItem not a size of itselt.
> So this size goes to CoolItem and if I dinamically add a new ToolBar
> in the CoolBar then previous CoolItem changes size so only one ToolItem
> is visible.
>
> Have you any suggestions how I can solve this problem?
>
> Thanks for answers.
>
> --
> Sergiy Uvarov
>
Re: ToolBar in CoolBar [message #441436 is a reply to message #441360] Mon, 16 August 2004 12:28 Go to previous messageGo to next message
Sergiy Uvarov is currently offline Sergiy UvarovFriend
Messages: 13
Registered: July 2009
Junior Member
Carolyn MacLeod wrote:
> Have you looked at this snippet?
> http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform -swt-home/snippits/snippet150.html


No one CoolBar shippets work in QNX. I use swt 3.0M6 and also have
tried 3.0 and 3.1M1.

When I call toolbar.pack() or toolbar.computeSize() it returns
incorrect toolbar size. But if I run my program in Linux/Motif it works
fine.

If snippet150 is run using swt3.0M6 then ToolItems are appeared as
points and if snippet150 is run using swt3.0 or higher then only first
ToolItems are visible.

Is it possible to solve this problem?
Does anyone test SWT in QNX before making release?

--
Sergiy Uvarov.
Re: ToolBar in CoolBar [message #441521 is a reply to message #441436] Mon, 16 August 2004 19:44 Go to previous messageGo to next message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Please open a bug report in Bugzilla against Platform - SWT.
Please make sure to specify that the problem occurs on QNX (Photon).
Thanks!
Carolyn

"Sergiy Uvarov" <colonel@rts-ukraine.com> wrote in message
news:4120A863.3040403@rts-ukraine.com...
> Carolyn MacLeod wrote:
> > Have you looked at this snippet?
> >
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform -swt-home/snippits/snippet150.html
>
>
> No one CoolBar shippets work in QNX. I use swt 3.0M6 and also have
> tried 3.0 and 3.1M1.
>
> When I call toolbar.pack() or toolbar.computeSize() it returns
> incorrect toolbar size. But if I run my program in Linux/Motif it works
> fine.
>
> If snippet150 is run using swt3.0M6 then ToolItems are appeared as
> points and if snippet150 is run using swt3.0 or higher then only first
> ToolItems are visible.
>
> Is it possible to solve this problem?
> Does anyone test SWT in QNX before making release?
>
> --
> Sergiy Uvarov.
>
Re: ToolBar in CoolBar [message #441568 is a reply to message #441521] Tue, 17 August 2004 07:02 Go to previous messageGo to next message
Sergiy Uvarov is currently offline Sergiy UvarovFriend
Messages: 13
Registered: July 2009
Junior Member
Carolyn MacLeod wrote:
> Please open a bug report in Bugzilla against Platform - SWT.
> Please make sure to specify that the problem occurs on QNX (Photon).
> Thanks!
> Carolyn

More deep look at this problem have shown that problem occurs only if
ToolBar size is calculated before putting it to CoolItem.
So if you change snippet150 method "CoolItem createItem(CoolBar coolBar,
int count)" like this then it works.

static CoolItem createItem(CoolBar coolBar, int count) {
ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
for (int i = 0; i < count; i++) {
ToolItem item = new ToolItem(toolBar, SWT.PUSH);
item.setText(itemCount++ +"");
}
CoolItem item = new CoolItem(coolBar, SWT.NONE);
item.setControl(toolBar);
toolBar.pack();
Point size = toolBar.getSize();
Point preferred = item.computeSize(size.x, size.y);
item.setPreferredSize(preferred);
return item;
}

And I am hesitating should I open a new bug?

--
Sergiy Uvarov
Re: ToolBar in CoolBar [message #441620 is a reply to message #441568] Tue, 17 August 2004 15:29 Go to previous message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Interesting.
Yes, I think you should still open the bug report.
Mention that it only happens on QNX, and paste in your workaround.
I think it should be fixed to work no matter when the toolbar size is
calculated.
And while we wait for the fix, your bug report might help someone who may
have the same problem.
Thanks!
Carolyn

"Sergiy Uvarov" <colonel@rts-ukraine.com> wrote in message
news:cfsabu$h7t$1@eclipse.org...
> Carolyn MacLeod wrote:
> > Please open a bug report in Bugzilla against Platform - SWT.
> > Please make sure to specify that the problem occurs on QNX (Photon).
> > Thanks!
> > Carolyn
>
> More deep look at this problem have shown that problem occurs only if
> ToolBar size is calculated before putting it to CoolItem.
> So if you change snippet150 method "CoolItem createItem(CoolBar coolBar,
> int count)" like this then it works.
>
> static CoolItem createItem(CoolBar coolBar, int count) {
> ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
> for (int i = 0; i < count; i++) {
> ToolItem item = new ToolItem(toolBar, SWT.PUSH);
> item.setText(itemCount++ +"");
> }
> CoolItem item = new CoolItem(coolBar, SWT.NONE);
> item.setControl(toolBar);
> toolBar.pack();
> Point size = toolBar.getSize();
> Point preferred = item.computeSize(size.x, size.y);
> item.setPreferredSize(preferred);
> return item;
> }
>
> And I am hesitating should I open a new bug?
>
> --
> Sergiy Uvarov
>
Previous Topic:Frustrated!!
Next Topic:Opening editor
Goto Forum:
  


Current Time: Fri Apr 26 04:43:37 GMT 2024

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

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

Back to the top