for example i have this adatamenu array
- Code: Select all Expand view
- local aDataMenu:={;
{.f., "Cadenza 0" ,{|| Cadenza(0,oCmb,oSay)} } ,;
{.f., "Cadenza 1" ,{|| Cadenza(1,oCmb,oSay)} } ,;
{.f., "Cadenza 2" ,{|| Cadenza(2,oCmb,oSay)} } ,;
{.f., "Cadenza 3" ,{|| Cadenza(3,oCmb,oSay)} } ,;
{.f., "Cadenza 4" ,{|| Cadenza(4,oCmb,oSay)} } ,;
{.f., "Cadenza 5" ,{|| Cadenza(5,oCmb,oSay)} } ,;
{.f., "Cadenza 6" ,{|| Cadenza(6,oCmb,oSay)} } ,;
{.f., "Cadenza 7" ,{|| Cadenza(7,oCmb,oSay)} } ,;
{.f., "Cadenza 8" ,{|| Cadenza(8,oCmb,oSay)} } ,;
{.f., "Cadenza 9" ,{|| Cadenza(9,oCmb,oSay)} } ,;
}
if the user presses a checkbox and the procedure performs the related operation (which I put inside a codeblock)
in xbrowse you have to display only the first r field and the second ie the checkbox and the menu text
I made a small test but not run
- Code: Select all Expand view
#include "fivewin.ch"
Function testLbx()
local oDlg, oBrw, oFont,oBold
local aBmp:= {".\bitmaps\CHECK_box.bmp", ".\bitmaps\NOCHECK_box.bmp"}
local oCmb,oSay
local aDataMenu:={;
{.f., "Cadenza 0" ,{|| Cadenza(0,oCmb,oSay)} } ,;
{.f., "Cadenza 1" ,{|| Cadenza(1,oCmb,oSay)} } ,;
{.f., "Cadenza 2" ,{|| Cadenza(2,oCmb,oSay)} } ,;
{.f., "Cadenza 3" ,{|| Cadenza(3,oCmb,oSay)} } ,;
{.f., "Cadenza 4" ,{|| Cadenza(4,oCmb,oSay)} } ,;
{.f., "Cadenza 5" ,{|| Cadenza(5,oCmb,oSay)} } ,;
{.f., "Cadenza 6" ,{|| Cadenza(6,oCmb,oSay)} } ,;
{.f., "Cadenza 7" ,{|| Cadenza(7,oCmb,oSay)} } ,;
{.f., "Cadenza 8" ,{|| Cadenza(8,oCmb,oSay)} } ,;
{.f., "Cadenza 9" ,{|| Cadenza(9,oCmb,oSay)} } ,;
}
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -16
DEFINE FONT oBold NAME 'Tahoma' SIZE 0, -14 BOLD
DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL ;
TITLE "test menu";
COLOR CLR_BLACK,nRgb(245,244,234) ;
STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, 4 )
@ 10,20 XBROWSE oBrw SIZE -10,-90 PIXEL OF oDlg ;
DATASOURCE aDataMenu ;
COLUMNS 2,1 ;
HEADERS "Colonne","" ;
COLSIZES 100, 40 ;
NOBORDER FONT oFONT
WITH OBJECT oBrw
:l2007:=.f.
:nStretchCol := STRETCHCOL_WIDEST
:lDrawBorder := .t.
:bClrHeader := {|| { ,nRgb(233,229,206) } }
:bClrFooter := {|| { ,nRgb( 245,244,234) } }
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:lRecordSelector := .f.
:lHScroll := .f.
WITH OBJECT :aCols[ 3]
:SetCheck(aBmp, .t. )
:nHeadBmpNo := 2
END
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT (oDlg:resize())
RELEASE oFont,oBold
oBrowse:refresh()
return nil
Function Cadenza(k,oCmb,oSay)
msginfo(k)
return nil
Any solution ?