[Gambas-user] WebTable Background color of row selection

Bruce Steers bsteers4 at gmail.com
Tue Feb 28 21:31:45 CET 2023


On Tue, 28 Feb 2023 at 20:24, Bruce Steers <bsteers4 at gmail.com> wrote:

>
>
> On Tue, 28 Feb 2023 at 19:17, Mayost Sharon <sharon at 455.co.il> wrote:
>
>> Hello
>>
>> It is not good that I define the yellow background color in both cells
>> I want the table to be:
>> Column 0 has a yellow background color
>> Column 1 has a white background color
>> But only when I select a certain row then it will color the entire row I
>> selected to a blue background color
>>
>> I was able to do what I want but the problem is that it only works when I
>> execute
>> Me.Reload()
>> And it doesn't seem successful because it refreshes the whole page every
>> time
>> Attached is an example of what I did
>>
>> Is there a better way?
>>
>
> I cannot find one.
> Maybe the only way is to drop the WebTable folder from the source into
> your project and edit it at the root.
>
> I can get the correct effect but only using the Activate event so it only
> works when double clicking a row.
>
> Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As
> WebTableData)
>
>  Select Case Column
>     Case 0
>       If Last.Current <> Row Then Data.Background =
> Color.SetAlpha(Color.Yellow, 192)
>       Data.Text = "Data: " & CString(Row) & "_" & CString(Column)
>     Case 1
>       Data.Html = "<button Class=\"button is-danger\">" & "Button: " &
> CString(Row) & "_" & CString(Column) & "</button>"
>   End Select
>
> End
>
> Public Sub WebTable1_Activate()
>
>   WebTable1.Refresh
>
> End
> That way the Activate triggers a refresh and the Data.Background will not
> be set if Row = WebTable1.Current
>
> But i could not get it to work for a single click/select function , just
> Activate
>
> Good luck.
> Ps. is there a reason it cannot be blue?
>
> BruceS
>

This does seem like a bug.
It is like the Data.Background color is drawn "after" making it blue if
selected so it overlays.

If the control drew the Data.Background colors first (or not at all if
selected) then drew blue if selected then it would just be blue.  and that
makes more sense i think.

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230228/6fc8d7e5/attachment.htm>


More information about the User mailing list