cancel
Showing results for 
Search instead for 
Did you mean: 

How to Add run time Script Dynamically in any event ?

Former Member
0 Kudos

I wish to create a Dynamic Menu (Menu from Database) and wish to add clicked Event script run time for executing the same.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I've done that some time ago for a popup menu.

The design menu only exists of a single item.

The only code it has is in the clicked event:

In a try catch:

parentwindow . dynamic trigger event ue_pop(this.text)

In short in the rbuttondown event of the window (or at ancestor level) :

for all items in options[]

  m_pop[i] = create m_pop_item

  m_pop[i]. item[1].text = options[i]

  if i <> 1 then m_pop[1].tem[i] = m_pop[i].item[1]

m_pop[1].popmenu(xpos, ypos)

And in the ue_pop event you can check based on the string received (or you can also use an integer)

you take the appropriate action.

For a window menu you can also use a menu with menu items more than you will ever need and make what you don't need invisible.

Ben