[Gambas-user] WebTable Background color of row selection

T Lee Davidson t.lee.davidson at gmail.com
Tue Feb 28 22:53:19 CET 2023


On 2/28/23 15:31, Bruce Steers wrote:
> 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.

No, it makes more sense for the cell layer to be drawn after (on top of) the row layer.

There are a number of reasons, that I can see, that make this so difficult.
1. The Click event receives the Row and Column but is raised only when a control *embedded in a cell* raises its Click event.
2. The Select event receives no arguments; so neither Row nor Column. TableView's Selection property yields the Row number, but 
there is no Row property.
3. And, there appears to be no way to access a particular cell by grid coordinates, ie. TableView[x,y].

The only half-baked solution I can come up with is to set the Data.Background in both columns using similar colors, eg.:
[code]
Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As WebTableData)
   Select Case Column
     Case 0
       Data.Background = Color.SetAlpha(Color.Yellow, 192)
       Data.Text = "Data: " & CString(Row) & "_" & CString(Column)
     Case 1
       Data.Background = Color.SetAlpha(Color.SoftYellow, 192)
       Data.Html = "<button Class=\"button is-danger\">" & "Button: " & CString(Row) & "_" & CString(Column) & "</button>"
   End Select

End
[/code]


-- 
Lee



More information about the User mailing list