----boundary-LibPST-iamunique-1853580352_-_-
Content-type: text/plain
On Thu, 27 Jul 2006, Gérard Meunier wrote answering Robert's question:
> > What I want to do
> > is have a couple of context sensitive specific Commands
> > available in the 'right-click' PopUp Menu when my View
> > selected (or Focussed, but I prefer selected).
> >
> > Can someone advise me how to do this?
Have a look at GrViews and at Menus.odc in the folder Gr\Rsrc
The GrViews implement the popup. Morover, the popup is sensitive
to where in a GrView you press the mouse button. The behavior
is different for the inner plotting area and in the outer axes area.
Execute BrPlotter->New Plotter panel and practice right-clicking
on the embedded GrView. The right-click should popup a menu in the outer
area, but not in the inner area. Use the newest Gr package from my
website, because the one in CPC may be a bit old.
The code which implements this is in the GrViews.odc. Search for
HostMenus.PopuMenu and you will see how it was done.
Gerard's code is another way to do the same.
> 1) Write a popup menu for your view:
>
> MENU "*" ("MyViews.View")
> "#My:Edit" "E" "MyViews.Edit" "MyViews.EditGuard"
> END
>
> 2) Add these lines in the HandleCtrlMsg procedure of your View:
>
> PROCEDURE (v: View) HandleCtrlMsg* (f: Views.Frame; VAR msg:
> Controllers.Message; VAR focus: Views.View);
>
> BEGIN
> WITH
> |msg: Controllers.TrackMsg DO
> IF HostPorts.right IN msg.modifiers THEN
> HostMenus.PopupMenu;
> ELSE
> ...
> END;
> ...
> END;
> END HandleCtrlMsg;
>
> To open the popup menu, the View must be in edit mode (focussed).
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1853580352_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnN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zc2FnZTsgVkFSIGZvY3VzOiBWaWV3cy5WaWV3KTtccGFy
DQo+XHBhcg0KPiAgICAgICAgIEJFR0lOXHBhcg0KPiAgICAgICAgICAgICBXSVRIXHBhcg0KPiAg
ICAgICAgICAgICAgICAgfG1zZzogQ29udHJvbGxlcnMuVHJhY2tNc2cgRE9ccGFyDQo+ICAgICAg
ICAgICAgICAgICAgICAgSUYgSG9zdFBvcnRzLnJpZ2h0IElOIG1zZy5tb2RpZmllcnMgVEhFTlxw
YXINCj4gICAgICAgICAgICAgICAgICAgICAgICAgSG9zdE1lbnVzLlBvcHVwTWVudTtccGFyDQo+
ICAgICAgICAgICAgICAgICAgICAgRUxTRVxwYXINCj4gICAgICAgICAgICAgICAgICAgICAgICAu
Li5ccGFyDQo+ICAgICAgICAgICAgICAgICAgICAgRU5EO1xwYXINCj4gICAgICAgICAgICAgICAg
IC4uLlxwYXINCj4gICAgICAgICAgICAgRU5EO1xwYXINCj4gICAgICAgICBFTkQgSGFuZGxlQ3Ry
bE1zZztccGFyDQo+XHBhcg0KPiBUbyBvcGVuIHRoZSBwb3B1cCBtZW51LCB0aGUgVmlldyBtdXN0
IGJlIGluIGVkaXQgbW9kZSAoZm9jdXNzZWQpLlxwYXINClxwYXINCi0tLSBCbGFja0JveFxwYXIN
Ci0tLSBzZW5kIHN1YmplY3QgSEVMUCBvciBVTlNVQlNDUklCRSB0byBibGFja2JveEBvYmVyb24u
Y2hccGFyDQpccGFyDQp9
----boundary-LibPST-iamunique-1853580352_-_---
Received on Thu Jul 27 2006 - 18:06:01 UTC