Export
Inherits TextArea
Public Const _Properties As String = "*,Type{TextTypes.*}=Nota"
Public Const _Group As String = "Form"
Public Const _Similar As String = "TextArea"
Public Const _DrawWith As String = "TextArea"
Property Type As Integer Use $type = 0
' Gambas class file
Export
Public Const Nota As Integer = 0
Public Const Aviso As Integer = 2
Public Const Memo As Integer = 1
Public Const Confidential As Integer = 3
Cita:Sin embargo, me suena que se podía hacer de otra manera resolviéndolo todo en la clase principal sin tener que declarar la segunda clase que contiene las constantes. ¿Lo he soñado?¿Alguien sabe cómo hacerlo?
Public Enum lunes, martes, miercoles, jueves, viernes, sabado, domingo
Public Sub Main()
Dim cerveza As BebidaCerveza
cerveza = New BebidaCerveza(BebidaCerveza.GUINNESS, Vaso.JARRA)
cerveza.servir
End
Public Enum AMBAR = 1, GUINNESS = 2, HEINEKEN = 3
Private $unvaso As Vaso
Private $marca As Integer
Private smarca As String
Public Sub _new(marca As Integer, medida As Integer)
$marca = marca
smarca = Choose(marca, "AMBAR", "GUINNESS", "HEINEKEN")
$unvaso = New Vaso(medida)
End
Public Sub servir()
Print "Sirviendo " & $unvaso.getCentimetrosCubicos() & " cc. de cerveza " & smarca
End
Public Enum JARRA = 500, TUBO = 250, TERCIO = 333, CANA = 200
Private $cc As Integer
Public Sub _new(cc As Integer)
$cc = cc
End
Public Sub getCentimetrosCubicos() As Integer
Return $cc
End
Cita:
Sirviendo 500 cc. de cerveza GUINNESS
Export
Inherits TextArea
'Public Const _Properties As String = "*,Type{TextTypes.*}=Nota"
Public Const _Properties As String = "*,Type{Nota.Nota;Aviso;Memo;Confidential}=Nota"
Public Const _Group As String = "Form"
Public Const _Similar As String = "TextArea"
Public Const _DrawWith As String = "TextArea"
Public Const Nota As Integer = 0
Public Const Aviso As Integer = 1
Public Const Memo As Integer = 2
Public Const Confidential As Integer = 3
Property Type As Integer Use $type = 0
Export
Inherits TextArea
Public Enum Nota, Aviso, Memo, Confidential
'Public Const _Properties As String = "*,Type{TextTypes.*}=Nota"
Public Const _Properties As String = "*,Type{Nota.Nota;Aviso;Memo;Confidential}=Nota"
Public Const _Group As String = "Form"
Public Const _Similar As String = "TextArea"
Public Const _DrawWith As String = "TextArea"
'Public Const Nota As Integer = 0
'Public Const Aviso As Integer = 1
'Public Const Memo As Integer = 2
'Public Const Confidential As Integer = 3
Property Type As Integer Use $type = 0