[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #2929: Generic Events


http://gambaswiki.org/bugtracker/edit?object=BUG.2929&from=L21haW4-

Comment #1 by Brian G:

It would be good if it included som sort of status info for the change
for example

Class MyData

$ID As Integer
$Name As String
Property ID As Integer
Property Name As String
Event Changed(value As Variant, Symbol As String, type As String)

Private Function ID_Read() As Integer
    Raise Changed($ID, "ID", "Read")
    Return $ID
End
Private Sub ID_Write(Value As Integer)
    $ID = value
    Raise Changed($ID, "ID", "Write")
End
Private Function Name_Read() As String
    Raise Chanaged($NAME, "NAME", "Read")
    Return $NAME
End
Private Sub Name_Write(Value As String)
    $Name = value
    Raise Chanaged($NAME, "NAME", "Write")
End
end class

$MyData As New MyData As "Data"
Public Sub Main()
    Print "Hello world"
    $MyData.ID = 34
    Wait
End
Public Sub Data_Changed(value As Variant, symbol As String, type As String)
    Print "Change of type "; type;; "to";; symbol;; "of value";; Value
End


----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----

References:
[Gambas-bugtracker] Bug #2929: Generic Events<bugtracker@xxxxxxxxxxxxxx>