Advertisement
jsbsan

fmainPatoStrategy

Oct 16th, 2013
1,460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.84 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Public Sub Form_show()
  4.  
  5.   Dim p As Pato
  6.   Dim comportamiento As IVolar
  7.  
  8.   'Defino inicialmente el pato, con un comportamiento de vuelo "VolarPlaneando"
  9.   p = New Pato
  10.   comportamiento = New VolarAlas
  11.   p.setVolar(comportamiento)
  12.   'escribo comportamiento en el textlabel del formulario...
  13.   TextLabel1.text = "Comportamiento Inicial del vuelo del Pato: " & "<br>" & p.getVolar() & "<br>"
  14.  
  15.   TextLabel1.text &= "<font color=\"red\">Atención, le han dado un tiro al Pato...." & "</font><br>"
  16.  
  17.   'ahora voy a cambiar el comportamiento...a que ahora ya no puede volar...
  18.  
  19.   TextLabel1.text &= "Cambio tipo de vuelo del pato actual..." & "<br>"
  20.   comportamiento = New NoVolar
  21.   p.setVolar(comportamiento)
  22.   TextLabel1.text &= p.getVolar() & "<br>"
  23.  
  24. End
  25.  
  26. Public Sub ToolButton1_Click()
  27.  
  28.   Me.close
  29.  
  30. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement