Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[nebula-dev] [compositeTable] per-column color paintListener


I'll reply to all 3 messages at once: you're doing a great job; exactly what I would do.   Please submit a patch. :-)


Regards,

Dave

----------------------------------------------------------------------

Message: 1
Date: Mon, 26 Feb 2007 20:57:49 +0100
From: Andr? Dietisheim <dietisheim@xxxxxxxxx>
Subject: Re: [nebula-dev][compositeTable] per-column color
        paintListener
To: Nebula Dev <nebula-dev@xxxxxxxxxxx>
Message-ID: <1172519869.14599.9.camel@pmobilead>
Content-Type: text/plain; charset=utf-8

Hi Dave

thanks for the hint! I posted the shots to flickr.com:

http://www.flickr.com/photos/23655688@N00/

I thought of putting this stuff to the snippets or maybe to a utility
class (RowCompositeUtils.attachBackgroundPainter(Control control)?).
That would keep full freedom in choosing row-objects.
I developed that stuff on GTK+ (at home :-)) and I'll check tomorrow on
windows (at work) if everything's fine in redmond land.

to resume up things, here once more (for the list) the reason for this
stuff:

Screenshot1 shows that a text control does not take the whole vertical
space in a column (same applies to checkboxes) if there are combos and
buttons in the same row. If you put the background-color to the
text-control only, it looks very ugly. It is no solution to stretch the
text-control to fit to the vertical size of the row. Text control
vertical align text to the top.

Screenshot2 shows the results after appending my little paintListener. I
fill the 'column'-area in the row with the same color as the control.
Things look now right!


Control rowControl = control.getParent();
            rowControl.addPaintListener(new PaintListener() {

                public void paintControl(PaintEvent e) {
                    Color initialBackground = e.gc.getBackground();
                    e.gc.setBackground(control.getBackground());
                    Control rowControl = ((Control) e.widget);
                    Rectangle cellBounds = control.getBounds();
                    Rectangle bounds = new Rectangle(
                       cellBounds.x,
                       0,
                       cellBounds.width,
                       rowControl.getBounds().height);
                    e.gc.fillRectangle(bounds);
                    e.gc.setBackground(initialBackground);
                }
            });

Thanks for your feedback!!
Andr��




------------------------------

Message: 2
Date: Tue, 27 Feb 2007 09:54:28 +0100 (CET)
From: " Andr? Dietisheim " <dietisheim@xxxxxxxxx>
Subject: Re: [nebula-dev][compositeTable] per-column color
        paintListener
To: <nebula-dev@xxxxxxxxxxx>
Message-ID:
        <12621.194.150.244.67.1172566468.squirrel@xxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset=iso-8859-1

Hi Dave

You're completely right with your guess that things break on windows.
Controls do not have the right color initialized - in other words:
controls look white but you get gray when you call getBackground(). In
cosequence my paintListener only works if you set background explicitly.
Is in a bug in the win32 SWT implementation (the java layer does not
reflect the real widget state) or is it a feature of the platform ;-) ?
I think it has to stay in the snippets rather than being called in
CompositeTable after replicating a row (which would have been neat).

Regards
Andr�

> Hi Dave
>
> thanks for the hint! I posted the shots to flickr.com:
>
> http://www.flickr.com/photos/23655688@N00/
>
> I thought of putting this stuff to the snippets or maybe to a utility
> class (RowCompositeUtils.attachBackgroundPainter(Control control)?).
> That would keep full freedom in choosing row-objects.
> I developed that stuff on GTK+ (at home :-)) and I'll check tomorrow on
> windows (at work) if everything's fine in redmond land.
>
> to resume up things, here once more (for the list) the reason for this
> stuff:
>
> Screenshot1 shows that a text control does not take the whole vertical
> space in a column (same applies to checkboxes) if there are combos and
> buttons in the same row. If you put the background-color to the
> text-control only, it looks very ugly. It is no solution to stretch the
> text-control to fit to the vertical size of the row. Text control
> vertical align text to the top.
>
> Screenshot2 shows the results after appending my little paintListener. I
> fill the 'column'-area in the row with the same color as the control.
> Things look now right!
>
>
> Control rowControl = control.getParent();
>             rowControl.addPaintListener(new PaintListener() {
>
>                 public void paintControl(PaintEvent e) {
>                     Color initialBackground = e.gc.getBackground();
> e.gc.setBackground(control.getBackground());
>                     Control rowControl = ((Control) e.widget);
>                     Rectangle cellBounds = control.getBounds();
>                     Rectangle bounds = new Rectangle(
>                        cellBounds.x,
>                        0,
>                        cellBounds.width,
>                        rowControl.getBounds().height);
>                     e.gc.fillRectangle(bounds);
>                     e.gc.setBackground(initialBackground);
>                 }
>             });
>
> Thanks for your feedback!!
> Andr��
>
>
> _______________________________________________
> nebula-dev mailing list
> nebula-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/nebula-dev
>
>
> !DSPAM:45e33bed160651044727653!


