Ya llevo una temporada usando Gambas3 por que es lo mejor para todos.
...aunque yo use luego gambas2..
Que si, que uso Gambas3.Palabrita del niño Jesús.
Como ando creando ejemplos.Pues este el que uso.
Bien.Haciendo una gráfica sin el componente "adecuado". bajo Gambas3.
Era un ejercicio.
Primero con gb.gui y luego con gb.qt4.
Con gb.gui sale así.Pulso el botón y desaparece el borde.(Debe ser cuando limpia el control).
Con gb.qt4
Así no desparece.Siendo el mismo código.Se puede observar que no se presenta igual.
Ni parecido.Con lo que habrá que cambiar cosas.
El código del botón.
Public Sub btnComenzar_Click()
Dim valores As Integer[] = [100, 200, 300, 250, 500, 1000, 200, 50, 150]
Dim valormaximo As Integer
Dim y As Integer
Dim anchurapizarra As Integer
Dim alturapizarra As Integer
Dim anchurabarra As Integer
Dim alturabarra As Integer
Dim separacion As Integer
'Hallamos el valor máximo
valormaximo = -1
For y = 0 To valores.Count - 1
If valores[y] > valormaximo Then
valormaximo = valores[y]
Endif
Next
'Damos unas dimensiones
anchurapizarra = Pizarra.Width
alturapizarra = Pizarra.Height
anchurabarra = 50
'Comenzamos el dibujo.
Pizarra.Clear
Draw.Begin(Pizarra)
For y = 0 To valores.Count - 1
alturabarra = (valores[y] * alturapizarra) / valormaximo
Draw.FillColor = Color.Black
Draw.FillStyle = Fill.Diagonal
Draw.Rect(separacion, alturapizarra - alturabarra, anchurabarra, alturabarra)
separacion = separacion + 10 + anchurabarra
Next
Draw.End
End
Dim valores As Integer[] = [100, 200, 300, 250, 500, 1000, 200, 50, 150]
Dim valormaximo As Integer
Dim y As Integer
Dim anchurapizarra As Integer
Dim alturapizarra As Integer
Dim anchurabarra As Integer
Dim alturabarra As Integer
Dim separacion As Integer
'Hallamos el valor máximo
valormaximo = -1
For y = 0 To valores.Count - 1
If valores[y] > valormaximo Then
valormaximo = valores[y]
Endif
Next
'Damos unas dimensiones
anchurapizarra = Pizarra.Width
alturapizarra = Pizarra.Height
anchurabarra = 50
'Comenzamos el dibujo.
Pizarra.Clear
Draw.Begin(Pizarra)
For y = 0 To valores.Count - 1
alturabarra = (valores[y] * alturapizarra) / valormaximo
Draw.FillColor = Color.Black
Draw.FillStyle = Fill.Diagonal
Draw.Rect(separacion, alturapizarra - alturabarra, anchurabarra, alturabarra)
separacion = separacion + 10 + anchurabarra
Next
Draw.End
End
El sistema es Ubuntu 11.04.
Aja.Con gb.qt4 hay que usar esto:
'Comenzamos el dibujo.
Pizarra.Clear
Draw.Begin(Pizarra)
For y = 0 To valores.Count - 1
alturabarra = (valores[y] * alturapizarra) / valormaximo '
Draw.Foreground = Color.Black 'Se añade
Draw.FillColor = Color.Black 'Se añade
Draw.FillStyle = Fill.Diagonal
Draw.Rect(separacion, alturapizarra - alturabarra, anchurabarra, alturabarra)
separacion = separacion + 10 + anchurabarra
Next
Draw.End
Pizarra.Clear
Draw.Begin(Pizarra)
For y = 0 To valores.Count - 1
alturabarra = (valores[y] * alturapizarra) / valormaximo '
Draw.Foreground = Color.Black 'Se añade
Draw.FillColor = Color.Black 'Se añade
Draw.FillStyle = Fill.Diagonal
Draw.Rect(separacion, alturapizarra - alturabarra, anchurabarra, alturabarra)
separacion = separacion + 10 + anchurabarra
Next
Draw.End
Solo hay que retocar luego para que no toque los bordes.
Saludos.