Re: Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:

Steven Kelly

Hi Mark,

 

On 15 March 2010 18:31 you wrote:

> In migrating to VW7.7, I noticed that I lost the color of text items

> in a List and DataSet.  Everything was simply black [because of

> ExtraEmphases::ColoredFont>>color:while:]

 

Do you still see that problem? I haven't see it in 7.7 - for me, colored text shows up fine in datasets and lists. Here are a couple of examples, first with some red in a dataset then some gray in a list:

 

 

I have ExtraEmphases 53.1 loaded, but nothing’s changed in the methods you mention for nearly four years. Maybe there’s a difference because of platform or chosen Look & Feel – which are you using?

 

Cheers,

Steve

 

> -----Original Message-----

> From: [hidden email] [mailto:[hidden email]] On

> Behalf Of Steven Kelly

> Sent: 16. maaliskuuta 2010 16:12

> To: MarkPetersen; [hidden email]

> Subject: Re: [vwnc] Problem with

> vw7.7ExtraEmphasis.ColoredText>>color:while:

>

> Those aren't really 7.4 and 7.7 versions of the code: they are versions

> with and without a hacky correction for coloring text in a selection.

> On

> Windows XP, red text should become white when selected. Before the

> change, VW and ExtraEmphases left the text red, which was wrong for

> Windows, and often hard to read against the blue selection background.

>

> The right choice would probably be to change all of VWs widgets so they

> force text in selections to be white, but that was obviously outside

> ExtraEmphases' scope.

>

> Looking forward, Microsoft seem to be moving towards selection being

> accomplished with a translucent lighter blue covering and affecting the

> whole row, text color included. Since we're still waiting for Vista and

> Windows 7 look&feels from Cincom, it's a little unclear how best to

> proceed. With Skinny, I've no idea how text coloring would work. With

> Cairo, I imagine the new translucent selection would be easy, but the

> old forcing to white would still require either a hack or then changes

> to every widget.

>

> As it stands, I don't think the basic idea of this hack is too bad. VW

> already sets the text color to white for a selection; this just stops

> ExtraEmphases changing it. I guess the quick solution is to find out

> why

> the code now gives false positives in 7.7, and correct that. That test

> should then be moved into its own message, to make things more readable.

>

> Steve

>

> > -----Original Message-----

> > From: [hidden email] [mailto:[hidden email]] On

> > Behalf Of MarkPetersen

> > Sent: 15 March 2010 18:31

> > To: [hidden email]

> > Subject: [vwnc] Problem with vw7.7

> > ExtraEmphasis.ColoredText>>color:while:

> >

> >

> > In migrating to VW7.7, I noticed that I lost the color of text items

> in

> > a

> > List and DataSet.  Everything was simply black, even though an

> Inspect

> > on

> > the item showed that the text was emphasized with a color value.

> > I tracked the issue down to the ExtraEmphasis.ColoredText color:while:

> > method.  In the vw7.4 method, it was coded as:

> >

> > color: aGC while: aBlock

> >   | originalPaint |

> >   originalPaint := aGC paint.

> >   aGC paint: self color.

> >   aBlock ensure: [aGC paint: originalPaint]

> >

> > while in vw7.7 it is coded as:

> > color: aGC while: aBlock

> >   "Change the color to that specified in this font"

> >

> >   | originalPaint defColors |

> >   "If we are on Windows and displaying a selection, don't change

> > color

> >   (i.e. use the already set selectionForeground color, probably

> > white)"

> >

> >   "Windows-like, i.e. normal selected text is not the same color

> as

> > normal

> > text"

> >   defColors := aGC medium defaultWidgetPolicy class

> > defaultColorWidgetColors.

> >   ((defColors matchAt: SymbolicPaint selectionForeground ifAbsent:

> > [ColorValue black]) ~=

> >   (defColors matchAt: SymbolicPaint foreground ifAbsent:

> > [ColorValue black])

> >         and:

> >   ["Telling if we are in a selection is tricky, so we need to try

> a

> > couple of

> > ways"

> >   "Scrolling and normal display in a TextView"

> >   aGC paint == SymbolicPaint selectionForeground or:

> >         ["DataSet visuals for InputFieldView - see

> > DataSetView>>displayVisualsOn:"

> >         (aGC paintPreferencesMatchAt: SymbolicPaint

> > selectionForeground) ==

> >         (aGC paintPreferencesMatchAt: SymbolicPaint

> foreground)]])

