Re: [BLACKBOX] Dragging a control

From: [at]} <Wojtek>
Date: Sun, 24 Jul 2011 11:13:21 -0400

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

Doug,
I do not have time to explore. Just one quick remark. Is it not so that
edit/mask/browser modes are supplied by the container? If your control
never sees certain messages, it cannot respond. So perhaps look at the
container handler to see which messages it passes down the hierarchy in
which mode.

It is just a guess because like I said I have no time to dig further.

W

> W,
> Second comment. My control when in edit mode can indeed be dragged.
> But I don't want those little handles on the control. I need to
> move it
> in either browser mode, or mask mode (is that a contradiction?).
> -Doug
>
>
> On 7/23/2011 9:57 PM, Wojtek Skulski wrote: I created an
> empty form and added a button to it. I can drag it around. Perhaps
> you can have a look at the message handlers of the controls supplied
> with the BB system? W. Folks,
> Here is another problem I am struggling with. I have
> created a simple control that is just a small square. I want to
> drag it around in a form or view. How can I do that? I
> have read the documentation on drag &amp;amp; drop but it is
> obscure to me. I would think that since windows are easily drag
> (repositioned) that doing the same with a control should
> also be easy but I don't see how. Here is my naive attempt that
> knows the control is moused (its color inverts when pressed) but
> does not move. The MoveFrame is my effort to move the
> control. PROCEDURE (v: View) MoveFrame (f: Views.Frame; w,
> h, x, y, rx, ry: INTEGER), NEW; BEGIN (*Keep
> the center of the dragger at tthe mouse position*)
> Controllers.Drop(x-(w DIV 2), y-(h DIV 2), f, x, y, v, TRUE, w, h,
> rx, ry); END MoveFrame; PROCEDURE (v: View)
> HandleCtrlMsg ( f: Views.Frame; VAR msg:
> Controllers.Message; VAR focus: Views.View );
> VAR rx, ry, x, y, w, h, res: INTEGER; modifiers: SET; inside, isDown:
> BOOLEAN; BEGIN WITH msg: Controllers.TrackMsg
> DO (* mouse button was pressed *)
> v.context.GetSize(w, h); f.Input(rx, ry, modifiers,
> isDown); (*(rx,ry) is first click point*)
> f.MarkRect(0, 0, w, h, Ports.fill, Ports.invert, Ports.show); inside
> := TRUE; REPEAT (* mouse tracking loop *)
> f.Input(x, y, modifiers, isDown);
> IF inside # (x >= 0) &amp;amp; (y >= 0) &amp;amp; (x < w)
> &amp;amp; (y < h) THEN (* toggle state *)
> inside := ~inside; f.MarkRect(0, 0, w, h, Ports.fill, Ports.invert,
> inside) END; IF inside THEN
> v.MoveFrame(f, w, h, x, y, rx, ry) END; UNTIL
> ~isDown; IF inside THEN (* mouse was released
> inside the control *) f.MarkRect(0, 0, w, h,
> Ports.fill, Ports.invert, Ports.hide); IF v.link
> # "" THEN Dialog.Call(v.link, "", res) (*
> interpret and execute the string in v.link *)
> END END ELSE (* ignore other
> messages *) END END HandleCtrlMsg; -Doug
> Danforth ---- To unsubscribe, send a message with body "SIGNOFF
> BLACKBOX" to LISTSERV{([at]})nowhere.xy
> 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


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1551482697_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIERvdWcsXHBhcg0KSSBkbyBub3QgaGF2ZSB0aW1l
IHRvIGV4cGxvcmUuIEp1c3Qgb25lIHF1aWNrIHJlbWFyay4gSXMgaXQgbm90IHN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AgICAgICAgIERpYWxvZy5D
YWxsKHYubGluaywgIiIsIHJlcykgICAgKCpccGFyDQo+IGludGVycHJldCBhbmQgICAgZXhlY3V0
ZSB0aGUgc3RyaW5nIGluIHYubGluayAqKVxwYXINCj4gRU5EICAgICAgICAgICAgICAgICAgRU5E
ICAgICAgICAgICAgICBFTFNFICAgICgqIGlnbm9yZSBvdGhlclxwYXINCj4gbWVzc2FnZXMgKikg
ICAgICAgICAgICAgIEVORCAgICAgICAgICBFTkQgSGFuZGxlQ3RybE1zZzsgICAgICAgLURvdWdc
cGFyDQo+IERhbmZvcnRoICAgIC0tLS0gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdp
dGggYm9keSAiU0lHTk9GRlxwYXINCj4gQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJP
Ti5DSCAgICAgICAgICAgICAgICAgLS0tLSBUb1xwYXINCj4gdW5zdWJzY3JpYmUsIHNlbmQgYSBt
ZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG9ccGFyDQo+IExJU1RTRVJWQExJ
U1RTLk9CRVJPTi5DSFxwYXINCj4gIC0tLS0gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdl
IHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG9ccGFyDQo+IExJU1RTRVJWQExJU1RTLk9C
RVJPTi5DSFxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBh
IG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5P
QkVST04ufX0AAAAAAB4A
----boundary-LibPST-iamunique-1551482697_-_---
Received on Sun Jul 24 2011 - 17:13:21 UTC

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