Re: [BLACKBOX] New document view, different size

From: [at]} <Andrew>
Date: Fri, 21 Aug 2009 15:39:39 +0100


Hello Rainer,
 
  I use the following to open a window of a specified size
 
Andrew
 
StdCoder.Decode ..,, ..bH....3QwdONl9RhOO9vRbf9b8R7fJHPNGomCrlAyIhgs,CbKBhZ

xi2,CoruKu4qouqm8rtuGfa4.hOO9vRb1Y66wb8RTfQ9vQRtIdvPZHWKqtCa.E.U5UoZ.2.5Qw

dONlnayKmKKqCLLCJuGqayKm6F9vQ5nsH3.bnayKmKa2,Cor.kay4.qorGqmQCU2,CJuyKtQC9

8P9PP7ONbXmb.2.gc0k5kS8.,E.EaF.86.QC18RdfQHfMf9R9vQ7ONb1E.kJE.0.x.0..1eQHP

MNHyuv.U.2m,.1.1cUZj0E.s8E.c5E.k.0.,ME..,6YU9U0IkmL,6..EDU.YJ2.A6.U.2Gk0k.

Op.szPM0VeITuE98FfeI986T8Q9fP,78hfC,dJHPNC5sC,7RH9RNPNp761eIZOEn86TeF,tEFO

EZuC,tRN76FfC,NGR8J9uF9eIHtCPM0HcJ1eIPM0HM07fC,7FTvMfPP9fPdvQR7FTvMf1in4ak

2akleHECoruKuUmlVyKrGLtyKqmqm8rRqk28oWSoYuo4ak2GKEenS0GWyql.bHmaKtuGbKqvWG

vmGESLK0WdQbBA,596pND,7NR7JFPObvETfPd168HtCP.RtI99RT8QdvQFtMRtPV9R0mJ0mxGo

rCqu.SrouKYKqoSKoGry0mK0mxGor.6Q1vN99G9POD1PM0H66L76r1.S5jOO79RFPT,N9..V1j

OO79RAZvgV7cJHPNCbD3iZph,his3ZYZZUYidZCGmIqk2KIbGIEyYZtCPcUXDJ9X1xhi,sQRtI

dnVGLtmKWKqtCK.4Te..c950.7ONbvM,kVkk.Um,..Unp3.6F6.Z50.G,0.aU.6.,..1cUXDJc

If9P9fQbf9bWGhigFWE.4Te.sQRdIf9P9HWE.8z,E.0.L3D.53,6.C6.QiiQ8CJuaLqKKWKqt2

Ul1.RVtZBE.8T2E..2,I96.IE.EL4Iu.Ka2V.6,6..UYU.AU.U.UUQoO,,sFnQ.ytrM.M.6.,U

0Ky8.,..e,2.A.c80S45.2UEC.6...gs....

--- end of encoding ---



2009/8/21 Rainer Neubauer <rainer.neubauer{([at]})nowhere.xy


Hi all,
some times ago there was a question on the mailing list how to open a new document window with size and height being different to the standard values. I need this behaviour to display a couple of very short lines of text and to free the user from having to manually shrink down the window size.

A second topic on the list ("updating a text window") showed up how to update the window in order to show the end of text.

So I tried to combine these infos into a little module.

Problem: the window containing some lines of text showes a strange behaviour when being narrowed down manually until the window width is smaller than the length of the lines. In this case an additional blank line appears below every line of text exceeding the window width. Of course these blank lines do not exist and will disappear again when the window width is made large enougth to show the lines of text in full length.

Could anybody please give me a hint how to avoid this behaviour ?
Please find my code below.

Thanks and best regards,
Rainer



MODULE TrialsNewWindow;

       IMPORT Containers, Documents, Ports, TextMappers, Models, TextModels, TextViews, Views;

       VAR
       f: TextMappers.Formatter;
       m: TextModels.Model;
       v: TextViews.View;
       

       PROCEDURE Flush*;
       BEGIN
               Views.RestoreDomain (m.Domain ());
               TextViews.ShowRange (m, m.Length (), m.Length (), TextViews.any)
       END Flush;


       PROCEDURE OpenWindow*;
               VAR
                       d: Documents.Document;
                       c: Containers.Controller;
       BEGIN
               m := TextModels.dir.New ();
               f.ConnectTo (m);
               v := TextViews.dir.New (m);
               d := Documents.dir.New (v, 30 * Ports.mm, 60 * Ports.mm);
               c := d.ThisController ();
               c.SetOpts (c.opts + {Documents.winWidth} - {Documents.pageWidth});
               Views.OpenView (d)
       END OpenWindow;


       PROCEDURE WriteLn*;
       BEGIN
               Models.BeginModification (Models.clean, m);
               f.WriteLn;
               Models.EndModification (Models.clean, m);
               Views.RestoreDomain (m.Domain ());
               TextViews.ShowRange (m, m.Length (), m.Length (), TextViews.any)
       END WriteLn;

       PROCEDURE WriteString* (IN string: ARRAY OF CHAR);
       BEGIN
               Models.BeginModification (Models.clean, m);
               f.WriteString (string);
               Models.EndModification (Models.clean, m);
               Views.RestoreDomain (m.Domain ());
               TextViews.ShowRange (m, m.Length (), m.Length (), TextViews.any)
       END WriteString;

BEGIN
END TrialsNewWindow.


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Fri Aug 21 2009 - 16:39:39 UTC

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