- Popup Menus

From: [at]} <Wojtek>
Date: Thu, 27 Jul 2006 15:14:25 -0400 (EDT)

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

I quickly checked my GrViews. Yes, Gerard is right as always.

The constant "MyViews.View" is actually useful in more than place, so in
GrViews I defined a constant, which is indeed not exported.

CONST
  viewTypeName = "GrViews.View";

Then I used it in the following places:


PROCEDURE (v: View) HandlePropMsg- (VAR msg: Properties.Message);
....
        | msg: Properties.TypePref DO
          IF msg.type = viewTypeName THEN msg.view := v END


PROCEDURE (v: View) HandleCtrlMsg* (f: Views.Frame;
....
  WITH msg: Controllers.PollOpsMsg DO
  (* see tutorial 10, View construction, ObxViews4*)
  msg.valid := {Controllers.copy};
  msg.selectable := FALSE; (* TRUE --> Select All will be anabled *)
  msg.type := viewTypeName



.. and finaly, in several places in the procedure GrViews.Focus,
which was kindly suggested to me by Wolfgang Weck.

        PROCEDURE Focus*(): View;

Procedure Focus became a workhorse which retrieves a GrView from
any container. It may be relevant here, because Robert is developing
some sort of a view whose role is to be embedded in a container.

I used Focus in procedures such as GrViews.GetLegends, GrViews.SetLegends,
and many others, whose role is to transfer some data (e.g., legends or
scaling) between an interactor and the embedded view. In such a way I can
have several views embedded in a form or in a text, and I can change
their looks using one common tool dialog. I do not have to close the
dialog when going from one GrView to another.

Focus is the core difference between the GrView and the LibPlotter
"editors" which only work on a given LibPlotter. In that sense,
LibPlotter "editors" are modal, while GrView dialogs are modeless.
It is good to know how the modeless interface was implemented with
Wolfgang's help.

Hope it helps -- W.




On Thu, 27 Jul 2006, Gérard Meunier wrote:

> Sorry, but I forgot one step:
>
> 3) Add also these lines in the HandleCtrlMsg procedure:
>
> WITH
> ...
> |msg: Controllers.PollOpsMsg DO
> msg.type := "MyViews.View";
> ...
> END;
>
> From the docu: The field "type" denotes a context for the focus view.
> This context is used to determine which menus are relevant for the focus
> view. As a convention, a view assigns the type name of its abstract base
> pointer type to type, e.g., "TextViews.View". This convention guarantees
> globally unique context names, since module names are considered
> globally unique. If the view doesn't support any such context, ignore
> this field.
>
> Consequently, there is no need to export "MyViews.View".
>
> Gérard

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



----boundary-LibPST-iamunique-807426509_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBJIHF1aWNrbHkgY2hlY2tlZCBt
eSBHclZpZXdzLiBZZXMsIEdlcmFyZCBpcyByaWdodCBhcyBhbHdheXMuXHBhcg0KXHBhcg0KVGhl
IGNvbnN0YW50ICJNeVZpZXdzLlZpZXciIGlzIGFjdHVhbGx5IHVzZWZ1bCBpbiBtb3JlIHRoYW4g
cGxhY2UsIHNvIGluXHBhcg0KR3JWaWV3cyBJIGRlZmluZWQgYSBjb25zdGFudCwgd2hpY2ggaXMg
aW5kZWVkIG5vdCBleHBvcnRlZC5ccGFyDQpccGFyDQpDT05TVFxwYXINCiAgdmlld1R5cGVOYW1l
ID0gIkdyVmlld3MuVmlldyI7XHBhcg0KXHBhcg0KVGhlbiBJIHVzZWQgaXQgaW4gdGhlIGZvbGxv
d2luZyBwbGFjZXM6XHBhcg0KXHBhcg0KXHBhcg0KUFJPQ0VEVVJFICh2OiBWaWV3KSBIYW5kbGVQ
cm9wTXNnLSAoVkFSIG1zZzogUHJvc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vbiBndWFyYW50ZWVzXHBhcg0KPiBnbG9iYWxseSB1bmlxdWUgY29udGV4dCBuYW1lcywgc2lu
Y2UgbW9kdWxlIG5hbWVzIGFyZSBjb25zaWRlcmVkXHBhcg0KPiBnbG9iYWxseSB1bmlxdWUuIElm
IHRoZSB2aWV3IGRvZXNuJ3Qgc3VwcG9ydCBhbnkgc3VjaCBjb250ZXh0LCBpZ25vcmVccGFyDQo+
IHRoaXMgZmllbGQuXHBhcg0KPlxwYXINCj4gQ29uc2VxdWVudGx5LCB0aGVyZSBpcyBubyBuZWVk
IHRvIGV4cG9ydCAiTXlWaWV3cy5WaWV3Ii5ccGFyDQo+XHBhcg0KPiBHXCdlOXJhcmRccGFyDQpc
cGFyDQotLS0gQmxhY2tCb3hccGFyDQotLS0gc2VuZCBzdWJqZWN0IEhFTFAgb3IgVU5TVUJTQ1JJ
QkUgdG8gYmxhY2tib3hAb2Jlcm9uLmNoXHBhcg0KfX0AbzogPA=


----boundary-LibPST-iamunique-807426509_-_---
Received on Thu Jul 27 2006 - 21:14:25 UTC

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