Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
ShowWindow = 2
DoCreate = .T.
AutoCenter = .T.
Caption = "Pictures in menu"
ZoomBox = .F.
Name = "Form1"
PROCEDURE createmenu
LPARAMETERS oFormRef, getMenuName, lUniquePopups, parm4, parm5, parm6, parm7, parm8, parm9
LOCAL cMenuName, nTotPops, a_menupops, cTypeParm2, cSaveFormName
IF TYPE("m.oFormRef") # "O" OR ;
LOWER(m.oFormRef.BaseClass) # 'form' OR ;
m.oFormRef.ShowWindow # 2
MESSAGEBOX([This menu can only be called from a Top-Level form. Ensure that your form's ShowWindow property is set to 2. Read the header section of the menu's MPR file for more details.])
RETURN
ENDIF
m.cTypeParm2 = TYPE("m.getMenuName")
m.cMenuName = SYS(2015)
m.cSaveFormName = m.oFormRef.Name
IF m.cTypeParm2 = "C" OR (m.cTypeParm2 = "L" AND m.getMenuName)
m.oFormRef.Name = m.cMenuName
ENDIF
IF m.cTypeParm2 = "C" AND !EMPTY(m.getMenuName)
m.cMenuName = m.getMenuName
ENDIF
DIMENSION a_menupops[1]
IF TYPE("m.lUniquePopups")="L" AND m.lUniquePopups
FOR nTotPops = 1 TO ALEN(a_menupops)
a_menupops[m.nTotPops]= SYS(2015)
ENDFOR
ELSE
a_menupops[1]="file"
ENDIF
DEFINE MENU (m.cMenuName) IN (m.oFormRef.Name) BAR
DEFINE PAD _0x20fnux8 OF (m.cMenuName) PROMPT "File" COLOR SCHEME 3 ;
KEY ALT+F, ""
ON PAD _0x20fnux8 OF (m.cMenuName) ACTIVATE POPUP (a_menupops[1])
DEFINE POPUP (a_menupops[1]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[1]) PROMPT "Open"
DEFINE BAR 2 OF (a_menupops[1]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[1]) PROMPT "Exit"
ON SELECTION BAR 3 OF (a_menupops[1]) quit
ACTIVATE MENU (m.cMenuName) NOWAIT
IF m.cTypeParm2 = "C"
m.getMenuName = m.cMenuName
m.oFormRef.Name = m.cSaveFormName
ENDIF
ENDPROC
PROCEDURE addpictures
DECLARE INTEGER FindWindow IN win32api STRING,STRING
DECLARE INTEGER GetMenu IN win32api INTEGER
DECLARE INTEGER GetSubMenu IN win32api INTEGER,INTEGER
DECLARE INTEGER LoadImage IN win32api INTEGER,STRING,INTEGER,INTEGER,INTEGER,INTEGER
DECLARE INTEGER SetMenuItemBitmaps IN win32api INTEGER,INTEGER,INTEGER,INTEGER,INTEGER
DECLARE INTEGER GetMenuItemID IN win32api INTEGER,INTEGER
DECLARE INTEGER ModifyMenu IN win32api INTEGER,INTEGER,INTEGER,INTEGER,string
DECLARE INTEGER DrawMenuBar IN win32api INTEGER
LOCAL ctitle,HWND,mhandle,shandle,lcname1,lcname2,nretval1, nretval2,menuid1,menuid2,lcDirectory
ctitle = this.caption
lcDirectory = CURDIR()
HWnd = findwindow(0,m.ctitle)
mhandle = getmenu(m.HWND)
shandle = getsubmenu(m.mhandle,0)
lcname1 = lcDirectory+"Open.Bmp"
nretval1 = loadimage(0,m.lcname1,0,13,13,32768+16+2)
menuid1 =getmenuitemid(m.shandle, 0)
menuid2 =getmenuitemid(m.shandle, 1)
setmenuitembitmaps(m.shandle, m.menuid1,0,m.nretval1,m.nretval1)
modifymenu(m.mhandle, m.menuid1,0, m.menuid1,"&Open F2")
ENDPROC
PROCEDURE Init
this.createmenu(this,.t.)
this.addpictures()
ENDPROC
ENDDEFINE