-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
increment , decrement with mouse drag #2
Comments
Sounds like an interesting idea but I am not sure I get the details right. I am not sure what you mean by 'how value boxes work in after effects or blend' - I don't know 'after effects' and rarelly use blend. Can you give a specific example or Image screenshot, video to better understand how you would like to increment or decrement via mouse drag? |
in the gif you see me right click and drag up and down to increment/decrement edit: works similar to a endless slider, although you don't see a slider |
I found this CodeProject article about it. It does not seem to be complicated. I would implement this behavior and add the ability to make the RepeatButton invisible so the control will look like in your screenshot. I would not change the mouse cursor as in the referenced article. What do you think about the article - is that what you want? |
yes, i remember the article. but it was from 2007 and in VB. therefore i thought there is maybe a better best practise in 2018/2019 and kept searching for something like that. hiding the repeatButton would be nice and changing the cursor is not nessecary. |
I have translated the VB project to C# to use it as a base of develobment. Just to summarize requirements, we want to:
right? |
I have a first version that works similar to the increment/decrement in blend commited in a seperate Mouse_Inc branch. See additional handling methods below line 310 in AbstractBaseUpDown.xaml.cs. This seems to be a little bit more involved than I originally thought.
Would you know how either of these could be resolved? |
i made a valuebox with mouse control in winforms. it handles the mouse delta movement outside of the box. not sure if this is helpful for wpf. concerning the first issue, would it be possible to distinguish between left and right mouse drag, left click is for edit text portion, right click drag is for increment/decrement... |
The attached code was not so usefull - I guess WPF is not that similar to WinForms after all. But I was able to solve the two problems mentioned above:
The control should now behave exactly like a Blend numeric up/down - you can even hit excape when you are editing to go back to the mouse drag mode. When testing - I have found only one remaining problem - which is that a control on a previously hidden tab (eg Float) does initially not appear to be in mouse over drag mode. It seems like I am missing some kind of initiallization if the control is constructed with Visibility=Hidden because everything works fine on the first page? Or, alternatively, the problem has nothing to do with numeric control and is more a problem of the Tab control (maybe focus is still on a hidden Tab)? Would be good to know a solution to this :-) Anyway, I think its quit good as it is. What do you think? Would you be able to use the demo app to record a small movie as you attached above? I would love to include a demo movie in the GitHub pages :-) |
this looks pretty good. and yes, concerning the tab focus, this is odd. it only switches to the active tab when using one of the debug controls or edit the box manually. but i never used tabs, so no experience here. one could probably catch the tab switch event and force the focus. probably kinda dirty. anyway, this helps me a lot. the whole lib should be promoted since this is a very common thing, people look for in wpf. well, it seems that way, reading all the threads all over the internet. |
I solved the problem with the missing drag mode as well :-) did not think I would but I found at last that I need to schedule the dispatcher in order to loose the initial focus when the visibility on the control changes: A side effect of this is that the control cannot gain initial/default keyboard focus - maybe I add another dependency property to let the user configure whether keyboard focus should be gained or lost by default - that way - everyone has a choice in the matter :-) I'll test a bit more and release to NuGet later this week. Thanks for the recording - I'll add it once this is released. |
Version 2.2 of the library is out now - it supports incrementing/decrementing values with:
supporting 2 different configureable step size dependency properties StepSize and LargeStepSize Thanks again for the suggestion. As far as promoting the project goes - give it a star if you like it - link to it when you see fit - test and report issues - or even contribute a pull request.... thanx |
it would be nice if this library would support numeric controls with mouse drag increment/decrement. similar to how value boxes work in after effects or blend.
so rather than using the mouse wheel, right click into the value box and drag up or down to decrement/ increment.
maybe this is doable ?
could not find any custom control which support that, most just do mouse wheel
keep up the good work
The text was updated successfully, but these errors were encountered: