1.8.0 + 1.9.0: TListView OnColumnClick does not fire lazarus / 31-LCL ---------------------------------------------------------------------- MISV · 2017-12-11 22:58 Not sure yet if this a Carbon specific issue (or old or new issue) - but on my Lazarus 1.8.0 Carbon + Lazarus 1.9.0 TLisView OnColumnClick does not fire when clicking headers - even with ColumnClick property is set to true. Can anyone else reproduce this / recognize it and know how to solve it? I will submit as bug if anyone else maybe can confirm the issue. It is kinda sad since TListView in version 1.9 has implemented support for CustomSort... ---------------------------------------------------------------------- MISV · 2018-02-05 00:41 Bump (Sorry but just tested in version 1.9 trunk and problem persists) I have tried to set breakpoints in TCustomListView.ColClick which do not fire To make sure I am testing correctly I even deleted comctrls.pp and inserted a call to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Hide; a beginning of ColClick ... But it simply does not fire Is this a Carbon problem or general problem? ---------------------------------------------------------------------- jamie · 2018-02-05 01:26 You can implement the message handler for the "WM_NOTIFY" it could also be LM_NOTIFY  test to see if you are receiving a LVN_COLUMNCLICK inside the WM_NOTIFY message  its very possible it is not implemented. ---------------------------------------------------------------------- MISV · 2018-02-05 02:09 TCustomListView.CNNotify seems to implement LVN_ColumnClick - but well... Does not fire. That would make it a Carbon issue - right? (i.e. whatever Carbon implementation details - it does not send such a message to the LCL system) ---------------------------------------------------------------------- jamie · 2018-02-05 02:55 Yes, that would sound plausible ---------------------------------------------------------------------- MISV · 2018-02-05 11:25 Bugger Seems I may be out of luck then... Gah... need to go into thinking box. I use a listview many places. Will be a mess to replace with virtual tree  - in particular of Cocoa solves this when it arrives Contemplating if something one could add to Carbon or if maybe there is a reason it is no triggering (some setting or similar - I do have ColumnClick True though) ---------------------------------------------------------------------- MISV · 2018-02-05 14:04 If someone has an idea - please shoot though. My experiments using Cocoa early has failed so for time being I will be forced to Carbon. I am trying to see if somehow other things are affecting behavior. ---------------------------------------------------------------------- Phil · 2018-02-05 14:08 Quote from: MISV on February 05, 2018, 03:04:26 pmIf someone has an idea - please shoot though. My experiments using Cocoa early has failed so for time being I will be forced to Carbon. I see a recent bug report on Cocoa widgetset's TListView: https://bugs.freepascal.org/view.php?id=33127 Add your comments to the bug report. Saying them here won't get it fixed. ---------------------------------------------------------------------- MISV · 2018-02-06 00:49 Sorry for all the disturbance. I see it is my own CNNotify that prevented it. In my Delphi version I call inherited for messages I do not handle. But when converting to Lazarus/Mac from Delphi/Windows I could not successfully call inherited (private) and had simply left that part... commented out. Solution: Commenting out my entire CNNotify in Lazarus and everything seems to work. For references for others - here is how to use: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFormExample.MyListViews_ColumnClick_EventHandler(Sender: TObject; Column: TListColumn);var  TmpIndex: Integer;  {$IFDEF mymsFPCDevTool}  TmpCallBackCompare: TLVCompare;  {$ENDIF}begin  if Column.Tag = 0 then    Column.Tag := 1  else    Column.Tag := 0  ;  TListView(Sender).Tag := Column.Tag;  TmpIndex := Column.Index;  //--  {$IFDEF mymsDELPHI}  TListView(Sender).CustomSort(nil, TmpIndex);  {$ENDIF}  {$IFDEF mymsFPCDevTool}  //--  // NOTE: CustomSort added in Lazarus 1.9: https://bugs.freepascal.org/view.php?id=8536  // NOTE: If passing *nil* Lazarus will use *0* as columnidx to oncompare handler no matter what - so we need to set both  //--  TmpCallBackCompare := @imfLView_4Compare_LCL;  TListView(Sender).CustomSort(TmpCallBackCompare, TmpIndex);  {$ENDIF}end;