[Gambas-user] Problems on UserControl properties

Benoît Minisini gambas at ...1...
Sat Sep 14 21:30:11 CEST 2013


Le 14/09/2013 21:22, Charlie Reinl a écrit :
> Am Freitag, den 13.09.2013, 22:25 +0200 schrieb Karl Reinl:
>> Salut Benoît,
>>
>> I'm making a Timepicker for me, but I ran into problems.
>>
>> I need 2 Class _Properties, first for 12/24 hours and second for minute
>> slices, both raise in the control property grid, but only the second
>> raise during form load, is it a bug  or what do I wrong?
>>
>> By that way, one can not declare something like
>> 	Public Const 12_h As Integer = 12
>>
>> I attached the project.
>
> Salut,
>
> I found out, the property_write event only raise, when the property took
> a value <> Default.
> If the property has its default value, property_write don't raise at
> form load.
> So if you drop the control on your form and see that the values are
> right (you have nothing to change), you will find you variable not
> filled.
>
> Now I fill the variables with their default value at declaration time.
>
> Is that wanted by design like that ?
>

Yes: the default value indicated in the _Properties string must be 
coherent with the default value actually implemented in the code. There 
is no mean for Gambas to guess the default value!

-- 
Benoît Minisini




More information about the User mailing list