[Gambas-user] Menu over a control

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Jun 29 10:02:23 CEST 2011


Yes, that would be a problem, but there is LAST to handle this:

LAST.Tag would give you the tag of the object which was clicked last. 
You will identify the correct type of object by its name of origin "MyText".

Now you can insert

Public SUB MyText_Click()

When you type LAST. you will get the list of options here and can be 
sure to react to the right object as it is defined by "MyText".

Rolf


Am 29.06.2011 09:20, schrieb M. Cs.:
> Still I have a problem:
>
> If I create TextLabels as you told me, I can get their tags, so I can
> identify them, but cannot remove them. In other case if I create them
> as a TextLabel[], I can add and remove them, but cannot figure which
> one of them has been clicked. How to make both of the option usable?
>
> 2011/6/28, M. Cs.<mohareve at ...626...>:
>> Merci Fabien!
>>
>> 2011/6/28, Fabien Bodard<gambas.fr at ...626...>:
>>> Public sub _New() dim i as integer
>>>
>>> dim hTextLabel as TextLabel
>>>
>>> For i = 0 to 100
>>>    hTextLabel = new TextLabel(Me) as "MyText"
>>>    hTextLabel.Tag = i
>>> next
>>> end
>>>
>>> Public Sub MyText_Click()
>>>
>>>    select case Last.Tag
>>>      Case 1
>>>         'Text1
>>>      Case 2
>>>         'Text2
>>>      'etc
>>>    end
>>> end
>>>
>>>
>>>
>>> 2011/6/28 M. Cs.<mohareve at ...626...>:
>>>> How can í create a flying menu over a dinamically created control?
>>>> I know how can I do it for static elements, but if I have an array of
>>>> let say TextLabels, how can I attach a menu to each of the elements
>>>> (in order to get and use X and Y coordinates of the controls) ?
>>>>
>>>> Is It possible to use Object.Attach(Me,container,"ArrayClick("&i&")")?
>>>> I know it's a bit Javascriptish, but I don't know how to use one
>>>> suboutine for multiple elements.
>>>>
>>>> It would be silly to have 100 predefined TextLabels and 100 subs
>>>>
>>>> PUBLIC SUB TextLabel[1]_Click()
>>>> Action_Activate("mymenu")
>>>> END
>>>>
>>>> PUBLIC SUB TextLabel[2]_Click()
>>>> Action_Activate("mymenu")
>>>> END
>>>> ...
>>>>
>>>>
>>>> I don't see how can Gambas manage this dinamic contents.
>>>>
>>>> ------------------------------------------------------------------------------
>>>> All of the data generated in your IT infrastructure is seriously
>>>> valuable.
>>>> Why? It contains a definitive record of application performance,
>>>> security
>>>> threats, fraudulent activity, and more. Splunk takes this data and makes
>>>> sense of it. IT sense. And common sense.
>>>> http://p.sf.net/sfu/splunk-d2d-c2
>>>> _______________________________________________
>>>> Gambas-user mailing list
>>>> Gambas-user at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>>
>>>
>>>
>>>
>>> --
>>> Fabien Bodard
>>>
>>> ------------------------------------------------------------------------------
>>> All of the data generated in your IT infrastructure is seriously
>>> valuable.
>>> Why? It contains a definitive record of application performance, security
>>> threats, fraudulent activity, and more. Splunk takes this data and makes
>>> sense of it. IT sense. And common sense.
>>> http://p.sf.net/sfu/splunk-d2d-c2
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>





More information about the User mailing list