I would like to create menu as Samples\Metro2.prg with submenu. Where can I set :OnClicked? I try with ::Cargo but don't successful.
Thanks in advance,
- Code: Select all Expand view
- #include "FiveWin.ch"
#include "xbrowse.ch"
*---------------*
function SpcWnd()
local oWnds, oFont, oBrw, oFont2, oFont3, oTree
oTree := BuildMenu()
DEFINE FONT oFont NAME "Segoe UI Light" SIZE 0, -52
DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0, -24 // -32
DEFINE FONT oFont3 NAME "Segoe UI Light" SIZE 0, -16
DEFINE WINDOW oWnds STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
COLOR CLR_BLACK, CLR_WHITE
@ 1, 7 SAY "Control Panel" FONT oFont SIZE 300, 100
// @ 1, 70 SAY "" FONT oFont SIZE 300, 100
@ 7, 5 XBROWSE oBrw DATASOURCE oTree COLSIZES 500 CELL ;
FONT oFont2 SIZE 250, 700 NOBORDER OF oWnds
oBrw:nDataLines = 1
oBrw:lRecordSelector = .F.
oBrw:lHeader = .F.
oBrw:lHScroll = .F.
oBrw:lVScroll = .F.
oBrw:nStretchCol = 1
oBrw:bClrStd = { || { CLR_BLACK, CLR_WHITE } } // RGB( 170, 170, 170 )
oBrw:bClrSelFocus = { || { CLR_WHITE, RGB( 34, 177, 76 ) } }
oBrw:SetColor( "B/W*" )
oBrw:CreateFromCode()
// oBrw:aCols[ 1 ]:bPaintText = { | oCol, hDC, cText, aCoors, aColors, lHighlight | DrawRow( oCol, hDC, cText, aCoors, oFont3 ) }
oBrw:SetFocus()
ACTIVATE WINDOW oWnds MAXIMIZED ;
ON CLICK ( oWnds:End() )
return nil
*---------------------------*
static function BuildMenu()
local oTree, cDate, n, x, y
local lAddTree
local aItems := { { "Profile", {'Guest','Company','Member','Reservation','Promote'} }, ;
{ 'Customer Relation Manangement' , {'Email Advertising','Email Birthday','SMS Email','SMS Birthday'} }, ;
{ 'Sold Out Items', {'Sold Out Items','Non Sale Items'} }, ;
{ 'Set Up', {{'Outlet','Outlet','Station','Table'},{'Menu Items','Short-Cut','Group Items'},'Miscellaneous','Print Format','Close Day','User Login','Tax Rate','Main Data'} }, ;
{ 'Tax Invoice', {'Issue Tax Invoice','Edit Tax Invoice'} }, ;
{ 'Report', {'Cashier Report','Setup Report','Close Day Report'} }, ;
{ 'Maintenance', {'File Maintenance','Reset User','Restore Last Backup'} } }
TREE oTree
for n:=1 to len(aItems)
_TreeItem( aItems[n][1] )
TREE
for x := 1 to len(aItems[n][2])
_TreeItem( aItems[n][2][x] )
lAddTree := .F.
if len( aItems[n][2][x] ) > 1
lAddTree := .T.
TREE
end
if len( aItems[n][2][x] ) > 1
for y := 2 to len(aItems[n][2][x])
_TreeItem( aItems[n][2][x][y] ):Cargo := {|| ConOutlet() }
next
end
if lAddTree
ENDTREE
else
end
next
ENDTREE
next
ENDTREE
return oTree