[PD-dev] click-drag behavior

Hans-Christoph Steiner hans at at.or.at
Thu Sep 15 21:21:47 CEST 2011


One thing that often bugs me when editing is the click-n-drag behavior
of objects.  Here's the outline:

click and release unselected object
--------------------------------
* mouse down selects the object
* mouse up selects the text

click and release selected object
--------------------------------
* mouse down drags the cursor in the text
* mouse up does nothing

click and drag unselected object
--------------------------------

* mouse down moves the object
* mouse up releases the drag and selects the text

click and drag selected object
--------------------------------

* mouse down moves the cursor in the text
* mouse up stops that


I think that a better behavior would be this.  When an unselected object
is click-n-dragged, mouseup doesn't select the text or the object.  Then
you can move an object, then immediately move it again without having to
click to deselect it first.

This can be done with a 'moved' flag.  But I can't really find where to
put it, that code is pretty hard to follow (g_rtext.c, g_text.c, and the
widgetbehavior).  I attached my log of the pd-gui messages of the four
cases above.

.hc


-------------- next part --------------

click and release unselected object
-----------------------
.x8718a18 mouse 181.0 96.0 1 0;
rtext_select
.x8718a18.c itemconfigure .x8718a18.t8719e30 -fill blue
rtext_gettag
.x8718a18.c itemconfigure .x8718a18.t8719e30R -fill blue

.x8718a18 mouseup 181.0 96.0 1;
rtext_activate
pdtk_text_editing .x8718a18 .x8718a18.t8719e30 1
pdtk_text_set .x8718a18.c .x8718a18.t8719e30 {osc~}
.x8718a18.c select from .x8718a18.t8719e30 0
.x8718a18.c select to .x8718a18.t8719e30 3
.x8718a18.c focus ""



click and release selected object
---------------------
.x8718a18 mouse 179.0 95.0 1 0;
rtext_mouse .x8719e30 16 8 RTEXT_DOWN
pdtk_text_set .x8718a18.c .x8718a18.t8719e30 {osc~}
.x8718a18.c select clear
.x8718a18.c icursor .x8718a18.t8719e30 3
.x8718a18.c focus .x8718a18.t8719e30

.x8718a18 mouseup 179.0 95.0 1;



click unselected object and drag
---------------------------------
.x8718a18 mouse 191.0 120.0 1 0;
rtext_select
.x8718a18.c itemconfigure .x8718a18.t8719e30 -fill blue
rtext_gettag
.x8718a18.c itemconfigure .x8718a18.t8719e30R -fill blue

rtext_displace
.x8718a18.c move .x8718a18.t8719e30 0 1
rtext_gettag
.x8718a18.c coords .x8718a18.t8719e30R 172 111 200 111 200 128 172 128 172 111
.x8718a18.c itemconfigure .x8718a18.t8719e30R -dash ""
.x8718a18.c coords .x8718a18.t8719e30o0 172 127 179 128
.x8718a18.c coords .x8718a18.t8719e30i0 172 111 179 112
.x8718a18.c coords .x8718a18.t8719e30i1 193 111 200 112
pdtk_canvas_getscroll .x8718a18.c


.x8718a18 mouseup 195.0 127.0 1;
rtext_activate
pdtk_text_editing .x8718a18 .x8718a18.t8719e30 1
pdtk_text_set .x8718a18.c .x8718a18.t8719e30 {osc~}
.x8718a18.c select from .x8718a18.t8719e30 0
.x8718a18.c select to .x8718a18.t8719e30 3
.x8718a18.c focus ""
rtext_displace
.x8718a18.c move .x8718a18.t8719e30 2 3
rtext_gettag
.x8718a18.c coords .x8718a18.t8719e30R 176 117 204 117 204 134 176 134 176 117
.x8718a18.c itemconfigure .x8718a18.t8719e30R -dash ""
.x8718a18.c coords .x8718a18.t8719e30o0 176 133 183 134
.x8718a18.c coords .x8718a18.t8719e30i0 176 117 183 118
.x8718a18.c coords .x8718a18.t8719e30i1 197 117 204 118
pdtk_canvas_getscroll .x8718a18.c




click selected object and drag
---------------------------------
.x9164a98 mouse 192.0 127.0 1 0;
rtext_mouse .x9165db0 16 7 RTEXT_DOWN
pdtk_text_set .x9164a98.c .x9164a98.t9165db0 {osc~}
.x9164a98.c select clear
.x9164a98.c icursor .x9164a98.t9165db0 3
.x9164a98.c focus .x9164a98.t9165db0

rtext_mouse .x9165db0 14 7 RTEXT_DRAG
pdtk_text_set .x9164a98.c .x9164a98.t9165db0 {osc~}
.x9164a98.c select from .x9164a98.t9165db0 2
.x9164a98.c select to .x9164a98.t9165db0 2
.x9164a98.c focus ""

.x9164a98 mouseup 189.0 127.0 1;




More information about the Pd-dev mailing list