[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] Minimum expected display size for Eclipse user?
|
Greetings,
I'm not sure if this is applicable to your situation, but when I was creating scrollable tabs for the TAU plugins, this was how I did it. I found it looked better having each tab scroll individually, rather than putting the entire tab-group in a scrollable composite. That avoids having a lot of blank space on the bottom of tabs shorter than the longest tab. The tricky bit, I found, was making sure to specify a 'sane' minimum size. This only applies to vertical scrolling, but it should be easy to apply it to horizontal.
Regards,
-Wyatt
//Define the top level composite and tab parent
Composite comp = new Composite(parent, SWT.NONE);//parent provided as an argument
setControl(comp);
FillLayout topLayout = new FillLayout();
comp.setLayout(topLayout);
TabFolder tabParent = new TabFolder(comp, SWT.BORDER);
//Repeat approximately the following for every tab:
TabItem anaTab = new TabItem(tabParent, SWT.NULL
);
anaTab.setText("Tab Label");
ScrolledComposite scrollAna = new ScrolledComposite(tabParent,SWT.V_SCROLL);
Composite anaComp = new Composite(scrollAna, SWT.NONE
);
anaTab.setControl(scrollAna);
anaComp.setLayout(createGridLayout(1, false, 0, 0));
anaComp.setLayoutData(spanGridData(GridData.FILL_HORIZONTAL, 5));
//Insert all of your actual tab content here, using anaComp as the parent
//Conclude the tab area with this (adjusting names as necessary for individual tabs):
anaComp.pack();
//This gets the approximate height of the composite as rendered; a good minSize for the scroller
int anaCompHeight=anaComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
scrollAna.setContent(anaComp);
scrollAna.setMinSize(400, anaCompHeight);
scrollAna.setExpandHorizontal
(true);
scrollAna.setExpandVertical(true);
On 5/31/07, Beth Tibbitts <tibbitts@xxxxxxxxxx
> wrote:There's a decent example here
http://help.eclipse.org/help32/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/ScrolledComposite.html
But that's from the eclipse help which Doug said didn't help....
it's just that this is a better example than most eclipse help anyways.
It explains two different way to use it.
I have *not* tried this, so take it for whatever it's worth, possibly
nothing.
...Beth
Beth Tibbitts (859) 243-4981 (TL 545-4981)
High Productivity Tools / Parallel Tools
http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address: IBM Corp., 455 Park Place, Lexington, KY 40511
Doug Schaefer
<
DSchaefer@xxxxxx
m> To
Sent by: Parallel Tools Platform general
ptp-dev-bounces@e developers <ptp-dev@xxxxxxxxxxx>
clipse.org cc
Subject
05/31/2007 04:01 RE: [ptp-dev] Minimum expected
PM display size for Eclipse user?
Please respond to
Parallel Tools
Platform general
developers
<ptp-dev@eclipse.
org>
ScrolledComposite is evil. The last time I tried, I just kept hacking away
at the options until it worked. And even then it didn't work exactly how I
wanted. There must be examples out there. The Eclipse help didn't help at
all.
Doug Schaefer, QNX Software Systems
Eclipse CDT Project Lead, http://cdtdoug.blogspot.com
> -----Original Message-----
> From:
ptp-dev-bounces@xxxxxxxxxxx [mailto:ptp-dev-bounces@xxxxxxxxxxx] On
> Behalf Of Dave Wootton
> Sent: Thursday, May 31, 2007 3:31 PM
> To: Parallel Tools Platform general developers
> Subject: Re: [ptp-dev] Minimum expected display size for Eclipse user?
>
> Some more info:
> I added a ControlListener to 'parent', and to my ScrolledComposite and
> Composite objects, with a println in the controlResized() method. I see
> resize events for the ScrolledComposite each time createControl() is
> invoked, and where 'parent' and my top level Composite don't get resize
> events. When I resize the launch configuration pane manually, I don't see
> any resize events at all for any of these three widgets. It seems a
higher
> level widget might be getting them. This could explain why my scrollbars
> don't work.
> Dave
>
>
>
> Dave Wootton/Poughkeepsie/IBM@IBMUS
> Sent by: ptp-dev-bounces@xxxxxxxxxxx
> 05/31/2007 03:19 PM
> Please respond to
> Parallel Tools Platform general developers <
ptp-dev@xxxxxxxxxxx>
>
>
> To
> Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
> cc
>
> Subject
> Re: [ptp-dev] Minimum expected display size for Eclipse user?
>
>
>
>
>
>
> I'm trying to make this work with a scrollbar but I'm missing something.
> Originally, my code in createControl() was createing a Compoiste object
> which I then filled in with a TabPane and a couple other widgets, where
> the parent of this Composite object was the Composite object passed as
> 'parent' in the createControl() invocation.
>
> I've now changed my code to create a ScrolledComposite object as the
> immediate child of 'parent, then use the ScrolledComposite object as the
> parent of my top level Composite object, also calling
> ScrolledComposite.setContent() so that the ScrolledComposite object knows
> what it contains. Once I fully populate my top level Composite object, I
> call computeSize() and setSize() on the Composite and then
> setMinimumSize() on the ScrolledComposite, where I think I am following
> case 2 in the online help for ScrolledComposite.
>
> I end up with a display, with scroll bars, since I also call
> setAlwaysShowScrollBars() for now, However, the scroll bars are always
> full height, and my Composite does not scroll, as if the
ScrolledComposite
>
> always thinks its big enough to display all of my Composite object. If I
> shring the launch configuration panel, then the bottom of my Composite
> object gets clipped. If I omit the call to setContent(), then the
> scrollbars are able to scroll, but my Composite object doesn't scroll.
>
> I must be missing something obvious, but don't know what.
>
> Dave
>
>
>
> Beth Tibbitts/Watson/IBM@IBMUS
> Sent by:
ptp-dev-bounces@xxxxxxxxxxx
> 05/31/2007 01:01 PM
> Please respond to
> Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
>
>
> To
> Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
> cc
>
> Subject
> Re: [ptp-dev] Minimum expected display size for Eclipse user?
>
>
>
>
>
>
> Yes I vote for scrollbar.
> 1024x768 will always be needed, especially for LCD projectors and demos.
>
> ...Beth
>
> Beth Tibbitts (859) 243-4981 (TL 545-4981)
> High Productivity Tools / Parallel Tools http://eclipse.org/ptp
> IBM T.J.Watson Research Center
> Mailing Address: IBM Corp., 455 Park Place, Lexington, KY 40511
>
>
>
> "Randy M.
> Roberts"
> <rsqrd@xxxxxxxx>
To
>
>
> Sent by: ptp-dev <
ptp-dev@xxxxxxxxxxx>
> ptp-dev-bounces@e
cc
>
>
> clipse.org
>
Subject
>
>
> Re: [ptp-dev] Minimum expected
> 05/31/2007 12:01 display size for Eclipse user?
> PM
>
>
> Please respond to
> Parallel Tools
> Platform general
> developers
> <ptp-dev@eclipse.
> org>
>
>
>
>
>
>
> Dave,
>
> Can you add a scrollbar?
>
> R^2
>
> On Thu, 2007-05-31 at 11:49 -0400, Dave Wootton wrote:
> > Is there an expected minimum display size for Eclipse users? I'm
looking
> > at a launch configuration panel parallel tab with my implementation of
> > AbstractRMLaunchConfigurationDynamicTab, and it looks like it is too
> tall
>
> > for a 1024x768 resolution display on my laptop. I removed the calls to
> > createVerticalSpacer() in the ParallelTab class, and the launch
> > configuration panel barely fits afterward. If ParallelTab provided an
> > option to remove the queue dropdown, as well as the machine dropdown,
> that
> > would help in cases where I don't need either.
> >
> > If this needs to run on a 1024x768 display, then I probably need to
> create
> > more tabs in my panel and move some fields around. Is 1024x768
> considered
>
> > usable for Eclipse?
> > Dave
> > _______________________________________________
> > ptp-dev mailing list
> >
ptp-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/ptp-dev
>
> _______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ptp-dev
>
>
> _______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ptp-dev
>
>
> _______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/ptp-dev
>
>
> _______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev