[Mono-bugs] [Bug 429153] New: ListView: WndProc Mouse Events

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 23 09:19:37 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=429153


           Summary: ListView: WndProc Mouse Events
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: johnm at hlaustralia.com.au
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Description of Problem:

To match MS .NET
A derived ListView should have first look at the WM_LBUTTONDOWN, etc messages.


Steps to reproduce the problem:
using System;
using System.Windows.Forms;

public class test
{
   public class TouchListView : ListView
    {
        private const int WM_LBUTTONUP = 0x202;
        private const int WM_LBUTTONDOWN = 0x201;
        private const int WM_LBUTTONDBLCLK = 0x203;


        protected override void WndProc(ref Message m)
        {

            if (m.Msg == WM_LBUTTONDOWN || m.Msg == WM_LBUTTONDBLCLK) 
            {
                        Console.WriteLine("GOT LBUTTONDOWN");
                return;
            }

            if (m.Msg == WM_LBUTTONUP)
            {
                Console.WriteLine("GOT LBUTTONUP");

                int pos = m.LParam.ToInt32();
                //int x = pos & 0xFFFF;
                int x = 0;
                int y = pos / 0x10000;

                //Console.WriteLine(pos.ToString() + " " + x.ToString() + " " +
y.ToString());

                ListViewItem item = this.GetItemAt(x,y);
                if (item != null) 
                    item.Selected = !item.Selected;
                this.Select();
            }
            base.WndProc(ref m);
        }
    }

    static void Main ()
    {
            Form f = new Form ();

            ListView lv = new TouchListView ();
            lv.FullRowSelect = true;
            lv.HideSelection = false;
            lv.Columns.Add("Test",20,HorizontalAlignment.Left);
            lv.View = View.Details;

            lv.BeginUpdate();
            lv.Items.Add("1");
            lv.Items.Add("2");
            lv.Items.Add("3");
            lv.EndUpdate();

            lv.Parent = f;

            Console.WriteLine("Starting");

            Application.Run (f);
    }
}




Actual Results:
Mouse Events are never retrieved.

Expected Results:
Should be able to click each of the list view items without losing selection.

How often does this happen? 
Always

Additional Information:
If there are no items the events are received.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list