FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse and menu
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
xBrowse and menu
Posted: Fri Mar 20, 2020 01: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse and menu
Posted: Fri Mar 20, 2020 05:36 AM
Code (fw): Select all Collapse
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 (fw): Select all Collapse
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
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: xBrowse and menu
Posted: Tue Mar 24, 2020 07: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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xBrowse and menu
Posted: Tue Mar 24, 2020 08:03 PM
Try with this code

Code (fw): Select all Collapse
      :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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse and menu
Posted: Tue Mar 24, 2020 09: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: xBrowse and menu
Posted: Wed Mar 25, 2020 08:47 AM
my solution on left mouseclick
using a defined style connected to the cell
( radio, combo, listbox, fieldedit, dateselection ... )



more samples radio and listbox



regards
Uwe :-)
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.
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: xBrowse and menu
Posted: Wed Mar 25, 2020 07:25 PM

Thank you Cristóbal, works perfect!!!

Saludos,



Eduardo

Continue the discussion