Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to persist a toolbar
Message
 
To
25/10/2002 19:37:17
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00715677
Message ID:
00715713
Views:
19
>>>I need a way to have a toolbar which would instantiate, set a few settings and hide. Now user will have the command window available. How do I prevent this toolbar from being released when the user issues Clear All? I tried adding it as a property of _screen, and the property stays there - but gets to be .null. when the object is cleared.
>>>
>>>Is there a way for this toolbar to stay there? It does not have to be a toolbar, really, it can be a container, form or anything that can hold a few buttons and have .show() and .hide() methods.
>>
>>Crud. CLEAR ALL still destroys it even if the object ref is a _screen property.
>
>Which is the reason I posted here :). Even with nodefault and return .f. in the release.
>
>I'll resort to some way of having the user restart the toolbar manually, until this gets solved.

Hi Dragan,

I think the cleanest solution would probably be to settle for a custom command for launching this toolbar via the main menu. Main menu changes will persist through a CLEAR ALL, as I recall. I generally would not encourage the routine use of CLEAR ALL, because it's so heavy handed, so my preference is to create custom cleanup logic that is appropriate to each application.

The only trick I can think of offhand that might keep the toolbar alive through a CLEAR ALL would be to create a circular reference of the sort that causes those pesky failures to release an object, but this might be tricky to do, and it could result in some sort of flakiness. You know how it is, things never go wrong the way you'd like them to. That would be a violation of Murphy's Law. I haven't tried it, but you might see what happens if the toolbar stores a reference to itself in a custom property.

Mike
Montage

"Free at last..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform