Page 1 of 2
TIWCGJQMenuItem.Hint is unassigned

Posted:
02 Oct 2013 16:19
by kattunga
Hi,
I attach a TIWCGJQMenu to a TMainMenu.
In TMenuItem I save a text in the hint property that I need to use in the OnCLick event.
But the Sender passed to the TMenuItem is the TIWCGJQMenuItem.
When I look for the value of TIWCGJQMenuItem(Sender).Hint it's unasigned.
If it's no possible to use the hint, I need some way to identify the TMenuItem that correspond to the TIWCGJQMenuItem passed in the Sender to get from it, how can I do that?
Re: TIWCGJQMenuItem.Hint is unasigned

Posted:
02 Oct 2013 17:16
by Alexander Bulei
Hi kattunga,
Fixed in V1.7.0.2943.
Thanks.
Best Regards.
Re: TIWCGJQMenuItem.Hint is unasigned

Posted:
02 Oct 2013 19:37
by kattunga
Hi,
Could be added the property "tag" to TIWCGJQMenuItem, and get the value of TMenuItem.Tag?
Actually there is no tag property in TIWCGJQMenuItem.
Also it would be usufull to have a property in TIWCGJQMenuItem where stored a pointer to the TMenuItem.
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
02 Oct 2013 23:34
by Jorge Sousa
Hi
Menu has the public property UserData: Pointer
Regards
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
03 Oct 2013 12:58
by kattunga
Hi,
But when menu is created automatically from TMainMenu, is UserData filled automatically with a pointer to the TMenuItem that reference?
Or I need to do manually in some way?
Regards
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
03 Oct 2013 13:02
by kattunga
Today I'm going to buy sourcecode to see it by my self

.
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
03 Oct 2013 13:52
by Alexander Bulei
Hi kattunga,
kattunga wrote:Hi,
... is UserData filled automatically with a pointer to the TMenuItem that reference?
Regards
You must do it manually.
Best Regards.
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
03 Oct 2013 16:03
by Jorge Sousa
Hi
Maybe you would like to see a published property in Design-Time, is that it?
Regards
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
03 Oct 2013 17:50
by kattunga
No, I going to explain my problem a little better.
I have a TMainMenu where I dynamically create the TMenuItems from table where I have a name and a script to execute. Then I save in TMenuItem.tag property the position of an array of scripts to execute when the TMenuItem is pressed.
All TMenuItem.OnClick events point to the same procedure where based on the tag property of the Sender I can know which script I need to run.
The problem here is that I can't know, inside TMenuItem.OnClick, to which TMenuItem object corresponds the Sender.
What I need is a runtime property in TIWCGJQMenuItem where I can access the original TMenuItem.
Regards
Re: TIWCGJQMenuItem.Hint is unassigned

Posted:
03 Oct 2013 17:54
by Jorge Sousa
Hi Christian
All you have to do is
MenuItem.UserData:= Pointer(position_of_an_array_of_scripts);
and after, in the OnClick event,
position_of_an_array_of_scripts:= NativeInt(MenuItem.UserData);
Best Regards