[Gambas-user] What has happened to ValueBox

Michael mdavies5 at ...169...
Fri Dec 17 14:37:09 CET 2010


Benoit,
On the line "Dim txtTemp as Valuebox = LAST" I get an error "Expecting 
valuebox got textbox" But the last control was a valuebox.
It works if I change the code to "Dim txtTemp as Textbox" even though it 
is not a textbox firing the event.

Then I cannot read the "name" that I assigned to the valuebox. 
txtTemp.Name just returns "Textbox".

I tried replacing the valuebox with a DateBox but this appears to have a 
bug. I can set the value of the DateBox in code and it displays 
correctly. I can pick a value from the DatePicker and it displays 
properly. But it does not have a .Text property to read so I read the 
.Value property and it always returns "00:00:00"

Using gtk+ and Ubuntu 10.10 64bit and Gambas 3363. The code i use worked 
fine in Gambas2.

Here is a small extract of the code as it works in Gambas2:
Public Sub Value_LostFocus()
         Dim txtTemp As ValueBox = Last    'MUST CHANGE TO TextBox in 
Gambas3
         txtTemp.Background = Color.White

         Select Case txtTemp.Name     'Gambas 3 returns "textbox"
             Case "txtDaysGas"

Regards
Michael


On 17/12/10 23:41, Benoît Minisini wrote:
>> In Gambas 2 I had a number of Value Boxes which I assigned to Group
>> "Value". Then I would identify the calling box in code as follows:
>> Public Sub Value_GotFocus()
>>       dim txtTemp as valueBox = LAST
>>       SELECT CASE txtTemp.Name 'Returns name of calling Value Box
>> <various actions>
>>
>> In Gambas 3 I got an error because the Value boxes are recognised as
>> plain text boxes not as Value boxes. I changed my code (Dim txtTemp as
>> Textbox) but when reading the LAST.Name it returns "TextBox". It is
>> returning the type not the name I assigned to the textbox.
>>
>> The group feature was great for preventing repetitive code but this
>> functionality appears to have gone. I must write similar code for each
>> TextBox_GotFocus event.
>>
>> Regards
>> Michael
>>
> ValueBox exists in Gambas 3, so I don't understand what error you are talking
> about. ValueBox are not "recognized as plain text boxes", whatever that
> means...
>
> Can you explain better what happens to you?
>




More information about the User mailing list