• Right mouse click on tbrowse header

    From CV@21:1/5 to All on Mon Jan 31 08:04:06 2022
    Hi all

    I'm trying to use right mouse click over the titles/headers, in a tbrowse.
    The thing is detecting programatically, based on the data tbrowse object has, where the user clicks the mouse.

    I used this to detect the mouse click (includes keyboard press):

    nkey := inkey(0.1, INKEY_ALL-INKEY_MOVE)
    ...
    Case nKey = K_RBUTTONUP // right button over tbrowse area (object B)

    wRowX := mrow()
    wColY := mcol()

    do case
    case rango(wRowX, b:ntop+1, b:nbottom) .and. ;
    rango(wColY, b:nleft, b:nright)
    // do something while in data area
    ContextMenu(b)

    case rango(wRowX, maxrow()-1, maxrow())
    // if at bottom 2 lines, show the meaning of f-keys F1 to F12
    Show_FKeys(b)

    // this is the problematic one:
    case b:mrowpos < 0 .and. rango(wColY, b:nleft, b:nright)
    // header area -- fails if the click is outside of the tbrowse area
    alert('I'm in the header zone ',,,3)

    endcase
    ...

    The thing is how to recognize programatically (using the information provided in the tbrowse object, b), that the right mouse click was fired in the column headers area.
    I couldn't do it in a safe way, because b:mrowpos behaves erratically, specially when I click outside of the tbrowse area.

    If anyone has a clue, it is welcome.

    Regards
    --
    Claudio Voskian
    Buenos Aires - Argentina

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)