Mostrando las entradas con la etiqueta Clases. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Clases. Mostrar todas las entradas

lunes, 5 de octubre de 2015

Clase Mancha




FMain:

' gambas class file

Private circulo As Mancha


Public Sub Form_Open()
Me.Center
SliderBox1.MaxValue = 1000
SliderBox1.MinValue = 1
SliderBox1.Value = 500
End

Public Sub Button1_Click()
Timer1.Start
End

Public Sub Timer1_Timer()
circulo = New Mancha(DrawingArea1)
Print Timer1.Delay
End

Public Sub Button2_Click()
Timer1.Stop
End

Public Sub Button3_Click()
DrawingArea1.Clear
End

Public Sub SliderBox1_Change()
Timer1.Delay = SliderBox1.Value
End


Clase Mancha:

' gambas class file

Property pantalla As DrawingArea
Private $pantalla As DrawingArea


Public Sub _new(device As DrawingArea)
$pantalla = device
Crear()
End

Private Function pantalla_Read() As DrawingArea
Return $pantalla
End

Private Sub pantalla_Write(Value As DrawingArea)
$pantalla = Value
End

Public Sub Crear()
Dim x, y, radio, pintura As Integer
Dim EsteColor As Integer

pintura = Rand(1, 5)
Select Case pintura
Case 1
EsteColor = Color.Red
Case 2
EsteColor = Color.Black
Case 3
EsteColor = Color.Blue
Case 4
EsteColor = Color.Green
Case 5
End Select
x = Rand(1, $pantalla.Width)
y = Rand(1, $pantalla.Height)
radio = Rand(1, 50)
' Print "X=" & x & ",Y=" & y & ",Radio=" & radio

Paint.Begin($pantalla)
Paint.LineWidth = 1
Paint.Background = EsteColor
Paint.Arc(x, y, radio)
Paint.Stroke
Paint.End

End


Código fuente: virus-0.0.1.tar.gz


lunes, 23 de marzo de 2015

TextLabel



La clase TextLabel nos permite usar texto enriquecido por medio de algunas etiquetas html.

TextLabel1.Text = "<b>Texto en negrita</b>"
TextLabel1.Text = "<i>Texto en cursiva</i>"
TextLabel1.Text = "<s>Texto tachado</s>
TextLabel1.Text = "<u>Texto subrayado</u>"

TextLabel1.Text = "<b>Texto en negrita y salto de linea</b><br>"


TextLabel1.Text = "<b><i>Texto en cursiva y en negrita</i></b>"




TextLabel1.Text = "<sub>Texto subindice</sub>Texto normal<sup>Texto superindice</sup>"

TextLabel1.Text = "<font color=\"green\">Texto de color verde</font><br>"
TextLabel1.Text &= "<font color=\"red\">Texto de color rojo</font><br>"
TextLabel1.Text &= "<font color=\"blue\">Texto de color azul</font>"



TextLabel1.Text = "<H1>Encabezado H1</H1><br><H2>Encabezado H2</H2><br><H3>Encabezado H3</H3>"


TextLabel1.Text &= "<big>Texto grande</big><br>"
TextLabel1.Text &= "<small>Texto pequeño</small><br>"
TextLabel1.Text &= "<big><big>Texto muy grande</big></big><br>"
TextLabel1.Text &= "<small><small>Texto muy pequeño</small></small><br>"

TextLabel1.Text = "<font color=\"green\">Texto de <font color=\"red\">" & VariableX & "</font> color verde</font><br>"

 TextLabel1.Text = "<b>Ultima modificación de la base de datos: <i><font color=\"red\">" & Now & "</font></i></b>"

miércoles, 18 de marzo de 2015

URLLable


URLLable (nueva clase en gambas 3.7)

Ya tenemos disponible la nueva versión de gambas 3.7 y entre otras novedades importantes tenemos la de una nueva clase llamada URLLabel.

Con esta clase podemos muy fácilmente añadir un link para que el usuario vea una pagina de internet X, solamente modificando dos de sus propiedades de escritura y lectura que son Link, en donde debemos poner el enlace o Link exacto sin errores y la propiedad Text que es el nombre del enlace y es como el usuario lo vera podemos usar la misma dirección de enlace u otro nombre que consideremos mejor.