Home   Help Search Login Register  

Author Topic: Adding Event Handler to Existing Dialog Control  (Read 2134 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Adding Event Handler to Existing Dialog Control
« on: 19 Aug 2012, 22:15:19 »
Hi,

I'm working on a small addon as part of our mod to try and extend the options within the gear dialog (the screen to manage weapons etc when you press G).

What I want to do is add an "onMouseButtonDown" event handler so when each of the ammo/item slots is right clicked it runs a function. I managed to get it to work on the whole gear dialog but you could rightclick anywhere on the screen and it would always return the gear dialog IDD, not the IDC of the control its over.

I'm not too good with the inheritance part of the dialogs. I've managed to add my own controls to the gear dialog but modifying existing ones doesn't work out. My PBO is in a mod folder that is loaded after all my other addons. The fact the other controls are added to the gear dialog make me know that it is working somewhat.

All I've got in my controls is this:
Code: [Select]
class CA_Gear_slot_item1
{
onMouseButtonDown = "hint str _this;";
};

However the slots aren't doing anything when clicked.

Is there more to it than just redoing the controls classname and adding what I want to add?

Thanks for your help.

Jason
« Last Edit: 19 Aug 2012, 22:25:13 by JasonO »

Offline i0n0s

  • Former Staff
  • ****
Re: Adding Event Handler to Existing Dialog Control
« Reply #1 on: 20 Aug 2012, 00:44:04 »
*err*
What exactly do you want to achieve?
Since the controls do what they should do so far, at least from the description.