How to set color of a single listbox row

David Lieb (5/16/14 1:15PM)
David Lieb (5/16/14 2:19PM)
Keisuke Miyako (5/16/14 7:28PM)
David Lieb (5/19/14 7:07AM)


David Lieb (5/16/14 1:15 PM)

<CAA4Ym0jW8GKcw_PJ4dqB_b39wB8HYyA623CXTMXw8+6yKaJ6RQ@...

Is it possible to set the text color (or other display properties) of a
SINGLE row in a selection-based listbox in 4D v13 when the user clicks
on
that row, without redrawing the whole list?

There's a new command in v14, LISTBOX SET ROW COLOR, but that is v14
and it
only works on array-based listboxes.

Here's what I do now and why it's problematic:

If (Form event = On Selection Change)
¬=A0¬=A0¬=A0REDRAW (myListbox)
End if

I have a method set in the Row Font Color property of the listbox, and
the
REDRAW causes the method to be invoked for every displayed row, which
works
as advertised. However, ¬=A0REDRAW has some undesirable side effects:
If
you
double-click a row, 4D first invokes On Selection Change and then On
Double-Click. I've found that on Windows only (not Mac), the REDRAW
command
prevents On Double-Click from firing (particularly if the user moves
the
cursor after double-clicking).

Thanks,

David

David Lieb (5/16/14 2:19 PM)

<CAA4Ym0jA1qheX4k2byTYGqjfDLPB_pnt6RUPQvkL2GMYsM331g@...

If I remove the REDRAW command from my On Selection Change code, the
Double-Click problem goes away, but I can't change the text color of
the
row the user clicked on, which was the point of calling
REDRAW...unless you
can think of another way.

Thanks,

David

On Fri, May 16, 2014 at 2:05 PM, Miyako wrote:

color><param>00000,0000,DDEE/param>aand what happens if you remove the
REDRAW command?

On 2014/05/17 2:15, "David Lieb" <david_lieb@... wrote:

/color><color><param>8826F,0000,8219/param>II've found that on Windows
only (not Mac), the REDRAW command
prevents On Double-Click from firing (particularly if the user moves
the
cursor after double-clicking).
/color><color><param>00000,0000,DDEE/param>
/color>

Keisuke Miyako (5/16/14 7:28 PM)

and what happens if you remove the REDRAW command?

On 2014/05/17 2:15, "David Lieb" <david_lieb@... wrote:

color><param>00000,0000,DDEE/param>II've found that on Windows only
(not Mac), the REDRAW command
prevents On Double-Click from firing (particularly if the user moves
the
cursor after double-clicking).
/color>

David Lieb (5/19/14 7:07 AM)

<CAA4Ym0jHLVdWzW1SwfWdvY0qzH2EqW1n3c5fROwvqXZa=8DT9w@mail.gmail.com>

Thanks, but as I said below, I already do that, and it causes problems.

David

On Sat, May 17, 2014 at 3:30 AM, Chip Scheide wrote:

color><param>00000,0000,DDEE/param>tthere is a property of the list
box - ROW FONT COLOR
you can place a method in this property that returns an RGB color
value.

I have never done row color based on clicking, but it should be
possible
to set the row color this way

/color><color><param>8826F,0000,8219/param>IIs it possible to set the
text color (or other display properties) of a
SINGLE row in a selection-based listbox in 4D v13 when the user clicks
on
that row, without redrawing the whole list?

There's a new command in v14, LISTBOX SET ROW COLOR, but that is v14
and
/color><color><param>00000,0000,DDEE/param>iit
/color><color><param>8826F,0000,8219/param>oonly works on array-based
listboxes.

Here's what I do now and why it's problematic:

If (Form event = On Selection Change)
¬=A0¬=A0¬=A0REDRAW (myListbox)
End if

I have a method set in the Row Font Color property of the listbox, and
/color><color><param>00000,0000,DDEE/param>tthe
/color><color><param>8826F,0000,8219/param>RREDRAW causes the method
to be invoked for every displayed row, which
/color><color><param>00000,0000,DDEE/param>wworks
/color><color><param>8826F,0000,8219/param>aas advertised. However,
¬=A0REDRAW has some undesirable side effects: If you
double-click a row, 4D first invokes On Selection Change and then On
Double-Click. I've found that on Windows only (not Mac), the REDRAW
/color><color><param>00000,0000,DDEE/param>ccommand
/color><color><param>8826F,0000,8219/param>pprevents On Double-Click
from firing (particularly if the user moves the
cursor after double-clicking).
/color><color><param>00000,0000,DDEE/param>
/color>

Reply to this message

Summary created 5/19/14 at 10:54AM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com