[Gambas-user] Controls on form do not respond.

VonZorch VonZorch at ...626...
Fri Jan 3 03:25:34 CET 2014


My archivers are being balky, I couldn't send the entire project.  What
follows is the class files for the main form and the opened form.

' Gambas class file frmMain

Private Names As String[]
Private Stats As New FrmStat[]
Private strHtQ[2] As String
Private strWtQ[2] As String
Private Hx As String[]
Private Wx As String[]


Public Sub _new()
  Dim Loop1 As Byte
  Dim Loop2 As Byte
  Dim Base As Byte = 50
  Dim NewStat As FrmStat
  Names =
Split("STR,CON,DFT,AGL,SPD,INT,WILL,APR,EMP,VOI,CHA,TEK,SCI,PIO,RWA,MCA,EST,PSI,MAG")
  For Loop1 = 0 To 18
    If Loop1 > 16 Then Base = 0
    NewStat = New FrmStat(Names[Loop1], Base, Loop1, TabStrip1)
    Stats.Add(NewStat)
    Stats[Loop1].X = 0
    Stats[Loop1].Y = (Loop1 + 1) * 23
    If Names[Loop1] = "INT" Then Stats[Loop1].CostX = 2
    If Loop1 > 16 Then Stats[Loop1].ULimit = 50
    If Loop1 = 17 Then Stats[Loop1].LLimit = -50
  Next
  cmbRace.Index = 1
  strHtQ[0] = "2,172"
  strHtQ[1] = "2,166"
  spnSize_Change()
 End

Public Sub Form_Open()
End
Public Sub StatChanged(Index As Byte)
  
  
  
End

Public Sub UpdateCost()
  Dim Cost As Integer
  Dim Loop1 As Byte
  For Loop1 = 0 To 16
    Cost += Stats[Loop1].Cost
  Next
  lblCost.Text = Cost
  lblPointsLeft.Text = lblPoints.Text - lblCost.Text
  If Val(lblPointsLeft.Text) < 0 Then
    lblPointsLeft.Foreground = Color.Red
  Else
    lblPointsLeft.Foreground = Color.Black
  Endif
End

Public Sub spnSize_Change()
  Dim Ht As Float
  Dim S As Byte = cmbSex.Index
  Dim HH As String 
  Hx = Split(strHtQ[S])
  Ht = Round((spnSize.Value / Hx[0]) + Hx[1], -1)
  vbxMetricHT.Value = Ht
  tbxFeet.Text = Conversions.cm2Ft(Ht, 1)
End

Public Sub btnCurve_Click()
  frmCurve.Show
End

frmCurve.Class
' Gambas class file

Private Ht As Float[]
Private Wt As Float[]
Public lblHt As New Label[]
Public lblWt As New Label[]

Public Sub _new()
  Dim Loop1 As Byte
  Dim This As Label
  This = New Label(Me)
  This.X = 0
  This.Y = 660
  This.Width = 35
  This.Height = 21
  This.Text = "0"
  This.Alignment = Align.Right
  lblHt.Add(This, 0)
  This = New Label(Me)
  This.X = 0
  This.Y = 21
  This.Width = 35
  This.Height = 21
  This.Alignment = Align.Right
  This.Text = "10"
  lblHt.Add(This, 10)
  This = New Label(Me)
  This.X = 677
  This.Y = 0
  This.Width = 35
  This.Height = 21
  This.Alignment = Align.Center
  This.Text = "10"
  lblHt.Add(This, 10)
  Draw.Begin(drwPlot)
    For Loop1 = 0 To 10
      This = New Label(Me)
      This.X = 18 + (Loop1 * 66)
      This.Y = 0
      This.Width = 35
      This.Height = 21
      This.Text = Str(Loop1)
      This.Alignment = Align.Center
      If Loop1 = 10 Then This.X = 677
      lblWt.Add(This, 0)
      If Loop1 > 0 And Loop1 < 10 Then
        This = New Label(Me)
        This.X = 0
        This.Y = 670 - (Loop1 * 66)
        This.Width = 35
        This.Height = 21
        This.Alignment = Align.Right
        This.Text = Str(Loop1)
        lblHt.Add(This, Loop1)
        Draw.Line(0, Loop1 * 66, 660, Loop1 * 66)
        Draw.Line(Loop1 * 66, 0, Loop1 * 66, 660)
      Endif
    Next
  Draw.End
End


Public Sub Form_Open()

Dim Loop1 As Integer

  
End
Private Sub btnPlot_Click()
  Dim H As Float = (Ht[Ht.Count - 1] - Ht[0]) / 10
  Dim W As Float = (Wt[Wt.Count - 1] - Wt[0]) / 10
  Dim Loop1 As Byte
  For Loop1 = 0 To 10
    lblHt[Loop1].Text = Str(Ht[0] + (H * Loop1))
    lblWt[Loop1].Text = Str(Wt[0] + (W * Loop1))
  Next


End

Private Sub btnSet_Click()
  Dim H As Float
  Dim W As Float
  If rbtEnglish.True Then
    H = Conversions.Ft2CM(tbxHt.Text, 1)
    W = Conversions.Lb2Kilo(vbxWt.Value, 1)
  Else
    H = Val(tbxHt.Text)
    W = vbxWt.Value
  Endif
  Ht.Add(H)
  Wt.Add(W)
  vbxCount.Value = Ht.Count
  tbxHt.Text = ""
  vbxWt.Value = 0
End

I have breakpoints in every Sub, nothing catches.



--
View this message in context: http://gambas.8142.n7.nabble.com/Controls-on-form-do-not-respond-tp44971p44990.html
Sent from the gambas-user mailing list archive at Nabble.com.




More information about the User mailing list