Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Changing the size of scrollbar
Changing the size of scrollbar [message #179419] Wed, 27 April 2005 09:40 Go to next message
Eclipse UserFriend
Originally posted by: jdelgad.correo.ugr.es

Hi,

I have a figure which can content other figures inside it. This figure
has a scrollpane associated to it. The problem is that the figure has a
border that hides the half of the vertical and horizontal scroll bars. How
can I change the size of the scroll pane or the size of the scroll bars?

Thank you very much.

--Jose.
Re: Changing the size of scrollbar [message #179444 is a reply to message #179419] Wed, 27 April 2005 14:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

ScrollpaneLayout should handle borders already. Can you post some code?

"Jose" <jdelgad@correo.ugr.es> wrote in message
news:ab57eec66c81f27baee861dfbe2b60ed$1@www.eclipse.org...
> Hi,
>
> I have a figure which can content other figures inside it. This figure
> has a scrollpane associated to it. The problem is that the figure has a
> border that hides the half of the vertical and horizontal scroll bars. How
> can I change the size of the scroll pane or the size of the scroll bars?
>
> Thank you very much.
>
> --Jose.
>
Re: Changing the size of scrollbar [message #179483 is a reply to message #179444] Wed, 27 April 2005 19:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdelgad.correo.ugr.es

Hello Randy, here you have the code:

...

public ComplexFigure() {
setBorder(new ComplexFigureBorder());
ScrollPane scrollpane = new ScrollPane();
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
setLayoutManager(new StackLayout());
add(scrollpane);
scrollpane.setViewport(new FreeformViewport());
scrollpane.setContents(pane);


setBackgroundColor(new Color(null, 230, 230, 230));
}
...

public class ComplexFigureBorder extends AbstractBorder {

...
public void paint(IFigure figure, Graphics g, Insets in) {
Rectangle r = figure.getBounds().getCropped(in);

g.setForegroundColor(new Color(null, 222, 220, 122));
g.setBackgroundColor(new Color(null, 222, 220, 122));

//Se dibuja el borde grueso
g.fillRectangle(r.x, r.y+2, r.width, 12);
g.fillRectangle(r.x, r.bottom() - 14, r.width, 12);
g.fillRectangle(r.x, r.y + 2, 12, r.height - 4);
g.fillRectangle(r.right() - 12, r.y + 2, 12, r.height - 4);

}
...
}


Can you help me?

Thank you very much.

--Jose.
Re: Changing the size of scrollbar [message #179697 is a reply to message #179483] Fri, 29 April 2005 15:00 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Your border doesn't have any insets. How will the layout mangaer's know how
much space to reserve?

> public ComplexFigure() {
> setBorder(new ComplexFigureBorder());
> ScrollPane scrollpane = new ScrollPane();
> pane = new FreeformLayer();
> pane.setLayoutManager(new FreeformLayout()); setLayoutManager(new
> StackLayout()); add(scrollpane); scrollpane.setViewport(new
> FreeformViewport());
> scrollpane.setContents(pane);
>
>
> setBackgroundColor(new Color(null, 230, 230, 230));
> }
> ..
>
> public class ComplexFigureBorder extends AbstractBorder {
>
> ...
> public void paint(IFigure figure, Graphics g, Insets in) {
> Rectangle r = figure.getBounds().getCropped(in);
>
> g.setForegroundColor(new Color(null, 222, 220, 122));
> g.setBackgroundColor(new Color(null, 222, 220, 122));
>
> //Se dibuja el borde grueso
> g.fillRectangle(r.x, r.y+2, r.width, 12);
> g.fillRectangle(r.x, r.bottom() - 14, r.width, 12);
> g.fillRectangle(r.x, r.y + 2, 12, r.height - 4);
> g.fillRectangle(r.right() - 12, r.y + 2, 12, r.height - 4);
>
> }
> ...
> }
Previous Topic:Prevent certain connections
Next Topic:Clickable in a Draw2D figure
Goto Forum:
  


Current Time: Tue Apr 16 11:40:59 GMT 2024

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

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

Back to the top