Re: OpenAux (view: View; title: Title)

From: [at]} <robert.d.campbell{>
Date: Mon, 26 Feb 2001 13:28:44 +0100 (BST)

I use a variant of the original suggestion that,
while being the most complicated option so far,
should work ok with 0, 1, or more windows open on
each model.

It is Model based rather than File, or Focus, or Title
based. A View based variant would be a simple
modification.

It should be safer than a Title based approach.

The version below is for BlackBox 1.4. A 1.3 version is in module
LibMisc in subsystem Lib on Helmut Zinns collections page.



Regards

Robert Campbell



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.dir.First (); ask := TRUE;
      WHILE w # NIL DO
        w2 := w; w := Windows.dir.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
Received on Mon Feb 26 2001 - 12:28:44 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:44 UTC