CListCtrl (MFC) converts MouseWheel event into "selected item changed" notification - windows

When trying to implement the handling of SHIFT+MouseWheel events for a CListCtrl to scroll horizontally, I was surprised, that on SHIFT+MouseWheel_UP the CListCtrl item under the mouse cursor got selected, that the selection changed.
The WM_MOUSEWHEEL message turned into a LVN_ITEMCHANGED notification.
I tried to reproduce the behavior in a smaller C++ project and yes - SHIFT+MouseWheel_UP selected the item in the CListCtrl right undr the mouse cursor.
Does anybody knows this behavior or reasons for this behavior?
May eventually a style or an extended style influence this behavior?
Thanks in advance!

Related

Ignore events from children of a ScrollViewer while scrolling

Alright here is my issue. I have a Pivot view. Inside that pivot view a scroll viewer containing many stack panels and grids. On some of the grids I have MouseButton Up Events. What is happening is if I flick the scroll it scrolls as expected but when I release my finger most of the time it fires off the event from mousebutton up. Because technically I let up. The problem is these grids completely fill the screen so finding an area without a mousebutton up to scroll is near impossible. What I want to happen is if the user flicked to scroll I would ideally like it to ignore the mousebutton up event. It does this successfully sometimes but pretty rarely and I have noticed I have to flick pretty fast for it to work as expected.
Any ideas on how to prevent this activity. I assume there is as Listboxes work perfect.
i think u should use windows phone toolkit GestureListener to recognize flick event
I ended up setting a bool for when the scrollviewer was scrolling and based on that allowing the mouseup action to run my code. Here is the the site I used to implement the bool based on scrolling status.
http://blogs.msdn.com/b/ptorr/archive/2010/07/23/how-to-detect-when-a-list-is-scrolling-or-not.aspx

NSMenuItem with NSVIew and Key/Mouse Events

I'm using a NSView within a NSMenuItem to allow me to change the padding and menu item height.
Unfortunately the view eats up the scroll wheel and key down/up events as describe in the documentation. However, there doesn't seem to be a way to pass these events back to the menu so it works like before where Key up/down would change the highlight selection, and the mouse wheel would scroll the list if it is too long. Has anyone come across a solution?
Edit:
This is not the same as the duplicate. I can already get the mouse up/down events for the custom view. My problem is that I have no way to pass these events back to the menu to do what it used to do.
For example how do I get the menu to scroll when the menu gets to long in response to a mouse scroll event?
How do I select and highlight the next item on the list in response to a Key Down event. Passing the event to the menu (or any of its superview/window) doesn't do anything, and there are no functions to do something similar that I can see/

Detect mouse right ckick on combobox

How to detect a mouse click (or mousedown) event on a simple dropdown combo (combobox with style=1)?
I am unable to see mouseclick or mousedown event handlers for combobox in my vb6 IDE.
My aim is to detect right click.
Thanks in advance.
If the events aren't exposed, you may need to subclass the control and handle the WM_RBUTTONDOWN message.

How does the Outlook app delete checkbox UI xaml code work?

If you tap on the left hand side of the screen in Outlook then an event is triggered (in this case a checkbox appears).
I would like to know the xaml on how this is achieved. It cannot be a simple "MouseLeftButtonUp" event because if you drag your finger more than a few pixels then the event does not trigger.
In my own app I am trying to get an icon appear within a listbox that has a SelectionChanged event. The issue is that if you do not touch the small icon precisely then you are triggering the listbox event rather than the event I want to occur when pressing the image.
I think I need to wrap my image in a Canvas but then am still stuck as to what the event should be.
How do you increase the target size of the area where a user can click on your element?
What event should an image have when within a listbox (which is within a pivot) that has a SelectionChanged event? (MouseLeftButtonUp causes issues if you half drag to the next pivot and lift your finger - it triggers the MouseLeftButtonUp event)
I implemented something very similar to that behavior by making an itemtemplate where the checkbox was pushed offscreen to the left by using a negative margin.
I then created 2 visual states, one for Open and Closed. The open state set the margin to 0, bringing the checkbox back onscreen. Closed state had the negative margin.
With the fluidmove behavior, switching between states on button press was EASY. The only thing you'd have to add would be an invisible button/touch area on the left that would also trigger "opening" the checkbox column (changing state to reset the margins).
Hope that helps...
The outlook app is a native app, so it probably isn't using xaml at all.
If you're worried about the mouse events, then you should look at the gesture stuff in the silverlight toolkit, it contains tap, etc events that make a little more sense on the phone.
Increasing the target size and generally making stuff touchable: wrap it in a Button, then alter the ControlTemplate for the Button to remove the border.
If you look at the ControlTemplate for a Button, (Expression Blend, Edit Template, Edit a copy) you'll see the mechanics of the touch area. It's nothing more than padding/margin.
Thus, you can't bleed your touch region out without altering the layout and affecting other items around the control. I'd do two things:
First, I'd think about whether my whole control should be larger in the first place with good spacing around it. Is my design right?
Second, I'd cheat. I'd float a fixed sized button with no border over the area using the Translate transformation to move it around freely.
Good luck,
Luke

textbox focus jumps to above dropdown list when clicked into

Ive never seen this.
I click into my textbox to type in a value and as soon as i release the mouse button focus jumps to the above dropdown list. No javascript on these items.
If i hold the mouse button down i can type in a value to the textbox.
Any idea?
I had my textbox inside the label tag by mistake - this was the reason the focus jumped for me
Someone might be catching the mouseup event.
Event handling differs across browsers which might explain why it happens in all browsers except IE7.

Resources