Home » Eclipse Projects » GEF » Re: Changing the size of scrollbar
Re: Changing the size of scrollbar [message #179689] |
Fri, 29 April 2005 11:00  |
Eclipse User |
|
|
|
Originally posted by: jdelgad.correo.ugr.es
Hi,
two days ago, I asked for changing the size of a scroll-bar which is
contained inside a figure. Here I post the code. If you can help me in
changing the size of the scroll bar (because the border of the figure
hides the half of the scroll bar), please, tell me how. Thank you very
much.
...
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 #179823 is a reply to message #179689] |
Sun, 01 May 2005 17:47  |
Eclipse User |
|
|
|
Randy already answered your question then. You don't have to make the
scrollbar thinner. Your border should return proper insets and things will
be fine. Look at other subclasses of AbstractBorder.
"Jose" <jdelgad@correo.ugr.es> wrote in message
news:0cc9536c711ea89630b4303f9fbe2013$1@www.eclipse.org...
> Hi,
>
> two days ago, I asked for changing the size of a scroll-bar which is
> contained inside a figure. Here I post the code. If you can help me in
> changing the size of the scroll bar (because the border of the figure
> hides the half of the scroll bar), please, tell me how. Thank you very
> much.
>
>
> ..
>
> 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.
>
>
|
|
|
Goto Forum:
Current Time: Sat Jul 12 16:48:15 EDT 2025
Powered by FUDForum. Page generated in 0.03934 seconds
|