1. RE: Win32LIB V0.57.4 LV onClick

Tony Steward wrote:
> Hi all,
> Found my bug in listviews using old winlib and am now looking at new 
> winlib and found that not many changes were needed at all but for 
> somereason my program does not seem to respond/trigger the onClick 
> routine with the new version.
> 
> Any ideas why this might be? The changes that I found i had to make were 
> 
> not in this routine and would not be the cause.
>
> BTW I wish the docs for the LV procedures/functions in the new winlib 
> were a little more detailed. Sorry for nit picking its a great 
> programing tool and without it I probably wouldn't bother.

Tony,
I'm flying home to Melbourne tonight and so I'll look into this over the 
weekend. Can't do it tonight 'cos I'm going to watch the Blues down the 
Bombers blink
---------
Derek.

new topic     » topic index » view message » categorize

2. RE: Win32LIB V0.57.4 LV onClick

> -----Original Message-----
> From: Derek Parnell [mailto:ddparnell at bigpond.com]

> 
> The Click is usually detected by the library when a LeftDown 
> and a LeftUp
> event occur in roughly the same screen location at roughly 
> the same time.
> However, for ListViews, the LeftDown is detected but there is 
> no matching
> LeftUp. I suspect that the ListView control traps it. If you 
> really need
> one, I'll try to work out how to do it.

Looks like listviews do send NM_CLICK notifications:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/commctls/listview/notifications/nm_click_listview.asp

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

3. RE: Win32LIB V0.57.4 LV onClick

> -----Original Message-----
> From: Matthew Lewis [mailto:matthewwalkerlewis at YAHOO.COM]
> 
> Looks like listviews do send NM_CLICK notifications:

In fact, looks like I posted this last year :)

From: Matthew Lewis <matthewwalkerlewis at YAHOO.COM>
Subject: RE: weird listview behavior

>   And BTW, listview seems to not have the onClick event.  I thought
> listview is like listbox except it has columns.  Listbox has
> the onClick
> event; why not also listview?

Listviews handle mouse events a little differently (apparently).  You need
to add:
function fDoNM_CLICK(integer id, atom hWnd, atom wParam, atom lParam) 
    hWnd = fetch( lParam, NMHDR_hwndFrom )
    id = getId( hWnd )
    invokeHandler( id, w32HClick, {} )
    return {}
end function

...and make sure you also modify:

constant kNotifications =
         {
      TCN_SELCHANGE
   ,  LVN_COLUMNCLICK
   ,  LVN_GETDISPINFO
   ,  LVN_BEGINDRAG
   ,  TVN_GETDISPINFO
   ,  TVN_SELCHANGED
   ,  TVN_DELETEITEM
   ,  TTN_GETDISPINFO
   ,  MCN_SELCHANGE
   ,  TBN_GETBUTTONINFO
   ,  TBN_QUERYINSERT
   ,  TBN_QUERYDELETE
   -- added NM_CLICK
   ,  NM_CLICK
         }

constant kNotifyHandlers =
         {
      routine_id("fDoTCN_SELCHANGE")
   ,  routine_id("fDoLVN_COLUMNCLICK")
   ,  routine_id("fDoLVN_GETDISPINFO")
   ,  routine_id("fDoLVN_BEGINDRAG")
   ,  routine_id("fDoTVN_GETDISPINFO")
   ,  routine_id("fDoTVN_SELCHANGED")
   ,  routine_id("fDoTVN_DELETEITEM")
   ,  routine_id("fDoTTN_GETDISPINFO")
   ,  routine_id("fDoMCN_SELCHANGE")
   ,  routine_id("fDoTBN_GETBUTTONINFO")
   ,  routine_id("fDoTBN_QUERYINSERT")
   ,  routine_id("fDoTBN_QUERYDELETE")
   -- added fDoNM_CLICK  Matt Lewis
   ,  routine_id("fDoNM_CLICK")

It doesn't look like NM_CLICK is defined in the latest version, but I don't
have the value handy at the moment...
 
Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

4. RE: Win32LIB V0.57.4 LV onClick

Derek Parnell wrote:
> ----- Original Message -----
> From: "Tony Steward" <tony at locksdownunder.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Thursday, May 09, 2002 5:52 PM
> Subject: Win32LIB V0.57.4 LV onClick
> 
> 
> > Hi all,
> > Found my bug in listviews using old winlib and am now looking at new
> > winlib and found that not many changes were needed at all but for
> > somereason my program does not seem to respond/trigger the onClick
> > routine with the new version.
> >
> > Any ideas why this might be? The changes that I found i had to make were
> > not in this routine and would not be the cause.
> 
> I've done some checking with earlier versions of win32lib and none have 
> ever
> supported an onClick event for ListViews. There is an onChange event, 
> but
> never has been an onClick event. Am I understanding your problem 
> correctly?
> 
> I've coded a trap for the LVM_ITEMACTIVATE message but that only seems 
> to
> fire for a double-click.
> 
> The Click is usually detected by the library when a LeftDown and a 
> LeftUp
> event occur in roughly the same screen location at roughly the same 
> time.
> However, for ListViews, the LeftDown is detected but there is no 
> matching
> LeftUp. I suspect that the ListView control traps it. If you really need
> one, I'll try to work out how to do it.
> 
> 
> > BTW I wish the docs for the LV procedures/functions in the new winlib
> > were a little more detailed. Sorry for nit picking its a great
> > programing tool and without it I probably wouldn't bother.
> 
> Me too. I'm doing a little bit at a time. Please be patient with me.
> -----------
> Derek.
> 
> 
Hi Derek,
Of corse I'll be patient, WIN32LIB allows me to do things I'd never be 
capable of doing.

My program has the following procedure then works fine with win32lib 
0.55.? but for some reason won't even trigger if I use the new win32lib.

procedure PersLV_onClick ()
    sequence listdata
    integer recnum

    PersSelected = getLVSelected(PersLV)
    eraseItems(PersKeysHeldLV)
    PersKeysHeldLVID = {}
    if length(PersSelected) then
        PersKey = getLVItemText(PersLV, PersSelected[1], 1)
        SelectTable("Personnel")
        recnum = db_find_key(PersKey)
        if recnum < 1 then
            setText(SBar, "Could not find data for " & PersKey)
        else
            PersData = db_record_data(recnum)
            SelectTable("ComKey")
            if length(PersData[1]) > 0 then
                for key = 1 to length(PersData[1]) do
                    recnum = db_find_key(getNameA(PersData[1][key]))
                    if recnum < 1 then
                        setText(SBar, "Couldn find key " & 
PersData[1][key])
                    else
                        ComKeyData = db_record_data(recnum)
                        listdata = {getNameA(PersData[1][key]), 
getIssueA(PersData[1][key])}
                        listdata &= {ComKeyData[1]}
                        PersKeysHeldLVID &= addLVItem(PersKeysHeldLV, 0, 
listdata)
                    end if
                end for
                setEnable(PersDeleteButton, False)
            else
                if length(PersSelected) > 1 then
                    setEnable(PersDeleteButton, False)
                else
                    setEnable(PersDeleteButton, True)
                end if
            end if
        end if
        setEnable({PersEditButton, PersIssueButton, PersHistoryButton}, 
True)
    else
        setEnable({PersEditButton, PersDeleteButton, PersIssueButton, 
PersHistoryButton}, False)
    end if
end procedure
onClick[PersLV]=routine_id("PersLV_onClick")

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu