Calling it from the Main.prg at startup. Here's a little code prior to that point:

                DO .\menus\main.mpr

                SET MARK OF BAR 3 OF Schedule TO oUtils.lAutoRefresh

                *** mjb 10/11/2011 - set location checkmark
IF VARTYPE(tcNailer) = "C" AND NOT EMPTY(tcNailer) AND lcLocationID<>"LH" THEN
                        lcLocationID = tcNailer
                ENDIF
                oUtils.SetLocation(lcLocationID)

                *** mjb 07/15/2014 - create menu dynamically
                DEFINE POPUP "Location" MARGIN RELATIVE SHADOW COLOR SCHEME 4
                loBiz.GetNailerLocations("curNailerLocations")
                SELECT curNailerLocations
                SCAN
                        liCnt = CNTBAR("Location")
lcCmd = [DEFINE BAR ] + ALLTRIM(STR(liCnt + 1)) + [ OF Location PROMPT "] + ALLTRIM(curNailerLocations.cDescription) + ["]
                        &lcCmd
lcCmd = [ON SELECTION BAR ] + ALLTRIM(STR(liCnt+1)) + [ OF Location oUtils.SetLocation("] + ALLTRIM(curNailerLocations.cLocID) + [")]
                        &lcCmd
                ENDSCAN


On 2014-07-15 22:28, Kurt @ VR-FX wrote:
Where R U calling code from? Maybe that is the problem...

Just a WAG...

-K-

Sent from my iPhone

On Jul 15, 2014, at 10:23 PM, [email protected] wrote:

VFP9SP2

Typically I use static menus, but this time I'm trying to add a menu item and items underneath it at runtime. Here's my attempt to code it:

       DEFINE POPUP "Location" MARGIN RELATIVE SHADOW COLOR SCHEME 4
       loBiz.GetNailerLocations("curNailerLocations")
       SELECT curNailerLocations
       SCAN
           liCnt = CNTBAR("Location")
lcCmd = [DEFINE BAR ] + ALLTRIM(STR(liCnt + 1)) + [ OF Location PROMPT "] + ALLTRIM(curNailerLocations.cDescription) + ["]
           &lcCmd
lcCmd = [ON SELECTION BAR ] + ALLTRIM(STR(liCnt+1)) + [ OF Location oUtils.SetLocation("] + ALLTRIM(curNailerLocations.cLocID) + [")]
           &lcCmd
       ENDSCAN


Sadly, it's not working. What am I doing wrong? You can see I'm using the cursor's contents to dynamically build the menu. I added that MARGIN RELATIVE SHADOW COLOR SCHEME 4 part after looking at a build menu's MPR file.

tia,
--Mike


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to