Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to add changing menu options to distrib'ed exe
Message
De
19/01/2018 10:56:43
 
 
À
19/01/2018 10:18:14
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Divers
Thread ID:
01657361
Message ID:
01657381
Vues:
55
>>You add a SKIP FOR clause to one of the bars.
>>The SKIP FOR clause calls a function, to which you pass the popup name and the bar number of it
>>
>>The function, when called can change the popup, eg
>>
>>Remove all the bars below its bar number ( for/next in reverse order)
>>Add new bars
>>
>>Been doing that to eg display the contents of a folder
>
>The skip for may be executed too often... so early on in the code I'd check for some condition (perhaps seconds() against the time of last rebuild of the popup) and bail out. Also, even if the condition is met, check for any changes (i.e. all the files same as the last time), and if no changes, also do nothing.
>
>It's pretty much like code you put in a .refresh() - has to be quick and nimble because you never know how many times it may fire.

All the skip clauses fire before any pad of the menu is activated - only then

In the beginning I removed the bars and added them again
It began to be noticeable when there were too many files ( I also included subdirectories ), half a second or so

Since then, I have made a FileSystemWatcher with API and events
I now have only to rebuild when there's been a change in the directory ( or subdirectories)
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform