Re: [BLACKBOX] Opening an embedded form view

From: Campbell, Robert (SELEX GALILEO, UK) <robert.d.campbell{([at]})nowhere.xy>
Date: Wed, 9 Dec 2009 10:01:44 -0000

----boundary-LibPST-iamunique-645886697_-_-
Content-type: text/plain

>> Robert,
>> Yes, that is what I want. Your demo works just fine.
>> I have not studied your Plotters.odc so bare with me.
>>
>> Did you create the form programmatically or by hand?
>> If by hand then how did you put your graph into the form?
>>
>> -Doug


Doug

By hand, although it could have been done programmatically.

I pasted a LibPlotters.Plotter (strictly speaking that is a Model, and I
pasted its corresponding View type) into the Form. If you open the file
Lib/Rsrc/paletteEdt.odc you will find it there. BUT it contains no
contents,
so is invisible. If you click into it you will see its outline.

When the Form is loaded the procedure LibPlotters.ShowPaletteEditor is
used. This (small)
procedure is worth reading. It opens the file containing the Form, scans
it to find the Plotter
View, and keeps a copy of a Pointer to it (ie a shallow copy).
Subsequently the Plotter is
filled with relevant graphics elements as required.

How do you paste an arbitrary View into a Form (or other Container)?
With <Ctrl>-C <Ctrl>-V.
First you must select the View with <Ctrl>-<Space>.
But you are having problems selecting a View opened using OpenAux. Such
Views were selectable in BlackBox 1.2,
but this was changed in 1.3.

To solve this problem I have these two lines in my 'Edit' drop down
Menu:

        SEPARATOR
        "Toggle Selectability" "" "WandsToggleSel.Toggle"
"WandsToggleSel.GuardToggle"
        "Select Docu&ment" " " "StdCmds.SelectDocument"
"WandsToggleSel.GuardSelectable"

In use the label "Toggle Selectability" becomes "Enable Document
Selection" or "Disable Document Selection".
I find this a very useful Menu Item!
(Also note the more precise Guard for the Oms Command
"StdCmds.SelectDocument".)

The code is below.

I think that this Module, and its Docu file, are also on the CPC site.


Let me know if any of this helps.


Regards

Robert




MODULE WandsToggleSel; (* Date : 10 November 2004 *)
        (* Author : Robert D Campbell *)
        (* (c) *)

IMPORT Containers, Dialog, Windows;


PROCEDURE GuardToggle* (VAR par : Dialog.Par);
  VAR
    w : Windows.Window;
  BEGIN
    w := Windows.dir.Focus (TRUE);
    IF w = NIL THEN
      par.disabled := TRUE
    ELSE
      IF Containers.noSelection IN w.doc.ThisController ().opts
        THEN par.label := 'Enable Document selection'
        ELSE par.label := 'Disable Document selection' END
    END
  END GuardToggle;


PROCEDURE GuardSelectable* (VAR par : Dialog.Par);
  VAR
    w : Windows.Window;
  BEGIN
    w := Windows.dir.Focus (TRUE);
    par.disabled := (w = NIL)
                    OR (Containers.noSelection IN
w.doc.ThisController ().opts)
  END GuardSelectable;


PROCEDURE Toggle*;
  VAR
    w : Windows.Window;
    c : Containers.Controller;
  BEGIN
    w := Windows.dir.Focus (TRUE);
    IF w # NIL THEN
      c := w.doc.ThisController ();
      IF Containers.noSelection IN c.opts
        THEN c.SetOpts (c.opts - {Containers.noSelection})
        ELSE c.SetOpts (c.opts + {Containers.noSelection}) END
    END
  END Toggle;


END WandsToggleSel.


Q DevDebug.Unload
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-645886697_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjB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XHBhcg0KKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipccGFy
DQpUaGlzIGVtYWlsIGFuZCBhbnkgYXR0YWNobWVudHMgYXJlIGNvbmZpZGVudGlhbCB0byB0aGUg
aW50ZW5kZWRccGFyDQpyZWNpcGllbnQgYW5kIG1heSBhbHNvIGJlIHByaXZpbGVnZWQuIElmIHlv
dSBhcmUgbm90IHRoZSBpbnRlbmRlZFxwYXINCnJlY2lwaWVudCBwbGVhc2UgZGVsZXRlIGl0IGZy
b20geW91ciBzeXN0ZW0gYW5kIG5vdGlmeSB0aGUgc2VuZGVyLlxwYXINCllvdSBzaG91bGQgbm90
IGNvcHkgaXQgb3IgdXNlIGl0IGZvciBhbnkgcHVycG9zZSBub3IgZGlzY2xvc2Ugb3JccGFyDQpk
aXN0cmlidXRlIGl0cyBjb250ZW50cyB0byBhbnkgb3RoZXIgcGVyc29uLlxwYXINCioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVz
c2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJP
Ti5DSH19AACxAAA
----boundary-LibPST-iamunique-645886697_-_---
Received on Wed Dec 09 2009 - 11:01:44 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:39 UTC