Status: New
Owner: ----
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 199 by john.aaron.r...@gmail.com: LostFocus & Leave events not  
activated for ValueBox
http://code.google.com/p/gambas/issues/detail?id=199

I have a problem with validating a user-entered value in a ValueBox. I've
tried LostFocus & Leave and neither seems to do the validation i.e. no  
Print "Latitude Validation" executes and no message box appears for  
incorrect values. Looks like a bug.

So I thought that I would try Change, even though the documentation says  
that it is raised on each character typed in (rather than at the end of  
typing in the changes to the value) which would not be any good. However,  
I'm not able to use the Change event (i.e. not in popup menu for event and  
has no effect at runtime) for a Valuebox: looks like another bug.  I've  
tried using KeyRelease, but that applies to each character change, so that  
it rejects the value as each character is entered. PS Should I log this as  
another issue?

Code fragment is:
Public Sub ValueBoxLatitude_LostFocus()
   Dim latitude As Float
   Dim i As Integer
   Print "Latitude Validation"
   latitude = Last.Value
   If latitude < -90 Or latitude > 90 Then
     Message.Info("Must be between -90 and +90 - try again")
     Last.SetFocus
     Stop Event
   Endif
   i = CInt(latitude * 1000000)
   Print "CInt(latitude * 1000000)=", i
   If (latitude * 1000000) - CFloat(i) <> 0.0 Then
     Message.Info("More than 6 decimal digits - try again")
     Last.SetFocus
     Stop Event
   Endif
End

Version: 3.0
Operating system: Linux
Distribution: Ubuntu 10.04
Architecture: x86
GUI component: GTK+ (as I haven't specified the GUI)
Desktop used: Gnome2

Project attached.

Database attached.



Attachments:
        JewishHeritage.tar.gz  29.4 KB
        JewishHeritage.db  8.0 KB


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to