Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » PGroup (RectangleGroupStrategy) background color issue
PGroup (RectangleGroupStrategy) background color issue [message #19398] Mon, 04 December 2006 10:12 Go to next message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
Hello,

I'm having a trouble with a PGroup background color when using
RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
(a bit odd style bit to imply rounded corners imo), if setting
background color to the PGroup to anything different from parent
background, the new background bleeds through the border, effectively
defeating the whole idea of having the border arount the group content...

--
Roland Tepp
Re: PGroup (RectangleGroupStrategy) background color issue [message #19490 is a reply to message #19398] Mon, 04 December 2006 10:53 Go to previous messageGo to next message
Chris Gross is currently offline Chris Gross
Messages: 253
Registered: July 2009
Senior Member
Hi Roland,

I think I know what you mean but I'm not exactly sure. Can you attach a
picture?

-Chris

SWT.SMOOTH may not be the best name but I have to make do with what I
got (i.e. the exising SWT constants).

Roland Tepp wrote:
> Hello,
>
> I'm having a trouble with a PGroup background color when using
> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
> (a bit odd style bit to imply rounded corners imo), if setting
> background color to the PGroup to anything different from parent
> background, the new background bleeds through the border, effectively
> defeating the whole idea of having the border arount the group content...
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #19535 is a reply to message #19490] Mon, 04 December 2006 11:29 Go to previous messageGo to next message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070404050109070606020007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Chris,

Attached to this message are the modified PGroup snippet code along with
the screenshot this code produces, illustrating my problem.

As You can see from the screenshot, the background of PGroup is bleeding
through the border here at the corners of the PGroup, where they should
be white, they are red instead.

It gets actually worse if I have an image set with the SWT.TOP style bit
in image positioning flag, where the entire top area of the PGroup gets
painted red...


Chris Gross kirjutas mulle midagi seesugust:
> Hi Roland,
>
> I think I know what you mean but I'm not exactly sure. Can you attach a
> picture?
>
> -Chris
>
> SWT.SMOOTH may not be the best name but I have to make do with what I
> got (i.e. the exising SWT constants).
>
> Roland Tepp wrote:
>> Hello,
>>
>> I'm having a trouble with a PGroup background color when using
>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>> (a bit odd style bit to imply rounded corners imo), if setting
>> background color to the PGroup to anything different from parent
>> background, the new background bleeds through the border, effectively
>> defeating the whole idea of having the border arount the group content...
>>

--
Roland Tepp

--------------070404050109070606020007
Content-Type: text/plain;
name="PGroupSnippet1.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="PGroupSnippet1.java"

/*********************************************************** ********************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
************************************************************ *******************/
package org.eclipse.swt.nebula.snippets.pgroup;


import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell;

/*
* Creates a PGroup.
*
* For a list of all Nebula PGroup example snippets see
* http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
*/
public class PGroupSnippet1 {

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;

GridLayout gridLayout = new GridLayout();
gridLayout.marginWidth = 15;
gridLayout.marginHeight = 15;
shell.setLayout(gridLayout);

PGroup group = new PGroup(shell, SWT.SMOOTH);
group.setBackgroundMode(SWT.INHERIT_FORCE);
group.setText("Example");

RectangleGroupStrategy strategy = new RectangleGroupStrategy();
strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
group.setStrategy(strategy);
// group.setToggleRenderer(new TwisteToggleRenderer());

group.setLayout(new GridLayout());
group.setBackground(display.getSystemColor(SWT.COLOR_RED));

Label label = new Label(group,SWT.NONE);
label.setText("Contents");
Button button = new Button(group,SWT.PUSH);
button.setText("Contents");
Scale scale = new Scale(group, SWT.HORIZONTAL);

shell.pack();
shell.open ();

while (!shell.isDisposed()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
--------------070404050109070606020007
Content-Type: image/png;
name="PGroup-bg-bleed.png"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="PGroup-bg-bleed.png"

iVBORw0KGgoAAAANSUhEUgAAANAAAACZCAIAAADRkSOHAAAABmJLR0QA/wD/ AP+gvaeTAAAA
CXBIWXMAAA7EAAAOxAGVKw4bAAANnklEQVR4nO3deXAUVR4H8G9nIYlKTGQT QsIRQkAgBGFh
USPrQhZdYcUySIkHGBDQEIN4FYKwoKBSrLglN0YuYRUlhUVRi+ARDHEFLxB0 IUY2yQwiRwho
JhBmpqf7vf2jp4dJAkmnZ+alE36f6kpN9/y63xvmy+vuOXokzjkIESWsuTtA ri4UOCIUBY4I
RYEjQlHgiFAUOCIUBY4IRYEjQlHgiFAUOCIUBY4IRYEjQrUxVCVJ/nPPbK8M SV9Iy/HGvXG1
5g1/BEQy9GkRPXBPb6toWr9Iq7ZkdLz3VigC99QHp0z2i7ReS8ckACEI3PT8 EwH0irRmy8Z2
Mh44Y8dwAGeq2f6QlqHXtiEYvReN/f1p9N5AWjE0wj353rFA2iAtQi/gp9pL lj+UVOepr1/j
qzTYiqERjqvM4OZCJbnDiiHX4fiZaUU1zdyT1kv6eDi/a7dvdsX4ZADLH0qa 9o7tSjUmGAsc
qx245PiVt7fzzZ05fHz+d3IgnWgc04ZhXrcnJHikOz/1/fOuzEoBkLupbGVW yorxybmbyurX
mGMwcLUP4LRn/+eTT3x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FgSNCUeCIUBQ4IlRoA/f+5vyQbp8EkZgnyyoj XJMerfHiUFQ2
ewdC1FUxrBI4cpWgwBGxuAFZ8wu43+9M0kST/5Q1v8BIijQBfaehvvOOU/uP nnXJcp0PZcoe
T9X5i2OG9omKTrjCquSqEOTA7T969nRE+TfXfeZkTg5v6FSuHnf+3KVq4Okt p2cFtz3S0gQ5
cC5Z/ua6zy6o50+6TjJ4v43MOCu9UFqilCReSAluc6TFCXLgOMcU9dm+aV2r q6urquTz1Rch
8erqakTCcV31Hvm74DZHWhw6SyVCUeCIUBQ4IhQFjghFgSNCBfkstVHr1+YJ bpGYMG78OFWR
r23XPuhbFh24++/PFNwiMYEztW34NaHYsujAMcUpuEViRtvIEG1YdOCi2ycJ bpGY4HbXeGRn
2xBsWXTgrHZtL3JZESHbMp2lEqEocEQoChwRigJHhKLAEaGCfJYqezzPOieX FpaqDhW+T5lz
sAuMufkj0gvBbY60OEEOXNX5i12qBpYoJayacd/vXUkAx8BzGbJirZ8QIeIF OXBjhvY5veV0
4oUUWXb7L5ckSVbkl6Y/jLnPBbdF0rIEOXBR0QkNfU2G0nbVs8q1RVrQlRaa vQPN3tVA0Fkq
EYoCR8QK6aUe3tuc3+wXIqDJ4GT6yWrSpR5CO8I9+PDYkG6fBJGYJ4t2qUQo ChwRigJHhKLA
EaEocEQoChwRigJHhKLAEaEocEQsQ+9HaG9fNPd7LzRZcPIGwyJvbRFSl8ER jtMgR1O96VIk
DJN4nV9UuCz9+gwT5hcA2PjiHSH9P0Csr24SjKQIANC0wPk3Rq5mdQedIAeO kCChkwYiFAWO
CEWBI0JR4IhQFDgiFAWOCEWBI0JR4IhQFDgiFAWOCEWBI0JR4IhQFDgiFAWO CEWBI0L9H1hY
ThmuRNXnAAAAAElFTkSuQmCC
--------------070404050109070606020007--
Re: PGroup (RectangleGroupStrategy) background color issue [message #19580 is a reply to message #19535] Mon, 04 December 2006 16:13 Go to previous messageGo to next message
Chris Gross is currently offline Chris Gross
Messages: 253
Registered: July 2009
Senior Member
Hi Roland,

Hmm.. Let me investigate this. I had specifically designed the new
PGroup background drawing logic to ensure that the new SWT 'inherit
background' features worked. Perhaps I was a bit over-zealous.

-Chris

Roland Tepp wrote:
> Hi Chris,
>
> Attached to this message are the modified PGroup snippet code along with
> the screenshot this code produces, illustrating my problem.
>
> As You can see from the screenshot, the background of PGroup is bleeding
> through the border here at the corners of the PGroup, where they should
> be white, they are red instead.
>
> It gets actually worse if I have an image set with the SWT.TOP style bit
> in image positioning flag, where the entire top area of the PGroup gets
> painted red...
>
>
> Chris Gross kirjutas mulle midagi seesugust:
>> Hi Roland,
>>
>> I think I know what you mean but I'm not exactly sure. Can you attach
>> a picture?
>>
>> -Chris
>>
>> SWT.SMOOTH may not be the best name but I have to make do with what I
>> got (i.e. the exising SWT constants).
>>
>> Roland Tepp wrote:
>>> Hello,
>>>
>>> I'm having a trouble with a PGroup background color when using
>>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>>> (a bit odd style bit to imply rounded corners imo), if setting
>>> background color to the PGroup to anything different from parent
>>> background, the new background bleeds through the border, effectively
>>> defeating the whole idea of having the border arount the group
>>> content...
>>>
>
>
> ------------------------------------------------------------ ------------
>
> /*********************************************************** ********************
> * Copyright (c) 2006 IBM Corporation and others.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
> ************************************************************ *******************/
> package org.eclipse.swt.nebula.snippets.pgroup;
>
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
> import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Scale;
> import org.eclipse.swt.widgets.Shell;
>
> /*
> * Creates a PGroup.
> *
> * For a list of all Nebula PGroup example snippets see
> * http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
> */
> public class PGroupSnippet1 {
>
> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;
>
> GridLayout gridLayout = new GridLayout();
> gridLayout.marginWidth = 15;
> gridLayout.marginHeight = 15;
> shell.setLayout(gridLayout);
>
> PGroup group = new PGroup(shell, SWT.SMOOTH);
> group.setBackgroundMode(SWT.INHERIT_FORCE);
> group.setText("Example");
>
> RectangleGroupStrategy strategy = new RectangleGroupStrategy();
> strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
> group.setStrategy(strategy);
> // group.setToggleRenderer(new TwisteToggleRenderer());
>
> group.setLayout(new GridLayout());
> group.setBackground(display.getSystemColor(SWT.COLOR_RED));
>
> Label label = new Label(group,SWT.NONE);
> label.setText("Contents");
> Button button = new Button(group,SWT.PUSH);
> button.setText("Contents");
> Scale scale = new Scale(group, SWT.HORIZONTAL);
>
> shell.pack();
> shell.open ();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
>
> ------------------------------------------------------------ ------------
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #19670 is a reply to message #19535] Tue, 05 December 2006 16:56 Go to previous messageGo to next message
Chris Gross is currently offline Chris Gross
Messages: 253
Registered: July 2009
Senior Member
Roland,

I've updated PGroup again. Please try the new drop and see if that
works for you. I had to modify the background drawing logic.

Regards,
-Chris

Roland Tepp wrote:
> Hi Chris,
>
> Attached to this message are the modified PGroup snippet code along with
> the screenshot this code produces, illustrating my problem.
>
> As You can see from the screenshot, the background of PGroup is bleeding
> through the border here at the corners of the PGroup, where they should
> be white, they are red instead.
>
> It gets actually worse if I have an image set with the SWT.TOP style bit
> in image positioning flag, where the entire top area of the PGroup gets
> painted red...
>
>
> Chris Gross kirjutas mulle midagi seesugust:
>> Hi Roland,
>>
>> I think I know what you mean but I'm not exactly sure. Can you attach
>> a picture?
>>
>> -Chris
>>
>> SWT.SMOOTH may not be the best name but I have to make do with what I
>> got (i.e. the exising SWT constants).
>>
>> Roland Tepp wrote:
>>> Hello,
>>>
>>> I'm having a trouble with a PGroup background color when using
>>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>>> (a bit odd style bit to imply rounded corners imo), if setting
>>> background color to the PGroup to anything different from parent
>>> background, the new background bleeds through the border, effectively
>>> defeating the whole idea of having the border arount the group
>>> content...
>>>
>
>
> ------------------------------------------------------------ ------------
>
> /*********************************************************** ********************
> * Copyright (c) 2006 IBM Corporation and others.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
> ************************************************************ *******************/
> package org.eclipse.swt.nebula.snippets.pgroup;
>
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
> import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Scale;
> import org.eclipse.swt.widgets.Shell;
>
> /*
> * Creates a PGroup.
> *
> * For a list of all Nebula PGroup example snippets see
> * http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
> */
> public class PGroupSnippet1 {
>
> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;
>
> GridLayout gridLayout = new GridLayout();
> gridLayout.marginWidth = 15;
> gridLayout.marginHeight = 15;
> shell.setLayout(gridLayout);
>
> PGroup group = new PGroup(shell, SWT.SMOOTH);
> group.setBackgroundMode(SWT.INHERIT_FORCE);
> group.setText("Example");
>
> RectangleGroupStrategy strategy = new RectangleGroupStrategy();
> strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
> group.setStrategy(strategy);
> // group.setToggleRenderer(new TwisteToggleRenderer());
>
> group.setLayout(new GridLayout());
> group.setBackground(display.getSystemColor(SWT.COLOR_RED));
>
> Label label = new Label(group,SWT.NONE);
> label.setText("Contents");
> Button button = new Button(group,SWT.PUSH);
> button.setText("Contents");
> Scale scale = new Scale(group, SWT.HORIZONTAL);
>
> shell.pack();
> shell.open ();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
>
> ------------------------------------------------------------ ------------
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #21257 is a reply to message #19670] Thu, 21 December 2006 05:09 Go to previous messageGo to next message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
Thanks, I'll take a look...

Chris Gross kirjutas mulle midagi seesugust:
> Roland,
>
> I've updated PGroup again. Please try the new drop and see if that
> works for you. I had to modify the background drawing logic.
>
> Regards,
> -Chris
>
> Roland Tepp wrote:
>> Hi Chris,
>>
>> Attached to this message are the modified PGroup snippet code along
>> with the screenshot this code produces, illustrating my problem.
>>
>> As You can see from the screenshot, the background of PGroup is
>> bleeding through the border here at the corners of the PGroup, where
>> they should be white, they are red instead.
>>
>> It gets actually worse if I have an image set with the SWT.TOP style
>> bit in image positioning flag, where the entire top area of the PGroup
>> gets painted red...
>>
>>
>> Chris Gross kirjutas mulle midagi seesugust:
>>> Hi Roland,
>>>
>>> I think I know what you mean but I'm not exactly sure. Can you
>>> attach a picture?
>>>
>>> -Chris
>>>
>>> SWT.SMOOTH may not be the best name but I have to make do with what I
>>> got (i.e. the exising SWT constants).
>>>
>>> Roland Tepp wrote:
>>>> Hello,
>>>>
>>>> I'm having a trouble with a PGroup background color when using
>>>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>>>> (a bit odd style bit to imply rounded corners imo), if setting
>>>> background color to the PGroup to anything different from parent
>>>> background, the new background bleeds through the border,
>>>> effectively defeating the whole idea of having the border arount the
>>>> group content...
>>>>
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> /*********************************************************** ********************
>>
>> * Copyright (c) 2006 IBM Corporation and others.
>> * All rights reserved. This program and the accompanying materials
>> * are made available under the terms of the Eclipse Public License v1.0
>> * which accompanies this distribution, and is available at
>> * http://www.eclipse.org/legal/epl-v10.html
>> *
>> * Contributors:
>> * IBM Corporation - initial API and implementation
>> ************************************************************ *******************/
>>
>> package org.eclipse.swt.nebula.snippets.pgroup;
>>
>>
>> import org.eclipse.swt.SWT;
>> import org.eclipse.swt.layout.GridLayout;
>> import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
>> import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
>> import org.eclipse.swt.widgets.Button;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.widgets.Label;
>> import org.eclipse.swt.widgets.Scale;
>> import org.eclipse.swt.widgets.Shell;
>>
>> /*
>> * Creates a PGroup.
>> *
>> * For a list of all Nebula PGroup example snippets see
>> * http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
>> */
>> public class PGroupSnippet1 {
>>
>> public static void main (String [] args) {
>> Display display = new Display ();
>> Shell shell = new Shell (display);
>> shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;
>> GridLayout gridLayout = new GridLayout();
>> gridLayout.marginWidth = 15;
>> gridLayout.marginHeight = 15;
>> shell.setLayout(gridLayout);
>>
>> PGroup group = new PGroup(shell, SWT.SMOOTH);
>> group.setBackgroundMode(SWT.INHERIT_FORCE);
>> group.setText("Example");
>> RectangleGroupStrategy strategy = new RectangleGroupStrategy();
>> strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
>> group.setStrategy(strategy);
>> // group.setToggleRenderer(new TwisteToggleRenderer());
>> group.setLayout(new GridLayout());
>> group.setBackground(display.getSystemColor(SWT.COLOR_RED));
>> Label label = new Label(group,SWT.NONE);
>> label.setText("Contents");
>> Button button = new Button(group,SWT.PUSH);
>> button.setText("Contents");
>> Scale scale = new Scale(group, SWT.HORIZONTAL);
>> shell.pack();
>> shell.open ();
>> while (!shell.isDisposed()) {
>> if (!display.readAndDispatch ()) display.sleep ();
>> }
>> display.dispose ();
>> }
>> }
>>
>> ------------------------------------------------------------ ------------
>>

--
Roland Tepp
Re: PGroup (RectangleGroupStrategy) background color issue [message #26774 is a reply to message #19670] Tue, 06 February 2007 06:03 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5003
Registered: July 2009
Senior Member
Hi,

is this only in CVS or do I also get this fix when downloading the jar,
because I see the same effect here with the jar I downloaded.

Tom

Chris Gross schrieb:
> Roland,
>
> I've updated PGroup again. Please try the new drop and see if that
> works for you. I had to modify the background drawing logic.
>
> Regards,
> -Chris
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #571401 is a reply to message #19398] Mon, 04 December 2006 10:53 Go to previous message
Chris Gross is currently offline Chris Gross
Messages: 471
Registered: July 2009
Senior Member
Hi Roland,

I think I know what you mean but I'm not exactly sure. Can you attach a
picture?

-Chris

SWT.SMOOTH may not be the best name but I have to make do with what I
got (i.e. the exising SWT constants).

Roland Tepp wrote:
> Hello,
>
> I'm having a trouble with a PGroup background color when using
> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
> (a bit odd style bit to imply rounded corners imo), if setting
> background color to the PGroup to anything different from parent
> background, the new background bleeds through the border, effectively
> defeating the whole idea of having the border arount the group content...
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #571429 is a reply to message #19490] Mon, 04 December 2006 11:29 Go to previous message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070404050109070606020007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Chris,

Attached to this message are the modified PGroup snippet code along with
the screenshot this code produces, illustrating my problem.

As You can see from the screenshot, the background of PGroup is bleeding
through the border here at the corners of the PGroup, where they should
be white, they are red instead.

It gets actually worse if I have an image set with the SWT.TOP style bit
in image positioning flag, where the entire top area of the PGroup gets
painted red...


Chris Gross kirjutas mulle midagi seesugust:
> Hi Roland,
>
> I think I know what you mean but I'm not exactly sure. Can you attach a
> picture?
>
> -Chris
>
> SWT.SMOOTH may not be the best name but I have to make do with what I
> got (i.e. the exising SWT constants).
>
> Roland Tepp wrote:
>> Hello,
>>
>> I'm having a trouble with a PGroup background color when using
>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>> (a bit odd style bit to imply rounded corners imo), if setting
>> background color to the PGroup to anything different from parent
>> background, the new background bleeds through the border, effectively
>> defeating the whole idea of having the border arount the group content...
>>

--
Roland Tepp

--------------070404050109070606020007
Content-Type: text/plain;
name="PGroupSnippet1.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="PGroupSnippet1.java"

/*********************************************************** ********************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
************************************************************ *******************/
package org.eclipse.swt.nebula.snippets.pgroup;


import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell;

/*
* Creates a PGroup.
*
* For a list of all Nebula PGroup example snippets see
* http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
*/
public class PGroupSnippet1 {

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;

GridLayout gridLayout = new GridLayout();
gridLayout.marginWidth = 15;
gridLayout.marginHeight = 15;
shell.setLayout(gridLayout);

PGroup group = new PGroup(shell, SWT.SMOOTH);
group.setBackgroundMode(SWT.INHERIT_FORCE);
group.setText("Example");

RectangleGroupStrategy strategy = new RectangleGroupStrategy();
strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
group.setStrategy(strategy);
// group.setToggleRenderer(new TwisteToggleRenderer());

group.setLayout(new GridLayout());
group.setBackground(display.getSystemColor(SWT.COLOR_RED));

Label label = new Label(group,SWT.NONE);
label.setText("Contents");
Button button = new Button(group,SWT.PUSH);
button.setText("Contents");
Scale scale = new Scale(group, SWT.HORIZONTAL);

shell.pack();
shell.open ();

while (!shell.isDisposed()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
--------------070404050109070606020007
Content-Type: image/png;
name="PGroup-bg-bleed.png"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="PGroup-bg-bleed.png"

iVBORw0KGgoAAAANSUhEUgAAANAAAACZCAIAAADRkSOHAAAABmJLR0QA/wD/ AP+gvaeTAAAA
CXBIWXMAAA7EAAAOxAGVKw4bAAANnklEQVR4nO3deXAUVR4H8G9nIYlKTGQT QsIRQkAgBGFh
USPrQhZdYcUySIkHGBDQEIN4FYKwoKBSrLglN0YuYRUlhUVRi+ARDHEFLxB0 IUY2yQwiRwho
JhBmpqf7vf2jp4dJAkmnZ+alE36f6kpN9/y63xvmy+vuOXokzjkIESWsuTtA ri4UOCIUBY4I
RYEjQlHgiFAUOCIUBY4IRYEjQlHgiFAUOCIUBY4IRYEjQrUxVCVJ/nPPbK8M SV9Iy/HGvXG1
5g1/BEQy9GkRPXBPb6toWr9Iq7ZkdLz3VigC99QHp0z2i7ReS8ckACEI3PT8 EwH0irRmy8Z2
Mh44Y8dwAGeq2f6QlqHXtiEYvReN/f1p9N5AWjE0wj353rFA2iAtQi/gp9pL lj+UVOepr1/j
qzTYiqERjqvM4OZCJ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I0L9H1hY
ThmuRNXnAAAAAElFTkSuQmCC
--------------070404050109070606020007--
Re: PGroup (RectangleGroupStrategy) background color issue [message #571461 is a reply to message #19535] Mon, 04 December 2006 16:13 Go to previous message
Chris Gross is currently offline Chris Gross
Messages: 471
Registered: July 2009
Senior Member
Hi Roland,

Hmm.. Let me investigate this. I had specifically designed the new
PGroup background drawing logic to ensure that the new SWT 'inherit
background' features worked. Perhaps I was a bit over-zealous.

-Chris

Roland Tepp wrote:
> Hi Chris,
>
> Attached to this message are the modified PGroup snippet code along with
> the screenshot this code produces, illustrating my problem.
>
> As You can see from the screenshot, the background of PGroup is bleeding
> through the border here at the corners of the PGroup, where they should
> be white, they are red instead.
>
> It gets actually worse if I have an image set with the SWT.TOP style bit
> in image positioning flag, where the entire top area of the PGroup gets
> painted red...
>
>
> Chris Gross kirjutas mulle midagi seesugust:
>> Hi Roland,
>>
>> I think I know what you mean but I'm not exactly sure. Can you attach
>> a picture?
>>
>> -Chris
>>
>> SWT.SMOOTH may not be the best name but I have to make do with what I
>> got (i.e. the exising SWT constants).
>>
>> Roland Tepp wrote:
>>> Hello,
>>>
>>> I'm having a trouble with a PGroup background color when using
>>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>>> (a bit odd style bit to imply rounded corners imo), if setting
>>> background color to the PGroup to anything different from parent
>>> background, the new background bleeds through the border, effectively
>>> defeating the whole idea of having the border arount the group
>>> content...
>>>
>
>
> ------------------------------------------------------------ ------------
>
> /*********************************************************** ********************
> * Copyright (c) 2006 IBM Corporation and others.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
> ************************************************************ *******************/
> package org.eclipse.swt.nebula.snippets.pgroup;
>
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
> import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Scale;
> import org.eclipse.swt.widgets.Shell;
>
> /*
> * Creates a PGroup.
> *
> * For a list of all Nebula PGroup example snippets see
> * http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
> */
> public class PGroupSnippet1 {
>
> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;
>
> GridLayout gridLayout = new GridLayout();
> gridLayout.marginWidth = 15;
> gridLayout.marginHeight = 15;
> shell.setLayout(gridLayout);
>
> PGroup group = new PGroup(shell, SWT.SMOOTH);
> group.setBackgroundMode(SWT.INHERIT_FORCE);
> group.setText("Example");
>
> RectangleGroupStrategy strategy = new RectangleGroupStrategy();
> strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
> group.setStrategy(strategy);
> // group.setToggleRenderer(new TwisteToggleRenderer());
>
> group.setLayout(new GridLayout());
> group.setBackground(display.getSystemColor(SWT.COLOR_RED));
>
> Label label = new Label(group,SWT.NONE);
> label.setText("Contents");
> Button button = new Button(group,SWT.PUSH);
> button.setText("Contents");
> Scale scale = new Scale(group, SWT.HORIZONTAL);
>
> shell.pack();
> shell.open ();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
>
> ------------------------------------------------------------ ------------
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #571522 is a reply to message #19535] Tue, 05 December 2006 16:56 Go to previous message
Chris Gross is currently offline Chris Gross
Messages: 471
Registered: July 2009
Senior Member
Roland,

I've updated PGroup again. Please try the new drop and see if that
works for you. I had to modify the background drawing logic.

Regards,
-Chris

Roland Tepp wrote:
> Hi Chris,
>
> Attached to this message are the modified PGroup snippet code along with
> the screenshot this code produces, illustrating my problem.
>
> As You can see from the screenshot, the background of PGroup is bleeding
> through the border here at the corners of the PGroup, where they should
> be white, they are red instead.
>
> It gets actually worse if I have an image set with the SWT.TOP style bit
> in image positioning flag, where the entire top area of the PGroup gets
> painted red...
>
>
> Chris Gross kirjutas mulle midagi seesugust:
>> Hi Roland,
>>
>> I think I know what you mean but I'm not exactly sure. Can you attach
>> a picture?
>>
>> -Chris
>>
>> SWT.SMOOTH may not be the best name but I have to make do with what I
>> got (i.e. the exising SWT constants).
>>
>> Roland Tepp wrote:
>>> Hello,
>>>
>>> I'm having a trouble with a PGroup background color when using
>>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>>> (a bit odd style bit to imply rounded corners imo), if setting
>>> background color to the PGroup to anything different from parent
>>> background, the new background bleeds through the border, effectively
>>> defeating the whole idea of having the border arount the group
>>> content...
>>>
>
>
> ------------------------------------------------------------ ------------
>
> /*********************************************************** ********************
> * Copyright (c) 2006 IBM Corporation and others.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
> ************************************************************ *******************/
> package org.eclipse.swt.nebula.snippets.pgroup;
>
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
> import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Scale;
> import org.eclipse.swt.widgets.Shell;
>
> /*
> * Creates a PGroup.
> *
> * For a list of all Nebula PGroup example snippets see
> * http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
> */
> public class PGroupSnippet1 {
>
> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;
>
> GridLayout gridLayout = new GridLayout();
> gridLayout.marginWidth = 15;
> gridLayout.marginHeight = 15;
> shell.setLayout(gridLayout);
>
> PGroup group = new PGroup(shell, SWT.SMOOTH);
> group.setBackgroundMode(SWT.INHERIT_FORCE);
> group.setText("Example");
>
> RectangleGroupStrategy strategy = new RectangleGroupStrategy();
> strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
> group.setStrategy(strategy);
> // group.setToggleRenderer(new TwisteToggleRenderer());
>
> group.setLayout(new GridLayout());
> group.setBackground(display.getSystemColor(SWT.COLOR_RED));
>
> Label label = new Label(group,SWT.NONE);
> label.setText("Contents");
> Button button = new Button(group,SWT.PUSH);
> button.setText("Contents");
> Scale scale = new Scale(group, SWT.HORIZONTAL);
>
> shell.pack();
> shell.open ();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
>
> ------------------------------------------------------------ ------------
>
Re: PGroup (RectangleGroupStrategy) background color issue [message #573166 is a reply to message #19670] Thu, 21 December 2006 05:09 Go to previous message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
Thanks, I'll take a look...

Chris Gross kirjutas mulle midagi seesugust:
> Roland,
>
> I've updated PGroup again. Please try the new drop and see if that
> works for you. I had to modify the background drawing logic.
>
> Regards,
> -Chris
>
> Roland Tepp wrote:
>> Hi Chris,
>>
>> Attached to this message are the modified PGroup snippet code along
>> with the screenshot this code produces, illustrating my problem.
>>
>> As You can see from the screenshot, the background of PGroup is
>> bleeding through the border here at the corners of the PGroup, where
>> they should be white, they are red instead.
>>
>> It gets actually worse if I have an image set with the SWT.TOP style
>> bit in image positioning flag, where the entire top area of the PGroup
>> gets painted red...
>>
>>
>> Chris Gross kirjutas mulle midagi seesugust:
>>> Hi Roland,
>>>
>>> I think I know what you mean but I'm not exactly sure. Can you
>>> attach a picture?
>>>
>>> -Chris
>>>
>>> SWT.SMOOTH may not be the best name but I have to make do with what I
>>> got (i.e. the exising SWT constants).
>>>
>>> Roland Tepp wrote:
>>>> Hello,
>>>>
>>>> I'm having a trouble with a PGroup background color when using
>>>> RectangleGroupStrategy with SWT.SMOOTH style bit set on a group
>>>> (a bit odd style bit to imply rounded corners imo), if setting
>>>> background color to the PGroup to anything different from parent
>>>> background, the new background bleeds through the border,
>>>> effectively defeating the whole idea of having the border arount the
>>>> group content...
>>>>
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> /*********************************************************** ********************
>>
>> * Copyright (c) 2006 IBM Corporation and others.
>> * All rights reserved. This program and the accompanying materials
>> * are made available under the terms of the Eclipse Public License v1.0
>> * which accompanies this distribution, and is available at
>> * http://www.eclipse.org/legal/epl-v10.html
>> *
>> * Contributors:
>> * IBM Corporation - initial API and implementation
>> ************************************************************ *******************/
>>
>> package org.eclipse.swt.nebula.snippets.pgroup;
>>
>>
>> import org.eclipse.swt.SWT;
>> import org.eclipse.swt.layout.GridLayout;
>> import org.eclipse.swt.nebula.widgets.pgroup.PGroup;
>> import org.eclipse.swt.nebula.widgets.pgroup.RectangleGroupStrategy ;
>> import org.eclipse.swt.widgets.Button;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.widgets.Label;
>> import org.eclipse.swt.widgets.Scale;
>> import org.eclipse.swt.widgets.Shell;
>>
>> /*
>> * Creates a PGroup.
>> *
>> * For a list of all Nebula PGroup example snippets see
>> * http://www.eclipse.org/nebula/widgets/pgroup/snippets.php
>> */
>> public class PGroupSnippet1 {
>>
>> public static void main (String [] args) {
>> Display display = new Display ();
>> Shell shell = new Shell (display);
>> shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE)) ;
>> GridLayout gridLayout = new GridLayout();
>> gridLayout.marginWidth = 15;
>> gridLayout.marginHeight = 15;
>> shell.setLayout(gridLayout);
>>
>> PGroup group = new PGroup(shell, SWT.SMOOTH);
>> group.setBackgroundMode(SWT.INHERIT_FORCE);
>> group.setText("Example");
>> RectangleGroupStrategy strategy = new RectangleGroupStrategy();
>> strategy.setBorderColor(display.getSystemColor(SWT.COLOR_BLA CK));
>> group.setStrategy(strategy);
>> // group.setToggleRenderer(new TwisteToggleRenderer());
>> group.setLayout(new GridLayout());
>> group.setBackground(display.getSystemColor(SWT.COLOR_RED));
>> Label label = new Label(group,SWT.NONE);
>> label.setText("Contents");
>> Button button = new Button(group,SWT.PUSH);
>> button.setText("Contents");
>> Scale scale = new Scale(group, SWT.HORIZONTAL);
>> shell.pack();
>> shell.open ();
>> while (!shell.isDisposed()) {
>> if (!display.readAndDispatch ()) display.sleep ();
>> }
>> display.dispose ();
>> }
>> }
>>
>> ------------------------------------------------------------ ------------
>>

--
Roland Tepp
Re: PGroup (RectangleGroupStrategy) background color issue [message #577384 is a reply to message #19670] Tue, 06 February 2007 06:03 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5003
Registered: July 2009
Senior Member
Hi,

is this only in CVS or do I also get this fix when downloading the jar,
because I see the same effect here with the jar I downloaded.

Tom

Chris Gross schrieb:
> Roland,
>
> I've updated PGroup again. Please try the new drop and see if that
> works for you. I had to modify the background drawing logic.
>
> Regards,
> -Chris
>
Previous Topic:[CompositeTable] 0.9.2.1 released
Next Topic:PGroup not redrawn correctly
Goto Forum:
  


Current Time: Wed Apr 16 06:49:11 EDT 2014

Powered by FUDForum. Page generated in 0.07620 seconds