> >

> >         ifTrue:     [aBlock value]

> >         ifFalse:    [originalPaint := aGC paint.

> >                     aGC paint: self color.

> >                     aBlock ensure: [aGC paint:

> originalPaint]]

> >

> >

> > If I naively replace the 7.7 method with the 7.4 method, I get my

> > colors

> > back.  So all the extra logic is causing the ifTrue block to be used

> > when it

> > should be the ifFalse path.  I made the big mistake of trying to put

> a

> > break

> > in this method to try to debug further.  Eventually I had to reboot

> > after

> > locking up my system.  I also tried to unload the ExtraEmphasis

> parcel,

> > which also did not work and produced exceptions in every window.

> >

> > This method change seems to be expecting color foreground settings

> from

> > the

> > widget settings, but I'm setting the color of fonts programatically

> > based on

> > the type of object displayed.  So foreground colors can be different

> > for

> > every row in the list or dataset.  But without being able to put a

> > break

> > into this method without causing a runaway image makes debugging very

> > difficult.

> >

> > Probably need Cincom to work on this one, but thought I'd post as a

> > warning.

> >

> > Mark Petersen

> > --

> > View this message in context: http://n4.nabble.com/Problem-with-vw7-

> 7-

> > ExtraEmphasis-ColoredText-color-while-tp1593638p1593638.html

> > Sent from the VisualWorks mailing list archive at Nabble.com.

> > _______________________________________________

> > vwnc mailing list

> > [hidden email]

> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

>

> _______________________________________________

> vwnc mailing list

> [hidden email]

> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:

MarkPetersen
Hi Steve,
I didn't spend more time trying to figure out why the new method
ColoredFont>>color:while: in vw7.7 didn't work right.  I simply wound up
returning the method to its original vw7.4 timeframe content.  Here's what
I see in my datasets, left is with longer method in 7.7, right is with
short method in 7.4.

(Embedded image moved to file: pic53538.gif)

Thanks,


                                                                           
 Mark K. Petersen        (Embedded image moved to    Home Office: (319)    
 Semiconductor Research  file: pic64798.jpg)         406-4165 Cell: (845)  
 and Development Center                              235-4360              
 IBM Global Engineering                              Internet email:      
 Solutions                                           [hidden email]  
                                                     DMACS Wiki            
                                                     DMACS Forum          
                                                                           








                                                                                                                                   
  From:       "Steven Kelly" <[hidden email]>                                                                                
                                                                                                                                   
  To:         Mark Petersen/Fishkill/IBM@IBMUS                                                                                    
                                                                                                                                   
  Cc:         <[hidden email]>                                                                                                  
                                                                                                                                   
  Date:       06/08/2010 06:56 AM                                                                                                  
                                                                                                                                   
  Subject:    RE: [vwnc] Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:                                                
                                                                                                                                   





Hi Mark,

On 15 March 2010 18:31 you wrote:
> In migrating to VW7.7, I noticed that I lost the color of text items
> in a List and DataSet.  Everything was simply black [because of
> ExtraEmphases::ColoredFont>>color:while:]

Do you still see that problem? I haven't see it in 7.7 - for me, colored
text shows up fine in datasets and lists. Here are a couple of examples,
first with some red in a dataset then some gray in a list:




I have ExtraEmphases 53.1 loaded, but nothing’s changed in the methods you
mention for nearly four years. Maybe there’s a difference because of
platform or chosen Look & Feel – which are you using?

