[1.3b50] Show dialog when CTRL-dragging in from Library

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

User avatar
Tyren
Giant
Posts: 119
Joined: Tue Feb 10, 2009 12:38 pm
Location: Snohomish, WA

[1.3b50] Show dialog when CTRL-dragging in from Library

Post by Tyren »

So we have the option to show or not show the dialog in the preferences. I find that most of the time I don't want the dialog, but it would be cool if we could wire up a ctrl and drag to show the dialog, regardless of the setting.

Then, when I want the dialog, I just ctrl drag.
Last edited by Tyren on Mon Feb 16, 2009 10:59 am, edited 1 time in total.

User avatar
Tyren
Giant
Posts: 119
Joined: Tue Feb 10, 2009 12:38 pm
Location: Snohomish, WA

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Tyren »

Wow, no one commented on this yet. That means that either no one understands what I'm asking for, or it's such and awesome idea that everyone loves it?! :lol:

Did what I am asking for make sense?

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by jfrazierjr »

Yep... it's probably a good idea...
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Azhrei »

Yep. I had nothing to contribute, however. ;)

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Phergus »

We would have to put in special handling for the Mac users that are confused by multi-button mice. :P

User avatar
syntruth
Giant
Posts: 241
Joined: Mon Aug 18, 2008 7:15 pm
Location: Michigan, USA

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by syntruth »

Phergus wrote:We would have to put in special handling for the Mac users that are confused by multi-button mice. :P
Poppycock! Every one of my mice are mult-button! 'Cept the one built into the macbook. >.> That rarely, if ever, gets used.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Azhrei »

Actually, I'll have to try out my touchpad with the JAR that recognizes the Mac's Command key for menus.

It's always been a problem that I couldn't drag the map because I had to use Control-Button1 but the MapTool seemed to get lost with the Control key or something because afterwards the touchpad never worked correctly. So I always you to just use "T" to jump from token to token (which centers the map) without using the right-click drag...

User avatar
Tyren
Giant
Posts: 119
Joined: Tue Feb 10, 2009 12:38 pm
Location: Snohomish, WA

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Tyren »

So, it seems that Java's Drag/Drop library is weird, and determining if the right mouse button was used isn't easy.

I did an easy fix to make it I use CTRL. So if I hold down CTRL and drag an item to the map, it will show the dialog.

So, err, if I did want to send a patch... how do I do that? Heh.

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Craig »

Tyren wrote:So, it seems that Java's Drag/Drop library is weird, and determining if the right mouse button was used isn't easy.

I did an easy fix to make it I use CTRL. So if I hold down CTRL and drag an item to the map, it will show the dialog.

So, err, if I did want to send a patch... how do I do that? Heh.
Do you mean testing ACTION_COPY or ACTION_MOVE as the user drop action? Because just testing that control is down during a drag event is not portable and I think only works under windows.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: [1.3b50] Show dialog when right-dragging in from Library

Post by Phergus »

Tyren wrote:So, err, if I did want to send a patch... how do I do that? Heh.
If theoretically you wanted to create a patch and had Subclipse installed in Eclipse:

* You would right-click on the MapTool project
* Select Team -> Create Patch
* Choose where/how you want it saved
* Choose recurse into subfolders
* Email patch file to Trevor - see his profile for the forum for address

User avatar
Tyren
Giant
Posts: 119
Joined: Tue Feb 10, 2009 12:38 pm
Location: Snohomish, WA

Re: [1.3b50] Show dialog when CTRL-dragging in from Library

Post by Tyren »

Sweet. I had everything except the "send to Trevor" part. :D

It's a really small change, and I love being able to just show the dialog when I need it. I hope this one makes it into the build.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3b50] Show dialog when CTRL-dragging in from Library

Post by Azhrei »

Tyren wrote:Sweet. I had everything except the "send to Trevor" part. :D

It's a really small change, and I love being able to just show the dialog when I need it. I hope this one makes it into the build.
Did you see Craig's note? Checking for Control is NOT the right way to handle this. It should be handled by the TransferHandler returning TransferHandler.COPY_OR_MOVE from the getSupportedActions().

(Which actually reminds me of how MT does a lot of it's mouse handling, making me think that my Ctrl-Button1 on the Mac touchpad won't be fixed by my Command key patch.)

However, I seem to recall that MT doesn't use the Swing DND stuff...

User avatar
Tyren
Giant
Posts: 119
Joined: Tue Feb 10, 2009 12:38 pm
Location: Snohomish, WA

Re: [1.3b50] Show dialog when CTRL-dragging in from Library

Post by Tyren »

Ah, I see. COPY = LEFT click, MOVE = RIGHT click? I'll try this.

User avatar
Tyren
Giant
Posts: 119
Joined: Tue Feb 10, 2009 12:38 pm
Location: Snohomish, WA

Re: [1.3b50] Show dialog when CTRL-dragging in from Library

Post by Tyren »

So, it looks like the drop is always coming in as "COPY". I assume that when we "start" the drag/drop action we can set the action. But I can't seem to find where we do this. Any help?

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3b50] Show dialog when CTRL-dragging in from Library

Post by Azhrei »

I haven't checked out b51 yet, but it looks like line 102 in ImagePanel.java references ACTION_COPY. That parameter should be the list of valid actions, so change it to ACTION_COPY_OR_MOVE.

With just a quick look, that might be all that's needed.

Post Reply

Return to “Resolved”