Put a FlowPage within a ScrollPane [message #63899] |
Mon, 10 February 2003 01:03  |
Eclipse User |
|
|
|
Hi,
I am trying to create a FlowPage figure with vertical scroll bar (I don't
need hort scroll bar since the text will be wrapped around automatically in
FlowPage). So I create a Figure based on CircuitFigure in
LogicEditorExample, and I put the flowPage to the pane (the freeformLayer)
and have a ScrollPane sets its view to the pane (same as CircuitFigure).
But I can only see the first word in my FlowPage and there is NO scroll bar.
Could some one please tell me how to get a scroll bar in FlowPage?
Thank you.
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
setLayoutManager(new StackLayout());
ScrollPane scrollpane = new ScrollPane();
add(scrollpane);
scrollpane.setViewport(new FreeformViewport());
// createFlowPage is based on the FlowPage example in draw2d cvs.
IFigure flowPage = createFlowPage();
scrollpane.setView(pane);
pane.add(flowPage);
|
|
|
|
|
|
Re: Put a FlowPage within a ScrollPane [message #64079 is a reply to message #64012] |
Mon, 10 February 2003 14:50   |
Eclipse User |
|
|
|
Originally posted by: radienssmgs2.hotmail.com
Randy,
Could you please help me with my question as well? I have a similar
question.
I would like to put a SWT TreeTable inside a Container Figure (e.g.
CircuitFigure).
Thanks for any help.
In my constructor of CircuitFigure()
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
setLayoutManager(new FlowLayout());
Shell shell = new Shell(Display.getCurrent());
final TableTree tableTree = new TableTree(shell, SWT.FULL_SELECTION);
// populate my tableTree
FigureCanvas fc = new FigureCanvas(tableTree);
fc.setViewport(new FreeformViewport());
fc.setContents(pane);
add(fc.getContents());
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b28qfr$gu4$1@rogue.oti.com...
>
> "Hal" <otaconss2@hotmail.com> wrote in message
> news:b28jas$aes$1@rogue.oti.com...
> > Thanks, but it gives me a Hort Scroll bar, instead of a Vertical Scroll
> bar.
> > I try calling Viewport.setContentsMatchHeight(true) also, but it gives
me
> > Both Hort and Vert scroll bar.
> >
> > Basically what I want is text wrap around the width of the figure and
> gives
> > me a vertical scroll bar is the FlowPage is higher than the figure
> >
> > Here is what I changed:
> >
> > pane = createPane();
> >
> > setLayoutManager(new StackLayout());
> >
> > ScrollPane scrollpane = new ScrollPane();
> >
> > add(scrollpane);
> >
> > Viewport viewport= new Viewport();
> >
> > viewport.setContentsTracksHeight(true);
> should be setContentsTracksWidth(true).
>
> Where is the FlowPage? It needs to be set as the contents to the
Viewport.
> Download TextExample from the CVS server. It's in draw2d.examples
project.
> >
> >
> > scrollpane.setViewport(viewport);
> >
> > scrollpane.setView(pane);
> >
> >
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b28glf$7t4$1@rogue.oti.com...
> > > You should put the FlowPage directly in the Viewport, without a
Freeform
> > > anything.
> > > Then, Viewport.setContentsMatchWidth(true);
> > >
> > > "Hal" <otaconss2@hotmail.com> wrote in message
> > > news:b28fkb$71n$1@rogue.oti.com...
> > > > Hi,
> > > >
> > > > I am trying to create a FlowPage figure with vertical scroll bar (I
> > don't
> > > > need hort scroll bar since the text will be wrapped around
> automatically
> > > in
> > > > FlowPage). So I create a Figure based on CircuitFigure in
> > > > LogicEditorExample, and I put the flowPage to the pane (the
> > freeformLayer)
> > > > and have a ScrollPane sets its view to the pane (same as
> CircuitFigure).
> > > > But I can only see the first word in my FlowPage and there is NO
> scroll
> > > bar.
> > > >
> > > > Could some one please tell me how to get a scroll bar in FlowPage?
> > > >
> > > > Thank you.
> > > >
> > > >
> > > >
> > > > pane = new FreeformLayer();
> > > >
> > > > pane.setLayoutManager(new FreeformLayout());
> > > >
> > > > setLayoutManager(new StackLayout());
> > > >
> > > > ScrollPane scrollpane = new ScrollPane();
> > > >
> > > >
> > > >
> > > > add(scrollpane);
> > > >
> > > > scrollpane.setViewport(new FreeformViewport());
> > > >
> > > > // createFlowPage is based on the FlowPage example in draw2d cvs.
> > > >
> > > > IFigure flowPage = createFlowPage();
> > > >
> > > > scrollpane.setView(pane);
> > > >
> > > > pane.add(flowPage);
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Put a FlowPage within a ScrollPane [message #64098 is a reply to message #64079] |
Mon, 10 February 2003 15:35   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
You would probably need a proxy figure that positions the TreeTable in
response to its setBounds method. You would have to jump through hoops to
get keyboard and focus handled properly. What are you trying to display?
"Jack R." <radienssmgs2@hotmail.com> wrote in message
news:b28ubo$jv0$1@rogue.oti.com...
> Randy,
>
> Could you please help me with my question as well? I have a similar
> question.
>
> I would like to put a SWT TreeTable inside a Container Figure (e.g.
> CircuitFigure).
>
> Thanks for any help.
>
> In my constructor of CircuitFigure()
> pane = new FreeformLayer();
>
> pane.setLayoutManager(new FreeformLayout());
>
> setLayoutManager(new FlowLayout());
>
>
> Shell shell = new Shell(Display.getCurrent());
>
> final TableTree tableTree = new TableTree(shell, SWT.FULL_SELECTION);
>
> // populate my tableTree
> FigureCanvas fc = new FigureCanvas(tableTree);
>
> fc.setViewport(new FreeformViewport());
>
> fc.setContents(pane);
>
> add(fc.getContents());
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b28qfr$gu4$1@rogue.oti.com...
> >
> > "Hal" <otaconss2@hotmail.com> wrote in message
> > news:b28jas$aes$1@rogue.oti.com...
> > > Thanks, but it gives me a Hort Scroll bar, instead of a Vertical
Scroll
> > bar.
> > > I try calling Viewport.setContentsMatchHeight(true) also, but it gives
> me
> > > Both Hort and Vert scroll bar.
> > >
> > > Basically what I want is text wrap around the width of the figure and
> > gives
> > > me a vertical scroll bar is the FlowPage is higher than the figure
> > >
> > > Here is what I changed:
> > >
> > > pane = createPane();
> > >
> > > setLayoutManager(new StackLayout());
> > >
> > > ScrollPane scrollpane = new ScrollPane();
> > >
> > > add(scrollpane);
> > >
> > > Viewport viewport= new Viewport();
> > >
> > > viewport.setContentsTracksHeight(true);
> > should be setContentsTracksWidth(true).
> >
> > Where is the FlowPage? It needs to be set as the contents to the
> Viewport.
> > Download TextExample from the CVS server. It's in draw2d.examples
> project.
> > >
> > >
> > > scrollpane.setViewport(viewport);
> > >
> > > scrollpane.setView(pane);
> > >
> > >
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:b28glf$7t4$1@rogue.oti.com...
> > > > You should put the FlowPage directly in the Viewport, without a
> Freeform
> > > > anything.
> > > > Then, Viewport.setContentsMatchWidth(true);
> > > >
> > > > "Hal" <otaconss2@hotmail.com> wrote in message
> > > > news:b28fkb$71n$1@rogue.oti.com...
> > > > > Hi,
> > > > >
> > > > > I am trying to create a FlowPage figure with vertical scroll bar
(I
> > > don't
> > > > > need hort scroll bar since the text will be wrapped around
> > automatically
> > > > in
> > > > > FlowPage). So I create a Figure based on CircuitFigure in
> > > > > LogicEditorExample, and I put the flowPage to the pane (the
> > > freeformLayer)
> > > > > and have a ScrollPane sets its view to the pane (same as
> > CircuitFigure).
> > > > > But I can only see the first word in my FlowPage and there is NO
> > scroll
> > > > bar.
> > > > >
> > > > > Could some one please tell me how to get a scroll bar in FlowPage?
> > > > >
> > > > > Thank you.
> > > > >
> > > > >
> > > > >
> > > > > pane = new FreeformLayer();
> > > > >
> > > > > pane.setLayoutManager(new FreeformLayout());
> > > > >
> > > > > setLayoutManager(new StackLayout());
> > > > >
> > > > > ScrollPane scrollpane = new ScrollPane();
> > > > >
> > > > >
> > > > >
> > > > > add(scrollpane);
> > > > >
> > > > > scrollpane.setViewport(new FreeformViewport());
> > > > >
> > > > > // createFlowPage is based on the FlowPage example in draw2d cvs.
> > > > >
> > > > > IFigure flowPage = createFlowPage();
> > > > >
> > > > > scrollpane.setView(pane);
> > > > >
> > > > > pane.add(flowPage);
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Put a FlowPage within a ScrollPane [message #64122 is a reply to message #64098] |
Mon, 10 February 2003 16:07  |
Eclipse User |
|
|
|
Originally posted by: radienssmgs2.hotmail.com
I am trying to display a TreeTable, in which I click on the parent, it will
expand/collapse its children within a draw2D figure.
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b2910h$m22$1@rogue.oti.com...
> You would probably need a proxy figure that positions the TreeTable in
> response to its setBounds method. You would have to jump through hoops to
> get keyboard and focus handled properly. What are you trying to display?
>
> "Jack R." <radienssmgs2@hotmail.com> wrote in message
> news:b28ubo$jv0$1@rogue.oti.com...
> > Randy,
> >
> > Could you please help me with my question as well? I have a similar
> > question.
> >
> > I would like to put a SWT TreeTable inside a Container Figure (e.g.
> > CircuitFigure).
> >
> > Thanks for any help.
> >
> > In my constructor of CircuitFigure()
> > pane = new FreeformLayer();
> >
> > pane.setLayoutManager(new FreeformLayout());
> >
> > setLayoutManager(new FlowLayout());
> >
> >
> > Shell shell = new Shell(Display.getCurrent());
> >
> > final TableTree tableTree = new TableTree(shell, SWT.FULL_SELECTION);
> >
> > // populate my tableTree
> > FigureCanvas fc = new FigureCanvas(tableTree);
> >
> > fc.setViewport(new FreeformViewport());
> >
> > fc.setContents(pane);
> >
> > add(fc.getContents());
> >
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b28qfr$gu4$1@rogue.oti.com...
> > >
> > > "Hal" <otaconss2@hotmail.com> wrote in message
> > > news:b28jas$aes$1@rogue.oti.com...
> > > > Thanks, but it gives me a Hort Scroll bar, instead of a Vertical
> Scroll
> > > bar.
> > > > I try calling Viewport.setContentsMatchHeight(true) also, but it
gives
> > me
> > > > Both Hort and Vert scroll bar.
> > > >
> > > > Basically what I want is text wrap around the width of the figure
and
> > > gives
> > > > me a vertical scroll bar is the FlowPage is higher than the figure
> > > >
> > > > Here is what I changed:
> > > >
> > > > pane = createPane();
> > > >
> > > > setLayoutManager(new StackLayout());
> > > >
> > > > ScrollPane scrollpane = new ScrollPane();
> > > >
> > > > add(scrollpane);
> > > >
> > > > Viewport viewport= new Viewport();
> > > >
> > > > viewport.setContentsTracksHeight(true);
> > > should be setContentsTracksWidth(true).
> > >
> > > Where is the FlowPage? It needs to be set as the contents to the
> > Viewport.
> > > Download TextExample from the CVS server. It's in draw2d.examples
> > project.
> > > >
> > > >
> > > > scrollpane.setViewport(viewport);
> > > >
> > > > scrollpane.setView(pane);
> > > >
> > > >
> > > >
> > > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > > news:b28glf$7t4$1@rogue.oti.com...
> > > > > You should put the FlowPage directly in the Viewport, without a
> > Freeform
> > > > > anything.
> > > > > Then, Viewport.setContentsMatchWidth(true);
> > > > >
> > > > > "Hal" <otaconss2@hotmail.com> wrote in message
> > > > > news:b28fkb$71n$1@rogue.oti.com...
> > > > > > Hi,
> > > > > >
> > > > > > I am trying to create a FlowPage figure with vertical scroll bar
> (I
> > > > don't
> > > > > > need hort scroll bar since the text will be wrapped around
> > > automatically
> > > > > in
> > > > > > FlowPage). So I create a Figure based on CircuitFigure in
> > > > > > LogicEditorExample, and I put the flowPage to the pane (the
> > > > freeformLayer)
> > > > > > and have a ScrollPane sets its view to the pane (same as
> > > CircuitFigure).
> > > > > > But I can only see the first word in my FlowPage and there is NO
> > > scroll
> > > > > bar.
> > > > > >
> > > > > > Could some one please tell me how to get a scroll bar in
FlowPage?
> > > > > >
> > > > > > Thank you.
> > > > > >
> > > > > >
> > > > > >
> > > > > > pane = new FreeformLayer();
> > > > > >
> > > > > > pane.setLayoutManager(new FreeformLayout());
> > > > > >
> > > > > > setLayoutManager(new StackLayout());
> > > > > >
> > > > > > ScrollPane scrollpane = new ScrollPane();
> > > > > >
> > > > > >
> > > > > >
> > > > > > add(scrollpane);
> > > > > >
> > > > > > scrollpane.setViewport(new FreeformViewport());
> > > > > >
> > > > > > // createFlowPage is based on the FlowPage example in draw2d
cvs.
> > > > > >
> > > > > > IFigure flowPage = createFlowPage();
> > > > > >
> > > > > > scrollpane.setView(pane);
> > > > > >
> > > > > > pane.add(flowPage);
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03893 seconds