Cheers,
Steve

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Steven Kelly
> Sent: 16. maaliskuuta 2010 16:12
> To: MarkPetersen; [hidden email]
> Subject: Re: [vwnc] Problem with
> vw7.7ExtraEmphasis.ColoredText>>color:while:
>
> Those aren't really 7.4 and 7.7 versions of the code: they are versions
> with and without a hacky correction for coloring text in a selection.
> On
> Windows XP, red text should become white when selected. Before the
> change, VW and ExtraEmphases left the text red, which was wrong for
> Windows, and often hard to read against the blue selection background.
>
> The right choice would probably be to change all of VWs widgets so they
> force text in selections to be white, but that was obviously outside
> ExtraEmphases' scope.
>
> Looking forward, Microsoft seem to be moving towards selection being
> accomplished with a translucent lighter blue covering and affecting the
> whole row, text color included. Since we're still waiting for Vista and
> Windows 7 look&feels from Cincom, it's a little unclear how best to
> proceed. With Skinny, I've no idea how text coloring would work. With
> Cairo, I imagine the new translucent selection would be easy, but the
> old forcing to white would still require either a hack or then changes
> to every widget.
>
> As it stands, I don't think the basic idea of this hack is too bad. VW
> already sets the text color to white for a selection; this just stops
> ExtraEmphases changing it. I guess the quick solution is to find out
> why
> the code now gives false positives in 7.7, and correct that. That test
> should then be moved into its own message, to make things more readable.
>
> Steve
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On
> > Behalf Of MarkPetersen
> > Sent: 15 March 2010 18:31
> > To: [hidden email]
> > Subject: [vwnc] Problem with vw7.7
> > ExtraEmphasis.ColoredText>>color:while:
> >
> >
> > In migrating to VW7.7, I noticed that I lost the color of text items
> in
> > a
> > List and DataSet.  Everything was simply black, even though an
> Inspect
> > on
> > the item showed that the text was emphasized with a color value.
> > I tracked the issue down to the ExtraEmphasis.ColoredText color:while:
> > method.  In the vw7.4 method, it was coded as:
> >
> > color: aGC while: aBlock
> >   | originalPaint |
> >   originalPaint := aGC paint.
> >   aGC paint: self color.
> >   aBlock ensure: [aGC paint: originalPaint]
> >
> > while in vw7.7 it is coded as:
> > color: aGC while: aBlock
> >   "Change the color to that specified in this font"
> >
> >   | originalPaint defColors |
> >   "If we are on Windows and displaying a selection, don't change
> > color
> >   (i.e. use the already set selectionForeground color, probably
> > white)"
> >
> >   "Windows-like, i.e. normal selected text is not the same color
> as
> > normal
> > text"
> >   defColors := aGC medium defaultWidgetPolicy class
> > defaultColorWidgetColors.
> >   ((defColors matchAt: SymbolicPaint selectionForeground ifAbsent:
> > [ColorValue black]) ~=
> >   (defColors matchAt: SymbolicPaint foreground ifAbsent:
> > [ColorValue black])
> >         and:
> >   ["Telling if we are in a selection is tricky, so we need to try
> a
> > couple of
> > ways"
> >   "Scrolling and normal display in a TextView"
> >   aGC paint == SymbolicPaint selectionForeground or:
> >         ["DataSet visuals for InputFieldView - see
> > DataSetView>>displayVisualsOn:"
> >         (aGC paintPreferencesMatchAt: SymbolicPaint
> > selectionForeground) ==
> >         (aGC paintPreferencesMatchAt: SymbolicPaint
> foreground)]])
> >
> >         ifTrue:     [aBlock value]
> >         ifFalse:    [originalPaint := aGC paint.
> >                     aGC paint: self color.
> >                     aBlock ensure: [aGC paint:
> originalPaint]]
> >
> >
> > If I naively replace the 7.7 method with the 7.4 method, I get my
> > colors
> > back.  So all the extra logic is causing the ifTrue block to be used
> > when it
> > should be the ifFalse path.  I made the big mistake of trying to put
> a
> > break
> > in this method to try to debug further.  Eventually I had to reboot
> > after
> > locking up my system.  I also tried to unload the ExtraEmphasis
> parcel,
> > which also did not work and produced exceptions in every window.
> >
> > This method change seems to be expecting color foreground settings
> from
> > the
> > widget settings, but I'm setting the color of fonts programatically
> > based on
> > the type of object displayed.  So foreground colors can be different
> > for
> > every row in the list or dataset.  But without being able to put a
> > break
> > into this method without causing a runaway image makes debugging very
> > difficult.
> >
> > Probably need Cincom to work on this one, but thought I'd post as a
> > warning.
> >
> > Mark Petersen
> > --
> > View this message in context: http://n4.nabble.com/Problem-with-vw7-
> 7-
> > ExtraEmphasis-ColoredText-color-while-tp1593638p1593638.html
> > Sent from the VisualWorks mailing list archive at Nabble.com.
> > _______________________________________________
> > vwnc mailing list
> > [hidden email]
> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

