Dyslexicbloke
Member
Hi folks,
I am currently working on a little project that is going to need a date picker control.
Obviously there isn’t a native one so building a widget is the way to go.
That leads me to the question.
Since I will have at least 40 objects with actions, 35 of which will need to do exactly the same thing but with differing data, is there a way to identify which control was pressed last.
Obviously I appreciate that the code in any specific action definition is unique to that control so identifying the control concerned would not usually be necessary but that also means that every control must have unique code assigned to its action properties.
An elegant solution would be to use code common to all similar controls that simply called a program and passed in a variable that identified which control had called it, a control ID if you like.
These could of course be individually coded:-
MyComonAction(1) / MyComonAction(2)
but it would be more than a little useful if there were some way to derive one from the control itself:-
MyComonAction(i)
much like ‘ i ’ works for actions on array elements.
I would also be interested to know if data boxes, primitives and the like can be referenced in code directly …. Is it possible to achieve anything like :-
DataBox1.Visible:=0
Or perhaps
DataBox1.Top:=10
Thanks for reading ….
Alistair
I am currently working on a little project that is going to need a date picker control.
Obviously there isn’t a native one so building a widget is the way to go.
That leads me to the question.
Since I will have at least 40 objects with actions, 35 of which will need to do exactly the same thing but with differing data, is there a way to identify which control was pressed last.
Obviously I appreciate that the code in any specific action definition is unique to that control so identifying the control concerned would not usually be necessary but that also means that every control must have unique code assigned to its action properties.
An elegant solution would be to use code common to all similar controls that simply called a program and passed in a variable that identified which control had called it, a control ID if you like.
These could of course be individually coded:-
MyComonAction(1) / MyComonAction(2)
but it would be more than a little useful if there were some way to derive one from the control itself:-
MyComonAction(i)
much like ‘ i ’ works for actions on array elements.
I would also be interested to know if data boxes, primitives and the like can be referenced in code directly …. Is it possible to achieve anything like :-
DataBox1.Visible:=0
Or perhaps
DataBox1.Top:=10
Thanks for reading ….
Alistair