CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

TIWCGJQMenuItem.Hint is unassigned

by kattunga » 02 Oct 2013 16:19

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?
Last edited by kattunga on 02 Oct 2013 20:37, edited 1 time in total.
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by Alexander Bulei » 02 Oct 2013 17:16

Hi kattunga,

Fixed in V1.7.0.2943.

Thanks.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by kattunga » 02 Oct 2013 19:37

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.
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by Jorge Sousa » 02 Oct 2013 23:34

Hi

Menu has the public property UserData: Pointer

Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by kattunga » 03 Oct 2013 12:58

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
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by kattunga » 03 Oct 2013 13:02

Today I'm going to buy sourcecode to see it by my self :D.
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by Alexander Bulei » 03 Oct 2013 13:52

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Jorge Sousa » 03 Oct 2013 16:03

Hi

Maybe you would like to see a published property in Design-Time, is that it?

Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by kattunga » 03 Oct 2013 17:50

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
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by Jorge Sousa » 03 Oct 2013 17:54

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
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Next

Return to JQMenu

cron

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.