Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Nuclear war can ruin your whole compile." -- Karl Lehenbauer


devel / comp.lang.xharbour / Right mouse click on tbrowse header

SubjectAuthor
o Right mouse click on tbrowse headerCV

1
Right mouse click on tbrowse header

<88aea6a0-ef0f-42bd-92af-e69c4079c0ean@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16944&group=comp.lang.xharbour#16944

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:22d4:: with SMTP id o20mr14103181qki.90.1643645046537;
Mon, 31 Jan 2022 08:04:06 -0800 (PST)
X-Received: by 2002:a05:620a:298e:: with SMTP id r14mr5378909qkp.634.1643645046355;
Mon, 31 Jan 2022 08:04:06 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 31 Jan 2022 08:04:06 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=152.170.233.99; posting-account=PzJOtwoAAAB-nLPGTsEPjzvj-I7nsyBK
NNTP-Posting-Host: 152.170.233.99
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <88aea6a0-ef0f-42bd-92af-e69c4079c0ean@googlegroups.com>
Subject: Right mouse click on tbrowse header
From: cvoskian@gmail.com (CV)
Injection-Date: Mon, 31 Jan 2022 16:04:06 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 40
 by: CV - Mon, 31 Jan 2022 16:04 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor