----boundary-LibPST-iamunique-298419140_-_-
Content-type: text/plain
> Dev->Compare (F9) aka DevSearch.Compare compares the contents of two text
> views.
>
> Focus and last focus was my impression until today, but the
> Dev/Docu/Search.odc says:
>
> "Perform a textual comparison of the two topmost windows' contents."
>
> I would need the same functionality for an upgrade of NW's M2O, which I took
> under my hood. It would be fine to have the last focus on the DEFINITION
> MODULE and the focus on the IMPLEMENTATION MODULE of some
> Modula-2 program and the perform a translation.
>
> Does anybody have an idea how this can be done ?
>
> regards
> Bernhard Treutwein
> BdT{([at]})nowhere.xy> http://www.lrz.de/~bernhard
Not exactly. But I guess that what you want are the two relevant Views.
If you opened the windows yourself (StdApi.OpenXxx) you already have
access to the Views. Alternatively if you know the window titles you
might be able to do something like the attached routines which scan all
open windows.
Note: this routines are not examples of safety. For Docus see LibMisc on
Helmuts page.
Regards
Robert Campbell
PROCEDURE CloseWindow* (title : Views.Title; askIfDirty : BOOLEAN);
VAR
w, w2 : Windows.Window;
wTitle : Views.Title;
res : INTEGER;
BEGIN
w := Windows.stdDir.First ();
WHILE w # NIL DO
w.GetTitle (wTitle); w2 := w; w := Windows.stdDir.Next (w);
IF wTitle = title THEN
IF askIfDirty & w2.seq.Dirty () THEN
Dialog.GetOK ('Close Dirty window ^0 ?', title, '', '',
{Dialog.yes, Dialog.no, Dialog.cancel}, res);
IF res = Dialog.yes THEN w2.Close
ELSIF res = Dialog.cancel THEN w := NIL END
ELSE
w2.Close
END
END
END
END CloseWindow;
PROCEDURE CloseWindowOn* (model : Models.Model; askIfDirty : BOOLEAN);
VAR
w, w2 : Windows.Window;
wTitle : Views.Title;
res : INTEGER;
ask : BOOLEAN;
BEGIN
IF model # NIL THEN
w := Windows.stdDir.First (); ask := TRUE;
WHILE w # NIL DO
w2 := w; w := Windows.stdDir.Next (w);
IF w2.doc.ThisView ().ThisModel () = model THEN
IF w2.seq.Dirty () THEN
IF askIfDirty THEN
IF ask THEN
w2.GetTitle (wTitle); ask := FALSE;
Dialog.GetOK ('Close Dirty model in window ^0 ?', wTitle, '',
'',
{Dialog.yes, Dialog.no, Dialog.cancel}, res)
END
ELSE
res := Dialog.yes
END;
IF res = Dialog.yes THEN w2.Close
ELSIF res = Dialog.cancel THEN w := NIL END
ELSE
w2.Close
END
END
END
END
END CloseWindowOn;
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-298419140_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFxwYXINCj4gRGV2LT5Db21wYXJlIChGOSkgYWth
IERldlNlYXJjaC5Db21wYXJlIGNvbXBhcmVzIHRoZSBjb250ZW50cyBvZiB0d28gdGV4dFxwYXIN
Cj4gdmlld3MuXHBhcg0KPiBccGFyDQo+IEZvY3VzIGFuZCBsYXN0IGZvY3VzIHdhcyBteSBpbXBy
Z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gbW9kZWwgIFRIRU5ccGFyDQogICAgICAgICAg
SUYgIHcyLnNlcS5EaXJ0eSAoKSAgVEhFTlxwYXINCiAgICAgICAgICAgIElGICBhc2tJZkRpcnR5
ICBUSEVOXHBhcg0KICAgICAgICAgICAgICBJRiAgYXNrICBUSEVOXHBhcg0KICAgICAgICAgICAg
ICAgIHcyLkdldFRpdGxlICh3VGl0bGUpOyAgYXNrICA6PSAgRkFMU0U7XHBhcg0KICAgICAgICAg
ICAgICAgIERpYWxvZy5HZXRPSyAoJ0Nsb3NlIERpcnR5IG1vZGVsIGluIHdpbmRvdyBeMCA/Jywg
d1RpdGxlLCAnJyxccGFyDQonJyxccGFyDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc
e0RpYWxvZy55ZXMsIERpYWxvZy5ubywgRGlhbG9nLmNhbmNlbFx9LCByZXMpXHBhcg0KICAgICAg
ICAgICAgICBFTkRccGFyDQogICAgICAgICAgICBFTFNFXHBhcg0KICAgICAgICAgICAgICByZXMg
IDo9ICBEaWFsb2cueWVzXHBhcg0KICAgICAgICAgICAgRU5EO1xwYXINCiAgICAgICAgICAgIElG
ICAgICByZXMgID0gIERpYWxvZy55ZXMgICAgIFRIRU4gIHcyLkNsb3NlXHBhcg0KICAgICAgICAg
ICAgRUxTSUYgIHJlcyAgPSAgRGlhbG9nLmNhbmNlbCAgVEhFTiAgdyAgOj0gIE5JTCAgRU5EXHBh
cg0KICAgICAgICAgIEVMU0VccGFyDQogICAgICAgICAgICB3Mi5DbG9zZVxwYXINCiAgICAgICAg
ICBFTkRccGFyDQogICAgICAgIEVORFxwYXINCiAgICAgIEVORFxwYXINCiAgICBFTkRccGFyDQog
IEVORCAgQ2xvc2VXaW5kb3dPbjtccGFyDQpccGFyDQpccGFyDQpccGFyDQotLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxwYXINClxwYXINClRvIHVuc3Vic2NyaWJl
IGZyb20gdGhpcyBtYWl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