open a popup

open a popup

Postby Silvio » Wed Mar 25, 2009 10:05 am

I click on a dialog I must open a popup with a menu
but How I can open it on row,col where I click with the mouse ?
any sample please
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: open a popup

Postby Natter » Wed Mar 25, 2009 10:13 am

MENU oMenu POPUP
MENUITEM "Bla-Bla" ACTION Set_Str(1)
SEPARATOR
MENUITEM "Bla-Bla" ACTION Set_Str(2)
ENDMENU

ACTIVATE POPUP oMenu AT nTop, nLeft OF oDlg
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: open a popup

Postby ukoenig » Wed Mar 25, 2009 10:56 am

Hello Silvio,

For Dialog
Also see FWH-sample : RClick.prg

Code: Select all  Expand view

..
..
oDlg:bRClicked = { | nRow, nCol, nFlags | ShowPopup( oDlg, nRow, nCol ) }

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

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

FUNCTION SHOWPOPUP(oDlg,nRow,nCOL)
local oMenu

MENU oMenu  POPUP
   MENUITEM RESOURCE "Help"
   MENU
      MENUITEM RESOURCE "Help" MESSAGE " Test " ;
      ACTION ( CURSORWAIT(), FUNCTION1(), SYSREFRESH() )
      SEPARATOR
      MENUITEM RESOURCE "Help" MESSAGE " Test" ;
      ACTION ( CURSORWAIT(), FUNCTION2(), SYSREFRESH() )
      SEPARATOR
   ENDMENU
ENDMENU

ACTIVATE POPUP oMenu OF oDlg AT nRow, nCol

RETURN( NIL )

 


For Window
Also see FWH-sample : TestPop.prg, TestPop2.prg

Code: Select all  Expand view

..
..
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON CLICK SHOWPOPUP1(oWnd,nRow,nCOL,hDC)

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

FUNCTION SHOWPOPUP1(oWnd,nRow,nCOL,hDC)
local oMenu

MENU oMenu  POPUP
   MENUITEM RESOURCE "Help"
   MENU
      MENUITEM RESOURCE "Help" MESSAGE " Test " ;
      ACTION ( CURSORWAIT(), FUNCTION1(), SYSREFRESH() )
      SEPARATOR
      MENUITEM RESOURCE "Help" MESSAGE " Test" ;
      ACTION ( CURSORWAIT(), FUNCTION2(), SYSREFRESH() )
      SEPARATOR

   ENDMENU

ENDMENU

ACTIVATE POPUP oMenu1 AT nRow, nCol OF oWnd

RETURN( NIL )

 


Regards
Uwe :lol:
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: open a popup

Postby Silvio » Wed Mar 25, 2009 12:03 pm

sorry
can I isert a combo on this menu or something to select an nItem
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: open a popup

Postby ukoenig » Wed Mar 25, 2009 1:08 pm

Hello Silvio,
a better sample to explain :
a Combo would be a Sub-menue from Main 1

Code: Select all  Expand view

FUNCTION SHOWPOPUP1(oDlg,nRow,nCOL)
local oMenu

MENU oMenu  POPUP
   MENUITEM "&Main" RESOURCE "Help"
   MENU
         MENUITEM oMain1 PROMPT "Main 1" RESOURCE "Help"
         MENU
                MENUITEM oSub1 PROMPT "Sub Main 1a" RESOURCE "Help" MESSAGE " Test 1" ;
                ACTION ( CURSORWAIT(), FUNCTION1(), SYSREFRESH() )
                MENUITEM oSub2 PROMPT "Sub Main 1b" RESOURCE "Help" MESSAGE " Test 2" ;
                ACTION ( CURSORWAIT(), FUNCTION2(), SYSREFRESH() )
                MENUITEM oSub3 PROMPT "Sub Main 1c" RESOURCE "Help" MESSAGE " Test 3" ;
                ACTION ( CURSORWAIT(), FUNCTION3(), SYSREFRESH() )
         ENDMENU
         SEPARATOR
         MENUITEM oMain2 PROMPT "Main 2" RESOURCE "Help" MESSAGE " Test" ;
         ACTION ( CURSORWAIT(), FUNCTION4(), SYSREFRESH() )
         MENUITEM oMain3 PROMPT "Main 3" RESOURCE "Help" MESSAGE " Test" ;
         ACTION ( CURSORWAIT(), FUNCTION5(), SYSREFRESH() )
         MENUITEM oMain4 PROMPT "Main 4" RESOURCE "Help" MESSAGE " Test" ;
         ACTION ( CURSORWAIT(), FUNCTION6(), SYSREFRESH() )
   ENDMENU
ENDMENU

ACTIVATE POPUP oMenu OF oDlg AT nRow, nCol

RETURN( NIL )

 


Regards
Uwe :lol:
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: open a popup

Postby Silvio » Thu Mar 26, 2009 9:29 am

ok this a good idea I must try
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests