[Gambas-user] Event WebTable.Click
Bruce Steers
bsteers4 at gmail.com
Wed Mar 1 21:58:20 CET 2023
On Wed, 1 Mar 2023 at 16:30, Mayost Sharon <sharon at 455.co.il> wrote:
> Thank you very much
> I didn't see that there is Data.Control
>
> now
> 1. Is it possible to combine multiple controls into one cell?
>
Have you tried making the .Control a panel with items?
> 2. If I understood correctly, only controls that have a click event can be
> integrated into the cell (if I want it to respond to the event)
> But only a button control responds to the event
> I am attaching an example file
>
I think maybe you do not want the Click event but should use 'As
"HandlerName"' on the Buttons
Like below i create 2 buttons in a container, add the container as .Control
object and use BUT_Click to get clicks
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
Dim wp As WebContainer = New WebContainer(Me)
wp.Arrangement = Arrange.Horizontal
wp.Spacing = True
wp.Height = "30px"
Dim wb As WebButton = New WebButton(wp) As "BUT"
wb.Text = "ButtonFine: " & CString(Row) & "_" & CString(Column)
wb = New WebButton(wp) As "BUT"
wb.Text = "ButtonDanger: " & CString(Row) & "_" & CString(Column)
wb.Class = "button is-danger"
Data.Control = wp
End Select
End
Public Sub BUT_Click()
Message(Last.Text)
End
Good luck
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230301/75623d07/attachment-0001.htm>
More information about the User
mailing list