Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thumb drag
Message
De
12/02/2009 14:54:02
 
 
À
12/02/2009 04:10:25
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01380583
Message ID:
01381405
Vues:
35
>>>>Hi Viv,
>>>>
>>>>Try the following:-
>>>>
>>>>public class ThumbFixer : Thumb
>>>>{
>>>>   protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
>>>>   {
>>>>       base.OnMouseLeftButtonDown(e);
>>>>   }
>>>>
>>>>   protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
>>>>   {
>>>>       base.OnMouseLeftButtonUp(e);
>>>>   }
>>>>}
>>>>
>>>
>>>Hi,
>>>Thanks for the suggestion.
>>>I did think of trying something like this but I think the Left button down state has to be maintained.
>>>IAC, I tried it and it doesn't work :-{
>>>NBD - I'll proably use something off the keyboard instead.....
>>>Best,
>>>Viv
>>
>
>Hi John,
>
>>Did you try using PreviewMouseRightButtonDown and PreviewMouseRightButtonUp instead of on? I think that's what I normally do when I'm trying to override default behavior. Don't forget to set handled if you've handled the event.
>
>I'll try this later - but I'm not optimistic. Looking back I don't think my original post was specific enough. I'm handling the Thumb.DragDelta event - and this event only fires then the left button is pressed (and the mouse moves)
>
>>Edit: Are you just trying to do move the thumb along a slider by dragging it? If so the next step would be to capture PreviewMouseMove on the slider. A more normal and easier way of altering drag behavior is to use one of the shift keys to alter the behavior.
>
>The (8) thumbs are in an adorner. There will be several potential different behaviours relating to various transformations. Currently I'm supporting resizing (basic left mouse) scaling (with S key) and Rotate (R key). Skew will be added. This is fine for testing but I'm not sure that it will be intuitive for the user....
>Best,
>Viv

Scaling - Shift Left Click
Rotate - Ctrl Left Click
Skew - Alt Left Click

It's a pretty common mechanic to use the shift keys for this. I think it would be more familiar/discoverable to your users.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform