Re: [BLACKBOX] Opening an embedded form view
----boundary-LibPST-iamunique-132235870_-_-
Content-type: text/plain
Antony,
When I save, unload the module, and then open the form again
I do not see my graph *unless* I explicitly perform an Open
on the pointer I extract from the form by scanning for my type
of view.
The way I get a white background is with the notify procedure
in the redraw. I first draw a rectangle with s=Views.fill and
col=Ports.White and then draw my graph on top of that.
I have a gut feeling that by using Meta I can create a very small
procedure that will allow one to relink an arbitrary view embedded
in a opened form to a view variable. This assumes there is but one
instance of the view type in the form (is it possible to store a 'titled'
view and retrieve it based on its title?)
-Doug
Antony Tersol wrote:
Douglas,
Thanks for initiating this discussion. I have been wondering how to accomplish something similar, but had not taken the time to explore it. Instead I was using a Command Button on a form calling a "Deposit" command from within my module followed by StdCmds.Open"
PROCEDURE Deposit*;
VAR v: View;
BEGIN NEW(v); Views.Deposit(v)
END Deposit;
This opens a document with the view (a graph) embedded. Other controls on the first form modify parameters, and a redraw is invoked by appropriate notify procedures.
I didn't understand how to embed the graph within the initial form, thinking I would have to call a Deposit procedure. Your "Still having problems" post prompted me to try to reproduce your problem. I selected the graph view from the opened document and copied it into the form. I saved the form, closed it and reopened and the graph was still there. Then I unloaded the module and did it again, and the graph was again there. So it is not necessary to call "NEW(v)" to create the graph. Storing the form with the embedded view is sufficient. When the form is opened, the module is loaded, and the view is instantiated. It is not necessary for my module to explicitly allocate a pointer to the view within my module, it is restored by Views.
One question: when I open the graph with the Deposit and Open commands it opens on a white background. On the form it is on a grey background. Something simple to make it white? I'm not seeing the obvious.
Thanks,
Antony
On Sat, Dec 12, 2009 at 7:09 PM, Douglas G. Danforth Received on Sun Dec 13 2009 - 08:17:32 UTC
This archive was generated by hypermail 2.3.0
: Thu Sep 26 2013 - 06:30:39 UTC