RClick in ListBox

RClick in ListBox

Postby Rafael Clemente » 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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby Antonio Linares » Mon Oct 10, 2005 11:07 am

Rafael,

Please review my suggestion at the spanish forum.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41353
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rafael Clemente » Mon Oct 10, 2005 2: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:

Code: Select all  Expand view
#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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], groiss and 28 guests