Re: adding text

From: [at]} <Wojtek>
Date: Thu, 28 Aug 2003 12:39:00 -0400 (EDT)

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

Erik:

  please have a look at my Gr package, available from Helmut's website.
It does not do exactly what you want, but I have dealt with a problem of
finding some object in a form. As Doug said, this is the area which was
not documented too well, and guys from Ominc sent me a few hints which
I then used with success. In particular, please look at the procedures:

GrViews.RetrieveFromContainer it shows, how you can iterate over
   a container such as form, retrieve a objects, find one that meets your
   criteria.

GrViews.Focus another demonstration of the same. There are two versions
   of this procedure: the one based on Wolfgang Weck's advice, and a
   folded (inactive) one based on my earlier attempt to understand BB
   documentation.

For your reference, I am reproducing my version of the procedure, which
used to work pretty well. Later on I replaced it with Wolfgang's more
"professional" version.

Please substitute TextView for GrView and you will be done with finding
the TextView in the form. Then of course you need to write into that text.
Here I also have an example how to do it. Please read GrReportDemo
which writes something programmatically into the TextModel.

So, here is how you retrieve something from a Form (or any other
container as well, such as Text):

PROCEDURE Focus* (): View;
        VAR v: Views.View;

PROCEDURE RetrieveFromForm (): View;
VAR
        grv: Views.View;
        ctrl: Containers.Controller;
BEGIN
ctrl := Containers.Focus();
IF (ctrl # NIL) THEN
        ctrl.GetFirstView (Containers.any, grv);
        (* ASSERT (grv # NIL, 21);
           ASSERT fails when Panel on-screen and module
           is unloaded *)
        WHILE grv # NIL DO
                (* The following is GrView-specific*)
                (* substitute with a test of your own*)
                IF (grv IS View) THEN
                        RETURN grv(View)
                        (* return the 1st
                           encountered GrViews.View*)
                ELSE
                         ctrl.GetNextView (Containers.any, grv)
                END
        END; (* WHILE*)
        RETURN NIL
ELSE
        (* did not obtain a valid controller to try *)
        RETURN NIL
END
END RetrieveFromForm;

BEGIN (* Focus *)
v := Controllers.FocusView();
IF (v = NIL) OR ~(v IS View) THEN
        (* maybe the focus is the Form? *)
        v := RetrieveFromForm();
END;
IF (v # NIL) & (v IS View) THEN
        RETURN v(View)
ELSE
        RETURN NIL
END
END Focus;




 > Erik Spaans wrote:
> > Hello BlackBox,
> >
> > A newby question. I have created a form with the forms editor. I want to add
> > a piece of text to the form. This text should be variable, i.e. depending on
> > when and how the form is started it will display different texts.
> >
> > I do not want to use a edit or text field as this appears 'embossed'
> > (dented).
> >
> > I tried using a caption without an associated text field and linking it to a
> > variable in the underlying module, but that did not work. It does not change
> > the caption text. Adding a guard and setting par.label did not work either.
> >
> > Alternatively I created a textview. But how to insert this in the form? And
> > at a specified position? The documentation says that the module does not
> > know anything about the form. Somehow a textobject should be inserted in the
> > form (via the forms editor) and linked to a textview variable in the
> > underlying module. How?
> >
> > Any help is welcome.
> >
> > Erik
> >
>
>
> --------------------------------------------
>
> 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.
>
>
>

--------------------------------------------

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-1752506666_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvb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gImhlbHAiIHRvIHRoZSBhYm92ZSBhZGRyZXNzLlxwYXINClxwYXINClNlbmQg
YW55IHByb2JsZW0gcmVwb3J0cyBvciBxdWVzdGlvbnMgcmVsYXRlZCB0byB0aGlzIGVtYWlsIGxp
c3QgdG8gdGhlIGxpc3Qgb3duZXIgYXRccGFyDQogICBvd25lci1ibGFja2JveEBvYmVyb24uY2hc
cGFyDQpccGFyDQpDdXJyZW50IHBvc3RpbmcgcG9saWN5OlxwYXINClxwYXINCmEpIFRvIHBvc3Qg
eW91IHNob3VsZCB1c2UgdGhlIHNhbWUgYWRkcmVzcyBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmli
ZWQgdG8gdGhlIG1haWxpbmcgbGlzdC4gVGhhdCB3YXksIHRoZSBsaXN0IHNlcnZlciB3aWxsIHJl
Y29nbml6ZSB5b3UgYXMgc3Vic2NyaWJlciBhbmQgZm9yd2FyZCB5b3VyIHBvc3RpbmcgaW1tZWRp
YXRlbHksIHdpdGhvdXQgY3JlYXRpbmcgYW55IG92ZXJoZWFkLlxwYXINClxwYXINCmIpIElmLCBm
b3Igc29tZSByZWFzb24sIHlvdSBjYW5ub3QgcG9zdCBmcm9tIHRoZSBhZGRyZXNzLCBieSB3aGlj
aCB5b3UgYXJlIHN1YnNjcmliZWQsIHlvdXIgbWVzc2FnZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBh
dm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBj
YXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheXMu
XHB9fQDvLhIkkwMQAw==


----boundary-LibPST-iamunique-1752506666_-_---
Received on Thu Aug 28 2003 - 18:39:00 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:05 UTC