Re: gEDA-user: [PATCH] Drag without selection in gschem

2011-03-25 Thread Peter Clifton
On Mon, 2011-03-21 at 22:56 +, Peter Clifton wrote:

 I was watching some students using gschem the other week, and noticed
 them struggling to move objects due to the fact they had to select them
 first. I wrote a patch which lets a drag action operate on whatever is
 under the mouse (selected or not).

 The user can override the mechanism and get a normal drag-selection
 box by holding shift when dragging. This also happens if the user drags
 on a blank area of the schematic.

I pushed this to git HEAD - enjoy!

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)


signature.asc
Description: This is a digitally signed message part


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: [PATCH] Drag without selection in gschem

2011-03-22 Thread Peter Clifton
On Tue, 2011-03-22 at 11:48 +1100, Geoff Swan wrote:
 I had a couple of issues with the patch process - I didn't bother
checking which version I should have had (i'm using 1.7.0 20110116) but
went and manually patched it myself.

Its against git HEAD, which I had just previously pushed some clean-up
to.. so it would probably not apply easily against anything else.


Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)


signature.asc
Description: This is a digitally signed message part


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: [PATCH] Drag without selection in gschem

2011-03-21 Thread Peter Clifton
Could someone give this a test and come up with any counter-reasons why
this attached patch is NOT a good idea?  I vaguely recall a similar (or
identical?) idea was discussed on the list recently?

I was watching some students using gschem the other week, and noticed
them struggling to move objects due to the fact they had to select them
first. I wrote a patch which lets a drag action operate on whatever is
under the mouse (selected or not).

The user can override the mechanism and get a normal drag-selection
box by holding shift when dragging. This also happens if the user drags
on a blank area of the schematic.

This seems to work here (in conjunction with some other cleanup I pushed
to git HEAD).

I'd appreciate a second pair of eyes on it though, as I just knocked it
together quickly.

Fwiw.. dragging of selected locked objects _does not_ work.. (never did
as far as my brief skim of the code suggests.). I think we ought to fix
that.

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
From 7f88749446b61493e881ad6aeb0a82f909a8c0d7 Mon Sep 17 00:00:00 2001
From: Peter Clifton pc...@cam.ac.uk
Date: Mon, 21 Mar 2011 22:51:23 +
Subject: [PATCH] gschem: Don't require select to drag objects

This comes from watching users interacting with gschem and their
clear expectations that objects can be dragged around the canvas
without an explicit selection step first.

