[Gambas-user] two gui questions

Ron ron at ...1740...
Sun Jun 1 13:08:34 CEST 2008


Hi,

1)
I have a small form with some textboxes and 2 checkboxes, and a btnSave 
being disabled by default at showtime.

If I set one of the two chkBoxes to TRUE inside form_open() the btnSave 
gets enabled, why?
Since no one clicked in it yet, is this correct behaviour?
Loading text into the textboxes doesn't trigger this, so it's 
inconsistent to begin with.

This code underneath:

PUBLIC SUB Form_Open()
 
  txtName.Text = Main.sAIBOName
  txtIPAddress.Text = Main.sAIBOIPAddress
  txtEmailAddress.text = Main.sAIBOEmailAddress
  txtPollTime.text = Main.sAIBOPollTime
  chkDebug.Value = FALSE
  chkEnable.Value = TRUE

END

PUBLIC SUB btnSave_Click()

END

PUBLIC SUB btnCancel_Click()

  ME.close

END

PUBLIC SUB txtName_KeyPress()

  btnSave.Enabled = TRUE

END

PUBLIC SUB txtIPAddress_KeyPress()

  btnSave.Enabled = TRUE

END

PUBLIC SUB txtEmailAddress_KeyPress()

  btnSave.Enabled = TRUE

END

PUBLIC SUB txtPollTime_KeyPress()

  btnSave.Enabled = TRUE

END

PUBLIC SUB chkEnable_Click()

  btnSave.Enabled = TRUE

END

PUBLIC SUB chkDebug_Click()

  btnSave.Enabled = TRUE

END


2)

When I have a Textbox to display my log entries, how can I keep the 
cursor set to the last line (the bottom one)

I now have this code, which counts the lines added and set .Line to it, 
but it there another, better way to do this?
If not, maybe an idea for builtin function by setting .Lines to -1 or 
something like that?

PUBLIC iLogLines AS Integer

PUBLIC FUNCTION WriteLog(sText AS String, OPTIONAL sStrip AS Boolean)

  IF NOT sStrip THEN sText &= "\n"
 
  FMain.txtWindow.Text &= sText
  FMain.txtWindow.Line = iLogLines - 1
  iLogLines += 1
 
END

Gambas 2.6

Thanks for your time!
regards,
Ron.




More information about the User mailing list