My slider sets a flag in ValueChanged and then resets it in TouchUpInside. However, when I touch the handle and slide it all the way to the end of the slider, the TouchUpInside event doesn't get fired (and hence my flag doesn't get reset).
Do I need to handle another UISlider action when I slide the handle to the end of the slider? I tried TouchCancel thinking that maybe it was getting cancelled when my finger moved past the end of the slider bar, but that didn't work.
To solve this, I needed to use the TouchUpOutside action/event.
Related
I'm using NSTrackingArea to define 2 areas in a NSView subclass. Then I'm using mouseEntered/mouseExited to change the cursor to a custom one.
So all works fine when the mouse enters the top tracking area and the custom cursor gets set as expected. All still good when I mouseDown and drag on the top tracking area. But I have another part of the UI that updates when the mouse is dragged and it adds subviews to a view elsewhere on the same window.
As soon as the first subview is added elsewhere, my custom cursor disappears and it reverts back to the arrow cursor. I thought I might be able to force the cursor back to the custom one using cursorUpdate for my view but for some reason it never gets called, even when set as an option in the NSTrackingArea.
Am a bit stumped with this one...
I solved it by overriding cursorUpdate in the window's custom contentView. An empty cursorUpdate method stopped the update from getting passed up the chain and the custom cursor now remains as I've set it.
Is there any way of knowing when a text-box has been clicked on so that this can trigger an event? This may not be the best way to do it but I want to animate the text-box to a different part of the screen when it is clicked and then return to its original position when finished.
If your question related to iOS, Set delegate for the UITextField, and in following delegaqte method, add your code.
- (void)textFieldDidBeginEditing:(UITextField *)textField
Setting delegate
I would like to start a slider action programmatically. So pressing on some text in a NSTextView that displays a slider also automatically starts the mousedown event on the slider so you can drag immediately instead of pressing twice. What approach should i take on this? Should i listen for global mouse events and then manually update the slider position, or can i somehow imitate the systems mouseDown / mouseMoved calls on the NSSlider?
I have a Slider control inside a ScrollView (there are other elements, but those are the pertinent ones). When you "let go" of the slider (OnMouseLeftButtonUp - also works for taps), a network command is sent and the slider is momentarily greyed out. After the slider becomes available again, when I try to drag it, it will not work, and the "let go" event doesn't fire.
I have already tried setting e.Handled to True/False but it seems to do nothing. What would cause a Slider to stop working after it's used one time? -Or- Is there a better event I should be using to detect when the value changes on the slider after the user has let go of it?
Found the problem. You can't use a Toggle Switch (from the Silverlight SDK) with a slider because one takes exclusive control of a GestureListener.
Here's the fix I used, it worked perfectly (near the bottom):
http://social.msdn.microsoft.com/Forums/en-US/wpdevelop/thread/ba8bfef3-44a2-4e63-bded-97013e38772e/
You just have to wrap your sliders in a <Canvas> element and insert some event handlers.
I have a UIView where I use the touchesbegan event, but I realized that once I put my finger on it, the touchesBegan event takes like 1 or 2 seconds to fire. How can I make this happen faster?
thanks!!!
After trying some stuff out, I realized that the delay happens only on custom UIButtons. If I "simulate" a button with a regular UIView subclass I get the correct behaviour.