Board index » cppbuilder » Add Actions at runtime in a tactionList

Add Actions at runtime in a tactionList

I would like to know how to add some custom actions into an action list
at runtime. I want to make some shortcuts for the dbgrig headings,
depending on the name of the tableIi choose to open. So my problem is
that I dont know in advance wich colums I want to used in the shortcuts.
Thanks
 

Re:Add Actions at runtime in a tactionList


The trick is, as you are probably aware, how to arrange for an action's
execution. If your actions are dynamically allocated then you probably will
have had some sort of event closure method waiting in the wings for the new
action(s).

The act of actually creating an action shouldn't differ from any other VCL
component, except that it will not be visible, and you will need to assign
the OnExecute event closure. This also assumes that you have an TActionList
waiting to receive the new actions.

I don't know if this completely answers your question, but hopefully it is a
start.

Quote
"Daniel" <cus...@integratik.com> wrote in message

news:3AC4BC24.3B89160B@integratik.com...
Quote
> I would like to know how to add some custom actions into an action list
> at runtime. I want to make some shortcuts for the dbgrig headings,
> depending on the name of the tableIi choose to open. So my problem is
> that I dont know in advance wich colums I want to used in the shortcuts.
> Thanks

Re:Add Actions at runtime in a tactionList


Thanks for youe help but I still have problem ADDING actions at runtime or
without the action editor. What I want to do is to be able to auto create the
actions to order a DBGrid by colums. I have already added the property Ordered
in the dbgrid, wich contains the numbers of the colums I want to be able to
order. Now I just want to autocreate those keyboard shortcuts automatically. I
have trouble adding those actions to the TActionList component already
exising... I dont really know how... Could u help me?

Other Threads