xBrowse and menu

xBrowse and menu

Postby mgsoft » Fri Mar 20, 2020 1:37 am

Dear Mr. Nages,

Is it possible to show a menu with several options when clicking on a field in a row?

Thank you. Best regards
Saludos,

Eduardo
User avatar
mgsoft
 
Posts: 422
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: xBrowse and menu

Postby nageswaragunupudi » Fri Mar 20, 2020 5:36 am

Code: Select all  Expand view

oBrw:bPopup := { |oCol| MyPopMenuFunction( oCol ) }
 


The "MyPopMenuFunction( oCol )" should return a PopMenu object.
The parameter oCol is the currently selected column.

Right-clicking on any column opens the popup menu just below the current cell..

If you want to implement this only for a specific column then
Code: Select all  Expand view

oCol:bPopup := { |oCol| MyPopMenuFunction( oCol ) }
 


In this case, right-click on that column only activates the popup menu.

For implementation sample, please see \fwh\samples\testxbr3.prg
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse and menu

Postby mgsoft » Tue Mar 24, 2020 7:28 pm

Hi,

And what about bLClicked?

I need to show the menu in this event, but it does not work. The menu does not show up.

If you need, I can build a sample code.

Thank you.
Saludos,

Eduardo
User avatar
mgsoft
 
Posts: 422
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: xBrowse and menu

Postby cnavarro » Tue Mar 24, 2020 8:03 pm

Try with this code

Code: Select all  Expand view

      :bLClicked         := { | nR, nC, nF | MyPopupMnu( oBrw, nR, nC ) }
.../...

//----------------------------------------------------------------------------//

Function MyPopupMnu( o, nRow, nCol )

   local oMnu

   MENU oMnu POPUP

      MENUITEM "Option 1"    ACTION Msginfo( o:oWnd:ClassName() )
      SEPARATOR
      MENUITEM "Exit" RESOURCE "close" ACTION ( o:oWnd:End() )

   ENDMENU
   ACTIVATE MENU oMnu AT nRow, nCol OF o:oWnd

Return oMnu

//----------------------------------------------------------------------------//
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse and menu

Postby nageswaragunupudi » Tue Mar 24, 2020 9:52 pm

My advice works with right-click.

We advise you not to use single click for any action because single click is used for navigation

Right click and popup menu is a standard user interface
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse and menu

Postby ukoenig » Wed Mar 25, 2020 8:47 am

my solution on left mouseclick
using a defined style connected to the cell
( radio, combo, listbox, fieldedit, dateselection ... )

Image

more samples radio and listbox

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xBrowse and menu

Postby mgsoft » Wed Mar 25, 2020 7:25 pm

Thank you Cristóbal, works perfect!!!
Saludos,

Eduardo
User avatar
mgsoft
 
Posts: 422
Joined: Mon Aug 17, 2009 12:18 pm
Location: España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 40 guests