Yes it seems pan_setevent and pan_setvar are addition in A7 that are not present in A6, so I believe with A6 there's simply no way to use those buttons. Anyway thanks for all your help! Finally we ended up coding those buttons by ourselves...

Thanks a lot to Lazydog and Christian for their help.

About the _VAR issue: it's with underscore in both Delphi and C++, but the crucial point is that it's wrong to use it for flags! Seems like flags are stored as values of type long and not var... anyway just write p->flags |= VISIBLE and it works.