FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour RClick in ListBox
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
RClick in ListBox
Posted: Mon Oct 10, 2005 10:52 AM

Anybody could give an example to solve the following problem:

I have a ListBox and would like that upon clicking the Right button on any line, that line becomes activated (blue). The idea is to open a PopUp menu to perform some actions on the contens of that line. Until now, I have to Lclik first to select the line and then RClick to open the menu. Surely must be some way to perform both actions at once.

Thanks

Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
RClick in ListBox
Posted: Mon Oct 10, 2005 11:07 AM

Rafael,

Please review my suggestion at the spanish forum.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
RClick in ListBox
Posted: Mon Oct 10, 2005 02:00 PM
Antonio:
Tu sugerencia no parece funcionar. El primer RClick hace que el elemento seleccionado "siga" al cursor del ratón pero no se estabiliza. Aquí está el programa que he utilizado para probarlo (XP Prof + FWH/FWHX 2.6 May/2005), por si lo quieres verificar:

#include "FiveWin.ch"
STATIC oWnd, oLbx, oSay
FUNCTION Main()
LOCAL  cLbx, cTxt := SPACE(10)

DEFINE WINDOW oWnd TITLE "Test bRClicked"
@ 1, 2 SAY oSay VAR cTxt COLOR CLR_BLACK, CLR_WHITE
@ 4, 2 LISTBOX oLbx VAR cLbx ;
       ITEMS {"Uno","Dos","Tres","Cuatro","Cinco","Seis","Siete","Ocho"};
       SIZE 200,100 OF oWnd
oLbx:bRClicked := {|nRow, nCol| Prueba(nRow, nCol)}
ACTIVATE WINDOW oWnd
RETURN NIL

FUNCTION Prueba(nRow, nCol)
oLbx:SendMsg(WM_LBUTTONDOWN, nRow, nCol)
oSay:VarPut(oLbx:VarGet()); oSay:Refresh()
RETURN NIL

Continue the discussion