When a mouse drag starts on non-selected object, starting dragging
that object rather than forming a box selection.
---
 gschem/src/x_event.c |   26 ++
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 67989a1..a6a66eb 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -718,6 +718,7 @@ gint x_event_motion(GtkWidget *widget, GdkEventMotion *event,
   int w_x, w_y;
   int unsnapped_wx, unsnapped_wy;
   int skip_event=0;
+  int do_move;
   GdkEvent *test_event;
 
   exit_if_null(w_current);
@@ -791,20 +792,37 @@ gint x_event_motion(GtkWidget *widget, GdkEventMotion *event,
 break;
 
 case(STARTSELECT):
-if (!o_find_selected_object (w_current,
- w_current-first_wx, w_current-first_wy)) {
+/* Don't move anything if the shift key is pressed, that means
+ * the user definately wants to drag out a selection box.
+ */
+do_move = 0;
+if (!w_current-SHIFTKEY) {
+  /* If there is a selected object under the cursor, start moving it.
+   * If we don't find anything selected, look for an object we could
+   * select to start moving it.
+   */
+  if (o_find_selected_object (w_current, w_current-first_wx, w_current-first_wy) ||
+  (o_find_object (w_current,
+  w_current-first_wx, w_current-first_wy, TRUE) 
+   o_select_selected (w_current)))
+do_move = 1;
+}
+
+if (!do_move) {
+  /* Drag out a selection box */
   if (o_select_box_start(w_current, unsnapped_wx, unsnapped_wy)) {
 w_current-event_state = SBOX;
 w_current-inside_action = 1;
   }
   break;
 } else {
-  /* Start the object movement */
+  /* Start moving the selected object(s) */
   o_move_start(w_current, w_x, w_y);
   w_current-event_state = ENDMOVE;
   w_current-inside_action = 1;
+  /* Fall through bottom of case to finish the move */
 }
-/* Fall through */
+/* Fall through to handle move */
 case(ENDMOVE):
 case(MOVE):
 if (w_current-inside_action)
-- 
1.7.4.1



signature.asc
Description: This is a digitally signed message part


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: [PATCH] Drag without selection in gschem

2011-03-21 Thread Thomas Oldbury
   I'd suggest making it an opt-out for people like me who like it as it
   is, but maybe I'll get used to it.

   On 21 March 2011 22:56, Peter Clifton [1]pc...@cam.ac.uk wrote:

 Could someone give this a test and come up with any counter-reasons
 why
 this attached patch is NOT a good idea?  I vaguely recall a similar
 (or
 identical?) idea was discussed on the list recently?
 I was watching some students using gschem the other week, and
 noticed
 them struggling to move objects due to the fact they had to select
 them
 first. I wrote a patch which lets a drag action operate on whatever
 is
 under the mouse (selected or not).
 The user can override the mechanism and get a normal
 drag-selection
 box by holding shift when dragging. This also happens if the user
 drags
 on a blank area of the schematic.
 This seems to work here (in conjunction with some other cleanup I
 pushed
 to git HEAD).
 I'd appreciate a second pair of eyes on it though, as I just knocked
 it
 together quickly.
 Fwiw.. dragging of selected locked objects _does not_ work.. (never
 did
 as far as my brief skim of the code suggests.). I think we ought to
 fix
 that.
 --
 Peter Clifton
 Electrical Engineering Division,
 Engineering Department,
 University of Cambridge,
 9, JJ Thomson Avenue,
 Cambridge
 CB3 0FA
 Tel: +44 (0)7729 980173 - (No signal in the lab!)
 Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
 ___
 geda-user mailing list
 [2]geda-user@moria.seul.org
 [3]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. mailto:pc...@cam.ac.uk
   2. mailto:geda-user@moria.seul.org
   3. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: [PATCH] Drag without selection in gschem

2011-03-21 Thread Geoff Swan
   I very much like the idea of this patch :)

   I'll have a go at testing it.

   On Tue, Mar 22, 2011 at 10:29 AM, Thomas Oldbury
   [1]toldb...@gmail.com wrote:

   I'd suggest making it an opt-out for people like me who like it as
 it
   is, but maybe I'll get used to it.

 On 21 March 2011 22:56, Peter Clifton [1][2]pc...@cam.ac.uk wrote:
   Could someone give this a test and come up with any counter-reasons
   why
   this attached patch is NOT a good idea?  I vaguely recall a similar
   (or
   identical?) idea was discussed on the list recently?
   I was watching some students using gschem the other week, and
   noticed
   them struggling to move objects due to the fact they had to select
   them
   first. I wrote a patch which lets a drag action operate on whatever
   is
   under the mouse (selected or not).
   The user can override the mechanism and get a normal
   drag-selection
   box by holding shift when dragging. This also happens if the user
   drags
   on a blank area of the schematic.
   This seems to work here (in conjunction with some other cleanup I
   pushed
   to git HEAD).
   I'd appreciate a second pair of eyes on it though, as I just
   knocked
   it
   together quickly.
   Fwiw.. dragging of selected locked objects _does not_ work.. (never
   did
   as far as my brief skim of the code suggests.). I think we ought to
   fix
   that.
   --
   Peter Clifton
   Electrical Engineering Division,
   Engineering Department,
   University of Cambridge,
   9, JJ Thomson Avenue,
   Cambridge
   CB3 0FA
   Tel: [3]+44 (0)7729 980173 - (No signal in the lab!)
   Tel: [4]+44 (0)1223 748328 - (Shared lab phone, ask for me)

 ___
 geda-user mailing list
 [2][5]geda-user@moria.seul.org
 [3][6]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
 References
   1. mailto:[7]pc...@cam.ac.uk
   2. mailto:[8]geda-user@moria.seul.org
   3. [9]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
 ___
 geda-user mailing list
 [10]geda-user@moria.seul.org
 [11]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. mailto:toldb...@gmail.com
   2. mailto:pc...@cam.ac.uk
   3. tel:%2B44%20%280%297729%20980173
   4. tel:%2B44%20%280%291223%20748328
   5. mailto:geda-user@moria.seul.org
   6. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
   7. mailto:pc...@cam.ac.uk
   8. mailto:geda-user@moria.seul.org
   9. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
  10. mailto:geda-user@moria.seul.org
  11. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: [PATCH] Drag without selection in gschem

2011-03-21 Thread Kai-Martin Knaak
Peter Clifton wrote:

 Could someone give this a test and come up with any counter-reasons why
 this attached patch is NOT a good idea?  I vaguely recall a similar (or
 identical?) idea was discussed on the list recently?

I like it. It is another step to gschem/pcb GUI similarity.

---)kaimartin(---
-- 
Kai-Martin Knaak
Email: k...@familieknaak.de
Öffentlicher PGP-Schlüssel:
http://pool.sks-keyservers.net:11371/pks/lookup?search=0x6C0B9F53



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: [PATCH] Drag without selection in gschem

2011-03-21 Thread Geoff Swan
   I had a couple of issues with the patch process - I didn't bother
   checking which version I should have had (i'm using 1.7.0 20110116) but
   went and manually patched it myself.

   BTW - the first hunk worked fine - it was only the second one that
   failed.



   Otherwise it seems great, cheers :)

   On Tue, Mar 22, 2011 at 11:32 AM, Kai-Martin Knaak
   [1]k...@lilalaser.de wrote:

   Peter Clifton wrote:
Could someone give this a test and come up with any counter-reasons
   why
this attached patch is NOT a good idea?  I vaguely recall a similar
   (or
identical?) idea was discussed on the list recently?

 I like it. It is another step to gschem/pcb GUI similarity.
 ---)kaimartin(---
 --
 Kai-Martin Knaak
 Email: [2]k...@familieknaak.de
 Öffentlicher PGP-Schlüssel:
 [3]http://pool.sks-keyservers.net:11371/pks/lookup?search=0x6C0B9F53

   ___
   geda-user mailing list
   [4]geda-user@moria.seul.org
   [5]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. mailto:k...@lilalaser.de
   2. mailto:k...@familieknaak.de
   3. http://pool.sks-keyservers.net:11371/pks/lookup?search=0x6C0B9F53
   4. mailto:geda-user@moria.seul.org
   5. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user