--
Andr� Dietisheim
Stv-Bereichsleiter Products

Puzzle ITC GmbH
Eigerplatz 4
CH-3007 Bern
Telefon +41 31 370 22 00
Mobile  +41 76 423 03 02
Fax     +41 31 370 22 01

Puzzle ist Mitglied der ODF Alliance:
<http://www.puzzle.ch/odfalliance/>




------------------------------

Message: 3
Date: Tue, 27 Feb 2007 11:00:53 +0100 (CET)
From: " Andr? Dietisheim " <dietisheim@xxxxxxxxx>
Subject: Re: [nebula-dev][compositeTable] per-column color
        paintListener
To: <dietisheim@xxxxxxxxx>, <nebula-dev@xxxxxxxxxxx>
Message-ID:
        <48549.194.150.244.67.1172570453.squirrel@xxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset=iso-8859-1

Hi Dave

update: sorry!!! my fault! the bugs I experienced were completely my
fault. There's no bad background-color returned when it has not been set
before!
Was probably some kind of evil-empire-reflex ;-)))
The only thing that's not quite accurate is the control that does not
expand horizontally to the full row-colum area and the background's not
set to its complete horizontal extent (small gaps on the left and on the
right), but no big deal!
I'll try to patch InternalCompositeTable. I think that it would be nice to
have that background-paining automagically (though handwork is no big deal
either) done. What's your opinion?

Greets
Andr�

> Hi Dave
>
> You're completely right with your guess that things break on windows.
> Controls do not have the right color initialized - in other words:
> controls look white but you get gray when you call getBackground(). In
> cosequence my paintListener only works if you set background explicitly.
> Is in a bug in the win32 SWT implementation (the java layer does not
> reflect the real widget state) or is it a feature of the platform ;-) ?
> I think it has to stay in the snippets rather than being called in
> CompositeTable after replicating a row (which would have been neat).
>
> Regards
> Andr�
>
>> Hi Dave
>>
>> thanks for the hint! I posted the shots to flickr.com:
>>
>> http://www.flickr.com/photos/23655688@N00/
>>
>> I thought of putting this stuff to the snippets or maybe to a utility
>> class (RowCompositeUtils.attachBackgroundPainter(Control control)?).
>> That would keep full freedom in choosing row-objects.
>> I developed that stuff on GTK+ (at home :-)) and I'll check tomorrow
>> on windows (at work) if everything's fine in redmond land.
>>
>> to resume up things, here once more (for the list) the reason for this
>> stuff:
>>
>> Screenshot1 shows that a text control does not take the whole vertical
>> space in a column (same applies to checkboxes) if there are combos and
>> buttons in the same row. If you put the background-color to the
>> text-control only, it looks very ugly. It is no solution to stretch
>> the text-control to fit to the vertical size of the row. Text control
>> vertical align text to the top.
>>
>> Screenshot2 shows the results after appending my little paintListener.
>> I fill the 'column'-area in the row with the same color as the
>> control. Things look now right!
>>
>>
>> Control rowControl = control.getParent();
>>             rowControl.addPaintListener(new PaintListener() {
>>
>>                 public void paintControl(PaintEvent e) {
>>                     Color initialBackground = e.gc.getBackground();
>> e.gc.setBackground(control.getBackground());
>>                     Control rowControl = ((Control) e.widget);
>>                     Rectangle cellBounds = control.getBounds();
>>                     Rectangle bounds = new Rectangle(
>>                        cellBounds.x,
>>                        0,
>>                        cellBounds.width,
>>                        rowControl.getBounds().height);
>>                     e.gc.fillRectangle(bounds);
>>                     e.gc.setBackground(initialBackground);
>>                 }
>>             });
>>
>> Thanks for your feedback!!
>> Andr��
>>
>>
>> _______________________________________________
>> nebula-dev mailing list
>> nebula-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/nebula-dev
>>
>>
>>
>
>
> --
> Andr� Dietisheim
> Stv-Bereichsleiter Products
>
> Puzzle ITC GmbH
> Eigerplatz 4
> CH-3007 Bern
> Telefon +41 31 370 22 00
> Mobile  +41 76 423 03 02
> Fax     +41 31 370 22 01
>
> Puzzle ist Mitglied der ODF Alliance:
> <http://www.puzzle.ch/odfalliance/>
>
>
> _______________________________________________
> nebula-dev mailing list
> nebula-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/nebula-dev
>
>
> !DSPAM:45e3f1d837528510621087!


--
Andr� Dietisheim
Stv-Bereichsleiter Products

Puzzle ITC GmbH
Eigerplatz 4
CH-3007 Bern
Telefon +41 31 370 22 00
Mobile  +41 76 423 03 02
Fax     +41 31 370 22 01

Puzzle ist Mitglied der ODF Alliance:
<http://www.puzzle.ch/odfalliance/>




------------------------------

_______________________________________________
nebula-dev mailing list
nebula-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/nebula-dev


End of nebula-dev Digest, Vol 11, Issue 20
******************************************

Back to the top