Menu

#5 Entries TListView.OnMouseDown event is not working properly

2.0
closed
None
2016-08-03
2016-07-25
No

Hi Christopher,

Again, I cannot apologise enough for the down poring of issues :-\

You've decided to use the OnMouseDown Event on the Entry list to change the values on the Details pane. Not sure if you're aware that there's a better one: OnSelectItem.

I'm having to click twice on an entry to have it displayed. And, since I only have 2, if I click alternately on one and then the other, sometimes the one I clicked before shows and not the one I've clicked last.

Don't really know what's happening here since OnMouseDown really should be the fisrt one to fire.

Cheers,
Gus

Discussion

  • Gustavo Carreno

    Gustavo Carreno - 2016-07-25

    Hey Christopher,

    Ok, I've went through the code and I found that you had code for all 3 events: OnMouseDown, OnMouseUp and OnSelectItem, all with the same call to ListViewClicked.

    I've de-selected both Mouse Up and Down and used Select Item and it's behaving now.

    Cheers,
    Gus

     
  • Christopher Hawkins

    Hi Gustavo,

    Can you confirm which widget set you're using? Also, is the right click menu correctly selecting entries in ListView1?

    The code for multiple events was added as a workaround to the GTK2 widgetset as it wasn't registering mousepresses correctly.
    There's a discussion on the Lazarus Forum here http://forum.lazarus.freepascal.org/index.php/topic,33435.0.htmlwhere I decided to compile the binaries using Qt rather than GTK

     

    Last edit: Christopher Hawkins 2016-07-25
  • Gustavo Carreno

    Gustavo Carreno - 2016-07-25

    Hi Christopher,

    By default my http://www.getlazarus.org uses GTK2.
    The Popup Menu is firing OK (image attached), but it does not select the item.
    I've read your discussion and I'll try using the Qt Widgets.

    Cheers,
    Gus

     
  • Gustavo Carreno

    Gustavo Carreno - 2016-07-28

    Hey Christopher,

    I've had some time to test this Event choice and recompiled using the QT Widget Set.

    You've left your code with Mouse Down and it doesn't work both on your new LazLockQT_linux64.tar and on the code on SVN[r11].

    Switching to Select Item resolves the issue when I compile it with the QT Widget.
    It also resolves the Right Mouse Click, since it selects the item, updates the data underneath and then the context menu appears. I've only tested Copy Site to clipboard but that works coreectly, copying the correct data to the clipboard.

    Cheers,
    Gus

    P.S.: I'm getting a Division by Zero, sometimes, not all the time, when I start the application I've compiled. Nothing to worry, should just be a quirk of my system. I'll try and find what it is.

     

    Related

    Commit: [r11]

  • Gustavo Carreno

    Gustavo Carreno - 2016-07-28

    Hey Christopher,

    Disregard my last P.S.

    It seems I have a random issue with my QT widgets under Lazarus. I can't replicate the issue with your binary, so I'm assuming it's on my end and you should not worry about it.

    It only shows randomly and after some retries it goes OK.

    Cheers,
    Gus

     
  • Christopher Hawkins

    OnSelectItem has been added back to trunk

     
  • Christopher Hawkins

    • status: open --> closed
     

Log in to post a comment.