Home » Eclipse Projects » Eclipse Platform » Possible bug in TitleAreaDialog
Possible bug in TitleAreaDialog [message #106643] |
Tue, 05 August 2003 06:25  |
Eclipse User |
|
|
|
Originally posted by: scheglov_ke.nlmk.ru
I am not sure, may be this is expected behaviour, but image in
title area does not fit in dialog. Reason is in following code:
titleImage = new Label(parent, SWT.CENTER);
titleImage.setBackground(background);
titleImage.setImage(JFaceResources.getImage(DLG_IMG_TITLE_BA NNER));
FormData imageData = new FormData();
imageData.top = new FormAttachment(0, verticalSpacing);
imageData.right = new FormAttachment(100, horizontalSpacing);
titleImage.setLayoutData(imageData);
As you can see, right edge of image is right edge of dialog _plus_ spacing.
But this means, that right edge of image is not visible! May be _minus_
required here?
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
|
|
|
Re: Possible bug in TitleAreaDialog [message #107023 is a reply to message #106643] |
Tue, 05 August 2003 17:15   |
Eclipse User |
|
|
|
Originally posted by: Kevin.clark.accessbc.com.nospam
What are the values of verticalSpacing and horizaontalSpacing?
When you attach to the right, and want to offset towards the left (i.e.
move it away from the right edge), you need to make the offset a negative
value. When you attach to the bottom, and want to offset towards the top,
you also need a negative value.
i.e. This will create a border of 5 pixels all the way around:
FormData imageData = new FormData();
imageData.top = new FormAttachment(0, 5);
imageData.left = new FormAttachment(0, 5);
imageData.right = new FormAttachment(100, -5);
imageData.bottom = new FormAttachment(0, -5);
titleImage.setLayoutData(imageData);
Hope this helps... I'm sure that you would know this already. Perhaps a
silly coding mistake!?
Kevin
Konstantin Scheglov wrote:
> I am not sure, may be this is expected behaviour, but image in
> title area does not fit in dialog. Reason is in following code:
> titleImage = new Label(parent, SWT.CENTER);
> titleImage.setBackground(background);
> titleImage.setImage(JFaceResources.getImage(DLG_IMG_TITLE_BA NNER));
> FormData imageData = new FormData();
> imageData.top = new FormAttachment(0, verticalSpacing);
> imageData.right = new FormAttachment(100, horizontalSpacing);
> titleImage.setLayoutData(imageData);
> As you can see, right edge of image is right edge of dialog _plus_ spacing.
> But this means, that right edge of image is not visible! May be _minus_
> required here?
|
|
|
Re: Possible bug in TitleAreaDialog [message #107035 is a reply to message #107023] |
Tue, 05 August 2003 17:20   |
Eclipse User |
|
|
|
Originally posted by: Kevin.clark.accessbc.com.nospam
Speaking of silly coding mistakes, the line in my example that reads:
imageData.bottom = new FormAttachment(0, -5);
should actually be
imageData.bottom = new FormAttachment(100, -5);
Kevbo wrote:
> What are the values of verticalSpacing and horizaontalSpacing?
> When you attach to the right, and want to offset towards the left (i.e.
> move it away from the right edge), you need to make the offset a negative
> value. When you attach to the bottom, and want to offset towards the top,
> you also need a negative value.
> i.e. This will create a border of 5 pixels all the way around:
> FormData imageData = new FormData();
> imageData.top = new FormAttachment(0, 5);
> imageData.left = new FormAttachment(0, 5);
> imageData.right = new FormAttachment(100, -5);
> imageData.bottom = new FormAttachment(0, -5);
> titleImage.setLayoutData(imageData);
> Hope this helps... I'm sure that you would know this already. Perhaps a
> silly coding mistake!?
> Kevin
> Konstantin Scheglov wrote:
> > I am not sure, may be this is expected behaviour, but image in
> > title area does not fit in dialog. Reason is in following code:
> > titleImage = new Label(parent, SWT.CENTER);
> > titleImage.setBackground(background);
> > titleImage.setImage(JFaceResources.getImage(DLG_IMG_TITLE_BA NNER));
> > FormData imageData = new FormData();
> > imageData.top = new FormAttachment(0, verticalSpacing);
> > imageData.right = new FormAttachment(100, horizontalSpacing);
> > titleImage.setLayoutData(imageData);
> > As you can see, right edge of image is right edge of dialog _plus_
spacing.
> > But this means, that right edge of image is not visible! May be _minus_
> > required here?
|
|
|
Re: Possible bug in TitleAreaDialog [message #107256 is a reply to message #107023] |
Tue, 05 August 2003 23:26  |
Eclipse User |
|
|
|
Originally posted by: scheglov_ke.nlmk.ru
Kevbo <Kevin.clark@accessbc.com.nospam> wrote:
Yes, of course I know, that there should -horizontalSpacing using.
But this is code from JFace TitleAreaDialog, not my.
So, I just sak, may be developer of this code has reason for this.
However, I found another bug in TitleAreaDialog, there is FormData
setting for parent, and parent is not in FormLayout, so I can suggest,
that problem with image is also bug...
Well, I add bug 41172.
> What are the values of verticalSpacing and horizaontalSpacing?
> When you attach to the right, and want to offset towards the left (i.e.
> move it away from the right edge), you need to make the offset a negative
> value. When you attach to the bottom, and want to offset towards the top,
> you also need a negative value.
> i.e. This will create a border of 5 pixels all the way around:
> FormData imageData = new FormData();
> imageData.top = new FormAttachment(0, 5);
> imageData.left = new FormAttachment(0, 5);
> imageData.right = new FormAttachment(100, -5);
> imageData.bottom = new FormAttachment(0, -5);
> titleImage.setLayoutData(imageData);
> Hope this helps... I'm sure that you would know this already. Perhaps a
> silly coding mistake!?
> Kevin
> Konstantin Scheglov wrote:
>> I am not sure, may be this is expected behaviour, but image in
>> title area does not fit in dialog. Reason is in following code:
>> titleImage = new Label(parent, SWT.CENTER);
>> titleImage.setBackground(background);
>> titleImage.setImage(JFaceResources.getImage(DLG_IMG_TITLE_BA NNER));
>> FormData imageData = new FormData();
>> imageData.top = new FormAttachment(0, verticalSpacing);
>> imageData.right = new FormAttachment(100, horizontalSpacing);
>> titleImage.setLayoutData(imageData);
>> As you can see, right edge of image is right edge of dialog _plus_ spacing.
>> But this means, that right edge of image is not visible! May be _minus_
>> required here?
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
|
|
|
Goto Forum:
Current Time: Thu Jul 17 04:32:55 EDT 2025
Powered by FUDForum. Page generated in 0.04801 seconds
|