[Gambas-user] Overriding ValueBox, adding new Types

Tobias Boege taboege at ...626...
Sun Dec 29 18:22:48 CET 2013


Hi,

I'm writing a ValueBox extension which recognises complex numbers when
chosen ValueBox.Type = ValueBox.Complex. For the time being I'm using the
"global symbol table" extension method, i.e. I call my class ValueBox and
Export it - just for the sake of it.

(Later, I will likely directly commit the stuff to gb.form because it should
not be a problem, right Benoit? I mean the user explicitly needs to set
ValueBox.Type = ValueBox.Complex and only then we Component.Load("gb.complex")
or raise an error so no additional dependencies).

However, the problem now is that I want the IDE to show my new
ValueBox.Complex constant in the properties list (Type's ComboBox), so I
wrote:

  Public Const _Properties As String = "*,Type{ValueBox.*}=0"

into my class. When I now select the Complex constant, the IDE shows me this
error: "Invalid property value. Null object". The ValueBox disappears and if
I try again setting the Type property to ValueBox.Complex, it works but the
control remains invisible in the form editor.

I have attached a sample project which extends ValueBox to recognise a
ValueBox.Gambas type. Just try to select the "Gambas" constant in the IDE to
reproduce.

So two problems:
 - the error when first selecting the custom constant
 - the control is invisible after the error

As you will see, I create a TextBox inside the ValueBox container displaying
the string "Gambas" as soon as the Type is set to Gambas. I expected the IDE
to show this control and not nothing.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: property-constants-in-ide-0.0.1.tar.gz
Type: application/octet-stream
Size: 5267 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20131229/de370556/attachment.obj>


More information about the User mailing list