ToolBar in CoolBar [message #441352] |
Fri, 13 August 2004 08:32  |
Eclipse User |
|
|
|
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 #441620 is a reply to message #441568] |
Tue, 17 August 2004 11:29  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.33123 seconds