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
RClick in ListBox
- Rafael Clemente
- Posts: 365
- Joined: Sat Oct 08, 2005 7:59 pm
- Location: Barcelona, Spain
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Rafael Clemente
- Posts: 365
- Joined: Sat Oct 08, 2005 7:59 pm
- Location: Barcelona, Spain
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:
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:
Code: Select all
#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