Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add changing menu options to distrib'ed exe
Message
From
19/01/2018 10:56:43
 
 
To
19/01/2018 10:18:14
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01657361
Message ID:
01657381
Views:
56
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform