menu popup at...

menu popup at...

Postby Silvio » Wed Mar 05, 2008 9:31 am

I want to show a popup menu
I made :
Code: Select all  Expand view  RUN

oApp():oGrid:bLDblClick :={|| Disp_Men(oApp():oDlg,90,240)}
....

STAT FUNC Disp_Men(oDlg,nRow,nCol)
   LOCAL oMenu
   MENU oMenu POPUP 2007
   MENUITEM "&Dati Generali  "
ENDMENU
   ACTIVATE POPUP oMenu OF oApp:oDlg AT nRow,nCol
RETURN (NIL)


How I can Make to show this menu on the coordinates where I doubleclick with the mouse ...and not on 90,240 ?
Best Regards, Saludos

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

Popup on Mouse Cors.

Postby ukoenig » Wed Mar 05, 2008 10:28 am

Hello Silvio

here is the code you need for a popup on mouse cors.

Code: Select all  Expand view  RUN

// don't forget !!!

FUNCTION MAIN()
LOCAL oWnd, hDC   ............

DEFINE WINDOW oWnd FROM 0, 0 TO 24, 80
.....
.....
.....
......

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON CLICK SHOWPOPUP(oWnd,nRow,nCOL,hDC,oBrush)


//--   Your menue with Button-Bitmaps --------------//

function SHOWPOPUP(oWnd,nRow,nCOL,hDC,oBrush)

local oMenu1

MENU oMenu1  POPUP
   MENUITEM RESOURCE "P_STAMM"
   MENU
      MENUITEM RESOURCE "Kunden" MESSAGE " ..... " ;
      ACTION ( CURSORWAIT(), Patient(), SYSREFRESH() )
      SEPARATOR
      MENUITEM RESOURCE "Arzt" MESSAGE "....." ;
      ACTION ( CURSORWAIT(), Arzt(), SYSREFRESH() )
      SEPARATOR
      MENUITEM RESOURCE "Kassen" MESSAGE "....." ;
      ACTION ( CURSORWAIT(), Kassen(), SYSREFRESH() )
      SEPARATOR
      MENUITEM RESOURCE "Mitarb" MESSAGE "...." ;
      ACTION ( CURSORWAIT(), Mitarbeit1(), SYSREFRESH() )
......
......

ENDMENU

ACTIVATE POPUP oMenu1 AT nRow, nCol OF oWnd

RETURN( NIL )



Regards
Uwe
[/code]
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

Postby Silvio » Wed Mar 05, 2008 11:19 am

SORRY,
BUT PERHAPS YOU NOT UNDERSTAND THE QUESTION !!!!!!!!!!


on your code there 's not nrow and ncol variables !!
Best Regards, Saludos

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

Popup-Position nRow, nCol

Postby ukoenig » Wed Mar 05, 2008 12:12 pm

Hello Silvio,

nRow and nCol are not defined, because they come from
the MouseClick-Position inside of a Window or Dialog
where to open the Popup.

Image

Regards
Uwe :lol: [/img]
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

Postby Silvio » Thu Mar 06, 2008 12:39 pm

I not must show a popup into a dialog
BUT I must show a popup into grid ( xbrowse) when I click a record



if not set nrow and ncol

it make error
see here :
--------------------------------------------------------------

Application
===========
Path and name: C:\work\prg\VDSWIN\VdsWin.Exe (32 bits)
Size: 2,620,928 bytes
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 06/03/2008, 13:46:07
Error description: Error BASE/1003 Variable does not exist: NROW

Stack Calls
===========
Called from: ASS510.prg => (b)CAW510(199)
Called from: WINDOW.PRG => TCONTROL:LDBLCLICK(0)
Called from: XBROWSE.PRG => TXBROWSE:LDBLCLICK(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TXBROWSE:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
Called from: main.prg => TAPPLICATION:ACTIVATE(267)
Called from: main.prg => MAIN(55)
--------------------------------------------------------------



I found now the solution !!!!
oApp():oGrid:bLDblClick :={|| Disp_Men(oApp():oDlg,90,240)}
ACTIVATE POPUP oMenu OF oDlg AT oBrw:nTop+nRow, oBrw:nLeft+nCol+4

bt it not is the good solution
Best Regards, Saludos

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

Popup in xBrowse

Postby ukoenig » Thu Mar 06, 2008 1:25 pm

Hello Silvio

I'm just busy, to do a nice xBrowse-sample.
( based of a sample from Mr. Linares )
Today, it will be in the forum.
There will some nice buttons as well
for download.

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Popup with Bitmaps in xBrowse

Postby ukoenig » Thu Mar 06, 2008 5:04 pm

Hello Silvio
Here is the promised source

Image

Button download : http://www.pflegeplus.com/pictures/buttons1.zip

Code: Select all  Expand view  RUN

// Popup with Bitmaps in xBrowse

oBrw := TXBrowse():New( oDlg )

oBrw:nMarqueeStyle      := MARQSTYLE_HIGHLROW
oBrw:nColDividerStyle      := LINESTYLE_BLACK
oBrw:nRowDividerStyle   := LINESTYLE_BLACK
oBrw:lColDividerComplete   := .t.
oBrw:nHeaderLines      := 1
oBrw:nDataLines         := 1
oBrw:lAllowColSwapping      := .t.
oBrw:SetRDD()

...........
...........
// cAlias1 = Alias of your Database
// cAlias2 = possible, to copy to database 2 with same fields
// otherwise cAlias2 = cAlias1

oBrw:bRClicked := {|nRow,nCol| BRPopup( nRow,nCol,oBrw,cAlias1,cAlias1) }    // = Poppup
   
...........
...........

oBrw:CreateFromResource( 110 )

..........

RETURN( NIL )

// ---------   Use your own NET-Functions ----------------------

FUNCTION BRPopup(nRow,nCol,oBrw,cAlias1,cAlias2)
LOCAL oMenu

MENU oMenu POPUP
        // New
   MENUITEM RESOURCE "BUTT_1" ACTION NET_APPEND()
        // Delete
   MENUITEM RESOURCE "BUTT_2" ACTION IIF( (cAlias1)->(DELETED()), NIL, NET_DELETE() ) 
        // Recall
   MENUITEM RESOURCE "BUTT_3" ACTION NET_RECALL()
        // Copy
   // cAlias1 = Alias of your database,   cAlias2 = mabe copy to another Database
   // otherwise same database  => cAlias2 = cAlias1
        MENUITEM RESOURCE "BUTT_4" ACTION NET_COPY(cAlias1,cAlias1) 
ENDMENU

oBrw:Refresh()

ACTIVATE POPUP oMenu WINDOW oBrw AT nRow, nCol

RETURN( NIL )

//----------- Record-Copy ---------------------------------------------//

FUNCTION NET_COPY ( cArea1, cArea2 )
LOCAL FX, DATEN := {}, RECNO := RECNO()

// Possible to copy to another database
// otherwise nArea1 = nArea2

lReturn := .T.

DBSELECTAREA(cArea1)
FOR FX := 1 TO FCOUNT()      // Fields --> Arrray
   AADD(DATEN, FIELDGET(FX))
NEXT

DBSELECTAREA(cArea2)
IF NET_APPEND()
     RECNO := RECNO()
ELSE
     lReturn := .F.
ENDIF

IF lReturn = .T.
   DBSELECTAREA(cArea2)
   NET_RLOCK()
   FOR FX := 1 TO FCOUNT()      // Array --> Fields
      FIELDPUT(FX, DATEN[FX])
   NEXT
   NET_ULOCK()
ELSE
   MsgAlert ( "Copy of Record not possible !!!", "ATTENTION !")
ENDIF

DBSELECTAREA(cArea1)
GOTO RECNO

RETURN lReturn



Regards
Uwe :lol: [/img][/code]
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


Return to FiveWin for Harbour/xHarbour

Who is online

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