pic53538.gif (90K) Download Attachment
pic64798.jpg (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:

Steven Kelly
In reply to this post by Steven Kelly

OK, thanks, I see the problem. The idea of the tests in color:while: is to make VW behave like Windows: for the selected row, all text is displayed in the selectionForegroundColor, regardless of its own color. In general, this means that the selected row's text is white on a blue background. (You can see this in Windows in the Explorer, if you have a compressed disk - the file names there are shown in light blue, but when selected the background is dark blue and file name is white).

 

In your case, you've overridden the Windows colors in your windowSpec, to have a grey background for the dataset, a yellow background for the selected row, and black foreground and selection foreground.

 

If you leave the Foreground color undefined (none), or at least a slightly different color from the selection foreground, you’ll get your colors back for unselected rows. The selected row will follow the windows standard and use your specified selection foreground color, overriding any color of the texts themselves.

 

 

If that’s not what you want (and I imagine it’s not), then simply override color:while: to be like the old version, and even the selected row will have its colored texts. That way you get all the other bug corrections etc. in ExtraEmphases since 7.4, just without the Windows selection color forcing.

 

There seems to be no real hope of getting color:while: to work perfectly for all possible combinations: it’s having to perform its magic too late in the day, when all it is given is the gc and desired color. There’s no way to know from there what the windowSpec looked like or what widget is being displayed.

 

Steve

 

> -----Original Message-----

> From: Mark Petersen [mailto:[hidden email]]

> Sent: 8. kesäkuuta 2010 16:33

> To: Steven Kelly

> Cc: [hidden email]

> Subject: RE: [vwnc] Problem with

> vw7.7ExtraEmphasis.ColoredText>>color:while:

>

> Hi Steve,

> I didn't spend more time trying to figure out why the new method

> ColoredFont>>color:while: in vw7.7 didn't work right.  I simply wound

> up

> returning the method to its original vw7.4 timeframe content.  Here's

> what

> I see in my datasets, left is with longer method in 7.7, right is with

> short method in 7.4.

>

> (Embedded image moved to file: pic53538.gif)

>

> Thanks,

>

>

>

>  Mark K. Petersen        (Embedded image moved to    Home Office: (319)

>  Semiconductor Research  file: pic64798.jpg)         406-4165 Cell:

> (845)

>  and Development Center                              235-4360

>  IBM Global Engineering                              Internet email:

>  Solutions

> [hidden email]

>                                                      DMACS Wiki

>                                                      DMACS Forum

>

>

>

>

>

>

>

>

>

>

>   From:       "Steven Kelly" <[hidden email]>

>

>   To:         Mark Petersen/Fishkill/IBM@IBMUS

>

>   Cc:         <[hidden email]>

>

>   Date:       06/08/2010 06:56 AM

>

>   Subject:    RE: [vwnc] Problem with

> vw7.7ExtraEmphasis.ColoredText>>color:while:

>

>

>

>

>

>

> Hi Mark,

>

> On 15 March 2010 18:31 you wrote:

> > In migrating to VW7.7, I noticed that I lost the color of text items

> > in a List and DataSet.  Everything was simply black [because of

> > ExtraEmphases::ColoredFont>>color:while:]

>

> Do you still see that problem? I haven't see it in 7.7 - for me,

> colored

> text shows up fine in datasets and lists. Here are a couple of examples,

> first with some red in a dataset then some gray in a list:

>

>

>

>

> I have ExtraEmphases 53.1 loaded, but nothing’s changed in the methods

> you

> mention for nearly four years. Maybe there’s a difference because of

> platform or chosen Look & Feel – which are you using?

>

> Cheers,

> Steve

>

> > -----Original Message-----

> > From: [hidden email] [mailto:[hidden email]] On

> > Behalf Of Steven Kelly

> > Sent: 16. maaliskuuta 2010 16:12

> > To: MarkPetersen; [hidden email]

> > Subject: Re: [vwnc] Problem with

> > vw7.7ExtraEmphasis.ColoredText>>color:while:

> >

> > Those aren't really 7.4 and 7.7 versions of the code: they are

> versions

> > with and without a hacky correction for coloring text in a selection.

> > On

> > Windows XP, red text should become white when selected. Before the

> > change, VW and ExtraEmphases left the text red, which was wrong for

> > Windows, and often hard to read against the blue selection background.

> >

> > The right choice would probably be to change all of VWs widgets so

> they

> > force text in selections to be white, but that was obviously outside

> > ExtraEmphases' scope.

> >

> > Looking forward, Microsoft seem to be moving towards selection being

> > accomplished with a translucent lighter blue covering and affecting

> the

> > whole row, text color included. Since we're still waiting for Vista

> and

> > Windows 7 look&feels from Cincom, it's a little unclear how best to

> > proceed. With Skinny, I've no idea how text coloring would work. With

> > Cairo, I imagine the new translucent selection would be easy, but the

> > old forcing to white would still require either a hack or then

> changes

> > to every widget.

> >

> > As it stands, I don't think the basic idea of this hack is too bad.

> VW

> > already sets the text color to white for a selection; this just stops

> > ExtraEmphases changing it. I guess the quick solution is to find out

> > why

> > the code now gives false positives in 7.7, and correct that. That

> test

> > should then be moved into its own message, to make things more

> readable.

> >

> > Steve

> >

> > > -----Original Message-----

> > > From: [hidden email] [mailto:[hidden email]] On

> > > Behalf Of MarkPetersen

> > > Sent: 15 March 2010 18:31

> > > To: [hidden email]

> > > Subject: [vwnc] Problem with vw7.7

> > > ExtraEmphasis.ColoredText>>color:while:

> > >

> > >

> > > In migrating to VW7.7, I noticed that I lost the color of text

> items

> > in

> > > a

> > > List and DataSet.  Everything was simply black, even though an

> > Inspect

> > > on

> > > the item showed that the text was emphasized with a color value.

> > > I tracked the issue down to the ExtraEmphasis.ColoredText

> color:while:

> > > method.  In the vw7.4 method, it was coded as:

> > >

> > > color: aGC while: aBlock

> > >   | originalPaint |

> > >   originalPaint := aGC paint.

> > >   aGC paint: self color.

> > >   aBlock ensure: [aGC paint: originalPaint]

> > >

> > > while in vw7.7 it is coded as:

> > > color: aGC while: aBlock

> > >   "Change the color to that specified in this font"

> > >

> > >   | originalPaint defColors |

> > >   "If we are on Windows and displaying a selection, don't change

> > > color

> > >   (i.e. use the already set selectionForeground color, probably

> > > white)"

> > >

> > >   "Windows-like, i.e. normal selected text is not the same color

> > as

> > > normal

> > > text"

> > >   defColors := aGC medium defaultWidgetPolicy class

> > > defaultColorWidgetColors.

> > >   ((defColors matchAt: SymbolicPaint selectionForeground ifAbsent:

> > > [ColorValue black]) ~=

> > >   (defColors matchAt: SymbolicPaint foreground ifAbsent:

> > > [ColorValue black])

> > >         and:

> > >   ["Telling if we are in a selection is tricky, so we need to try

> > a

> > > couple of

> > > ways"

> > >   "Scrolling and normal display in a TextView"

> > >   aGC paint == SymbolicPaint selectionForeground or:

> > >         ["DataSet visuals for InputFieldView - see

> > > DataSetView>>displayVisualsOn:"

> > >         (aGC paintPreferencesMatchAt: SymbolicPaint

> > > selectionForeground) ==

> > >         (aGC paintPreferencesMatchAt: SymbolicPaint

> > foreground)]])

> > >

> > >         ifTrue:     [aBlock value]

> > >         ifFalse:    [originalPaint := aGC paint.

> > >                     aGC paint: self color.

> > >                     aBlock ensure: [aGC paint:

> > originalPaint]]

> > >

> > >

> > > If I naively replace the 7.7 method with the 7.4 method, I get my

> > > colors

> > > back.  So all the extra logic is causing the ifTrue block to be

> used

> > > when it

> > > should be the ifFalse path.  I made the big mistake of trying to

> put

> > a

> > > break

> > > in this method to try to debug further.  Eventually I had to reboot

> > > after

> > > locking up my system.  I also tried to unload the ExtraEmphasis

> > parcel,

> > > which also did not work and produced exceptions in every window.

> > >

> > > This method change seems to be expecting color foreground settings

> > from

> > > the

> > > widget settings, but I'm setting the color of fonts programatically

> > > based on

> > > the type of object displayed.  So foreground colors can be

> different

> > > for

> > > every row in the list or dataset.  But without being able to put a

> > > break

> > > into this method without causing a runaway image makes debugging

> very

> > > difficult.

> > >

> > > Probably need Cincom to work on this one, but thought I'd post as a

> > > warning.

> > >

> > > Mark Petersen

> > > --

> > > View this message in context: http://n4.nabble.com/Problem-with-

> vw7-

> > 7-

> > > ExtraEmphasis-ColoredText-color-while-tp1593638p1593638.html

> > > Sent from the VisualWorks mailing list archive at Nabble.com.

> > > _______________________________________________

> > > vwnc mailing list

> > > [hidden email]

> > > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

> >

> > _______________________________________________

> > vwnc mailing list

> > [hidden email]

> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:

MarkPetersen
Steve, thanks for the explanation.  I'm ok with using the original method.

Thanks,


                                                                           
 Mark K. Petersen        (Embedded image moved to    Home Office: (319)    
 Semiconductor Research  file: pic26746.jpg)         406-4165 Cell: (845)  
 and Development Center                              235-4360              
 IBM Global Engineering                              Internet email:      
 Solutions                                           [hidden email]  
                                                     DMACS Wiki            
                                                     DMACS Forum          
                                                                           








                                                                                                                                   
  From:       "Steven Kelly" <[hidden email]>                                                                                
                                                                                                                                   
  To:         Mark Petersen/Fishkill/IBM@IBMUS                                                                                    
                                                                                                                                   
  Cc:         <[hidden email]>                                                                                                  
                                                                                                                                   
  Date:       06/09/2010 09:15 AM                                                                                                  
                                                                                                                                   
  Subject:    RE: [vwnc] Problem with vw7.7ExtraEmphasis.ColoredText>>color:while:                                                
                                                                                                                                   





OK, thanks, I see the problem. The idea of the tests in color:while: is to
make VW behave like Windows: for the selected row, all text is displayed in
the selectionForegroundColor, regardless of its own color. In general, this
means that the selected row's text is white on a blue background. (You can
see this in Windows in the Explorer, if you have a compressed disk - the
file names there are shown in light blue, but when selected the background
is dark blue and file name is white).

In your case, you've overridden the Windows colors in your windowSpec, to
have a grey background for the dataset, a yellow background for the
selected row, and black foreground and selection foreground.

If you leave the Foreground color undefined (none), or at least a slightly
different color from the selection foreground, you’ll get your colors back
for unselected rows. The selected row will follow the windows standard and
use your specified selection foreground color, overriding any color of the
texts themselves.



If that’s not what you want (and I imagine it’s not), then simply override
color:while: to be like the old version, and even the selected row will
have its colored texts. That way you get all the other bug corrections etc.
in ExtraEmphases since 7.4, just without the Windows selection color
forcing.

There seems to be no real hope of getting color:while: to work perfectly
for all possible combinations: it’s having to perform its magic too late in
the day, when all it is given is the gc and desired color. There’s no way
to know from there what the windowSpec looked like or what widget is being
displayed.

Steve

> -----Original Message-----
> From: Mark Petersen [mailto:[hidden email]]
> Sent: 8. kesäkuuta 2010 16:33
> To: Steven Kelly
> Cc: [hidden email]
> Subject: RE: [vwnc] Problem with
> vw7.7ExtraEmphasis.ColoredText>>color:while:
>
> Hi Steve,
> I didn't spend more time trying to figure out why the new method
> ColoredFont>>color:while: in vw7.7 didn't work right.  I simply wound
> up
> returning the method to its original vw7.4 timeframe content.  Here's
> what
> I see in my datasets, left is with longer method in 7.7, right is with
> short method in 7.4.
>
> (Embedded image moved to file: pic53538.gif)
>
> Thanks,
>
>
>
>  Mark K. Petersen        (Embedded image moved to    Home Office: (319)
>  Semiconductor Research  file: pic64798.jpg)         406-4165 Cell:
> (845)
>  and Development Center                              235-4360
>  IBM Global Engineering                              Internet email:
>  Solutions
> [hidden email]
>                                                      DMACS Wiki
>                                                      DMACS Forum
>
>
>
>
>
>
>
>
>
>
>   From:       "Steven Kelly" <[hidden email]>
>
>   To:         Mark Petersen/Fishkill/IBM@IBMUS
>
>   Cc:         <[hidden email]>
>
>   Date:       06/08/2010 06:56 AM
>
>   Subject:    RE: [vwnc] Problem with
> vw7.7ExtraEmphasis.ColoredText>>color:while:
>
>
>
>
>
>
> Hi Mark,
>
> On 15 March 2010 18:31 you wrote:
> > In migrating to VW7.7, I noticed that I lost the color of text items
> > in a List and DataSet.  Everything was simply black [because of
> > ExtraEmphases::ColoredFont>>color:while:]
>
> Do you still see that problem? I haven't see it in 7.7 - for me,
> colored
> text shows up fine in datasets and lists. Here are a couple of examples,
> first with some red in a dataset then some gray in a list:
>
>
>
>
> I have ExtraEmphases 53.1 loaded, but nothing’s changed in the methods
> you
> mention for nearly four years. Maybe there’s a difference because of
> platform or chosen Look & Feel – which are you using?
>
> Cheers,
> Steve
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On
> > Behalf Of Steven Kelly
> > Sent: 16. maaliskuuta 2010 16:12
> > To: MarkPetersen; [hidden email]
> > Subject: Re: [vwnc] Problem with
> > vw7.7ExtraEmphasis.ColoredText>>color:while:
> >
> > Those aren't really 7.4 and 7.7 versions of the code: they are
> versions
> > with and without a hacky correction for coloring text in a selection.
> > On
> > Windows XP, red text should become white when selected. Before the
> > change, VW and ExtraEmphases left the text red, which was wrong for
> > Windows, and often hard to read against the blue selection background.
> >
> > The right choice would probably be to change all of VWs widgets so
> they
> > force text in selections to be white, but that was obviously outside
> > ExtraEmphases' scope.
> >
> > Looking forward, Microsoft seem to be moving towards selection being
> > accomplished with a translucent lighter blue covering and affecting
> the
> > whole row, text color included. Since we're still waiting for Vista
> and
> > Windows 7 look&feels from Cincom, it's a little unclear how best to
> > proceed. With Skinny, I've no idea how text coloring would work. With
> > Cairo, I imagine the new translucent selection would be easy, but the
> > old forcing to white would still require either a hack or then
> changes
> > to every widget.
> >
> > As it stands, I don't think the basic idea of this hack is too bad.
> VW
> > already sets the text color to white for a selection; this just stops
> > ExtraEmphases changing it. I guess the quick solution is to find out
> > why
> > the code now gives false positives in 7.7, and correct that. That
> test
> > should then be moved into its own message, to make things more
> readable.
> >
> > Steve
> >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On
> > > Behalf Of MarkPetersen
> > > Sent: 15 March 2010 18:31
> > > To: [hidden email]
> > > Subject: [vwnc] Problem with vw7.7
> > > ExtraEmphasis.ColoredText>>color:while:
> > >
> > >
> > > In migrating to VW7.7, I noticed that I lost the color of text
> items
> > in
> > > a
> > > List and DataSet.  Everything was simply black, even though an
> > Inspect
> > > on
> > > the item showed that the text was emphasized with a color value.
> > > I tracked the issue down to the ExtraEmphasis.ColoredText
> color:while:
> > > method.  In the vw7.4 method, it was coded as:
> > >
> > > color: aGC while: aBlock
> > >   | originalPaint |
> > >   originalPaint := aGC paint.
> > >   aGC paint: self color.
> > >   aBlock ensure: [aGC paint: originalPaint]
> > >
> > > while in vw7.7 it is coded as:
> > > color: aGC while: aBlock
> > >   "Change the color to that specified in this font"
> > >
> > >   | originalPaint defColors |
> > >   "If we are on Windows and displaying a selection, don't change
> > > color
> > >   (i.e. use the already set selectionForeground color, probably
> > > white)"
> > >
> > >   "Windows-like, i.e. normal selected text is not the same color
> > as
> > > normal
> > > text"
> > >   defColors := aGC medium defaultWidgetPolicy class
> > > defaultColorWidgetColors.
> > >   ((defColors matchAt: SymbolicPaint selectionForeground ifAbsent:
> > > [ColorValue black]) ~=
> > >   (defColors matchAt: SymbolicPaint foreground ifAbsent:
> > > [ColorValue black])
> > >         and:
> > >   ["Telling if we are in a selection is tricky, so we need to try
> > a
> > > couple of
> > > ways"
> > >   "Scrolling and normal display in a TextView"
> > >   aGC paint == SymbolicPaint selectionForeground or:
> > >         ["DataSet visuals for InputFieldView - see
> > > DataSetView>>displayVisualsOn:"
> > >         (aGC paintPreferencesMatchAt: SymbolicPaint
> > > selectionForeground) ==
> > >         (aGC paintPreferencesMatchAt: SymbolicPaint
> > foreground)]])
> > >
> > >         ifTrue:     [aBlock value]
> > >         ifFalse:    [originalPaint := aGC paint.
> > >                     aGC paint: self color.
> > >                     aBlock ensure: [aGC paint:
> > originalPaint]]
> > >
> > >
> > > If I naively replace the 7.7 method with the 7.4 method, I get my
> > > colors
> > > back.  So all the extra logic is causing the ifTrue block to be
> used
> > > when it
> > > should be the ifFalse path.  I made the big mistake of trying to
> put
> > a
> > > break
> > > in this method to try to debug further.  Eventually I had to reboot
> > > after
> > > locking up my system.  I also tried to unload the ExtraEmphasis
> > parcel,
> > > which also did not work and produced exceptions in every window.
> > >
> > > This method change seems to be expecting color foreground settings
> > from
> > > the
> > > widget settings, but I'm setting the color of fonts programatically
> > > based on
> > > the type of object displayed.  So foreground colors can be
> different
> > > for
> > > every row in the list or dataset.  But without being able to put a
> > > break
> > > into this method without causing a runaway image makes debugging
> very
> > > difficult.
> > >
> > > Probably need Cincom to work on this one, but thought I'd post as a
> > > warning.
> > >
> > > Mark Petersen
> > > --
> > > View this message in context: http://n4.nabble.com/Problem-with-
> vw7-
> > 7-
> > > ExtraEmphasis-ColoredText-color-while-tp1593638p1593638.html
> > > Sent from the VisualWorks mailing list archive at Nabble.com.
> > > _______________________________________________
> > > vwnc mailing list
> > > [hidden email]
> > > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> >
> > _______________________________________________
> > vwnc mailing list
> > [hidden email]
> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

pic26746.jpg (9K) Download Attachment