[Gambas-user] Event WebTable.Click

Mayost Sharon sharon at 455.co.il
Thu Mar 2 17:03:15 CET 2023


Hello

Thanks

The problem is that if you don't receive an event on clicking inside the table (WebTable_Click) we won't be able to know from which row and column the button was clicked

And there is another problem that the table click event (WebTable_Click) only works if you add a button but the other controls do not transfer the click event to the table

---------- Original Message -----------
From: Bruce Steers <bsteers4 at gmail.com>
To: Gambas Mailing List <user at lists.gambas-basic.org>
Sent: Wed, 1 Mar 2023 20:58:20 +0000
Subject: Re: [Gambas-user] Event WebTable.Click

> 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
------- End of Original Message -------



More information about the User mailing list