extend group property

View: New views
3 Messages — Rating Filter:   Alert me  

extend group property

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

is it possible to extend the use of group property to not just share event between control ?
 
I know some programming tools on windows that they allow a control to set multiple group . their group provide more function .

group can be use to assign same property of controls .
for example I have 3 button and 3 textbox with same group call gr_test .

I can call the same property from these control using group .

gr_test.visible = false
or
gr_test.enable = false

this is very useful and safe alot of work .

I hope to see this in  future release

Re: extend group property

by Benoît Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> is it possible to extend the use of group property to not just share event
> between control ?
>
> I know some programming tools on windows that they allow a control to set
> multiple group . their group provide more function .
>
> group can be use to assign same property of controls .
> for example I have 3 button and 3 textbox with same group call gr_test .
>
> I can call the same property from these control using group .
>
> gr_test.visible = false
> or
> gr_test.enable = false
>
> this is very useful and safe alot of work .
>
> I hope to see this in  future release

This is not possible. The group notion does not exist in the interpreter.

But you can do it yourself with Gambas code, by creating a class for that.
This class would be a container of Controls, and will have most of the Control
properties. When a property is read or write on the container class, it will
be read or write on all of the controls put in it.

Regards,

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: extend group property

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Benoît Minisini wrote:
> is it possible to extend the use of group property to not just share event
> between control ?
>
> I know some programming tools on windows that they allow a control to set
> multiple group . their group provide more function .
>
> group can be use to assign same property of controls .
> for example I have 3 button and 3 textbox with same group call gr_test .
>
> I can call the same property from these control using group .
>
> gr_test.visible = false
> or
> gr_test.enable = false
>
> this is very useful and safe alot of work .
>
> I hope to see this in  future release

This is not possible. The group notion does not exist in the interpreter.

But you can do it yourself with Gambas code, by creating a class for that.
This class would be a container of Controls, and will have most of the Control
properties. When a property is read or write on the container class, it will
be read or write on all of the controls put in it.

Regards,

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
 using container  is not practical . for example a entry form with alot of textbox field . depend on user privilege , some I need to disable or hide or enable or change text colour.


just imaging how much code will be save if group allow and also make code easy to read.