BBjSysGui::createPopupMenu

Description

In BBj 4.0 and higher, this method creates a BBjPopupMenu from a resource file.

Syntax

Return Value

Method

BBjPopupMenu

createPopupMenu(int resHandle, int popupMenuID)

Parameters

Variable

Description

resHandle

Specifies the handle returned by a call to RESOPEN.

popupMenuID

Specifies the control id of a popup menu contained in the resource referred to by resHandle.

Return Value

Returns a BBjPopupMenu object.

Remarks

When a foreign interpreter invokes this method, an !ERROR=208 Multi Thread results. See Accessing Objects From Different Interpreters.

Example Program (popup.src)

rem ' BBjSysGui::createPopupMenu Example Program (popup.src)

sysgui=unt
open (sysgui)"X0"
let res=resopen("popup.arc")
let res$=resget(res,1,101)
popup! = BBjAPI().getSysGui().createPopupMenu(res,1001)
print (sysgui)'window'(100,100,100,100,"",$00010003$,$00000001$)
print (sysgui)'inpute'(101,10,10,80,25,$$,255,"",1,"","")
print (sysgui)'inputn'(102,10,40,80,25,$$,"-###,###.00",$$,0,0)
print (sysgui)'inputd'(103,10,70,80,25,$0008$,"",$$,jul(0,0,0),jul(0,0,0))
dim event$:tmpl(sysgui)
repeat
    readrecord(sysgui,siz=10)event$
    if event.code$="r" then popup!.show(event.context,event.id,event.x,event.y)
until event.code$="X"
release

Example Resource File (popup.arc)

VERSION "4.0"

WINDOW 101 "Popup Test" 100 100 500 400
BEGIN
    KEYBOARDNAVIGATION
    EVENTMASK 3824158668
    NAME "Form"

    PROGRESSBAR 100, 150, 90, 180, 30
    BEGIN
        CUSTOMTEXT ""
        NAME "BBj Progress Bar"
        POPUPMENUID 1001
    END

    INPUTD 101, "", 150, 150, 90, 25
    BEGIN
        PASSENTER
        PASSTAB
        NAME "BBj InputD"
        CLIENTEDGE
        POPUPMENUID 1001
        HIGHLIGHT
    END

    INPUTE 102, "InputE", 150, 200, 90, 25
    BEGIN
        PADCHARACTER 32
        HIGHLIGHT
        PASSENTER
        PASSTAB
        NAME "InputE"
        CLIENTEDGE
        POPUPMENUID 1001
    END
END

POPUPMENU 1001
BEGIN
    NAME "BBj Popup Menu"
    MENU-ITEM 32027 "Cut"
    BEGIN
        NAME "Cut"
    END
    MENU-ITEM 32028 "Copy"
    BEGIN
        NAME "Copy"
    END
    MENU-ITEM 32029 "Paste"
    BEGIN
        NAME "Paste"
    END
    MENU-ITEM 32030 "Sample"
    BEGIN
        NAME "Sample"
    END
END

 

See Also

BBjAPI

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.