xBrowse and menu

Post Reply
User avatar
mgsoft
Posts: 398
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

xBrowse and menu

Post by mgsoft »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse and menu

Post by nageswaragunupudi »

Code: Select all

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

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
mgsoft
Posts: 398
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: xBrowse and menu

Post by mgsoft »

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
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse and menu

Post by cnavarro »

Try with this code

Code: Select all

      :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

//----------------------------------------------------------------------------//
 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse and menu

Post by nageswaragunupudi »

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
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse and menu

Post by ukoenig »

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
mgsoft
Posts: 398
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: xBrowse and menu

Post by mgsoft »

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

Eduardo
Post Reply