I'm using 8.02 and xDev to compile with fwxh 8.02,
but what I mean to say is : What lib's you are using?
@14.3,05 BUTTON oBtnCancel PROMPT "Cancel" OF oDlg ;
SIZE 50,15 ACTION oDlg:End()
@ 0,100 XBROWSE oBrwMenu ;
COLUMNS 2, 3 ;
HEADERS "Menu", "Status" ;
OF oDlg ;
ARRAY aMenu
oCol:=oBrwMenu:AddCol()
or
ADD TO oBrwMenu ARRAY ELEMENT 2 HEADER "Menu" PICTURE <pic>
......
ADD TO oBrwMenu ARRAY ELEMENT 3 HEADER "Status" PICTURE <pic>
or
Local nCur:=1
@ 0, 0 XBROWSE oBrw FIELDS aMenu[ nCur, 2 ],;
aMenu[ nCur, 3 ],;
HEADERS "Menu", "Status";
ARRAY aMenu
oBrwMenu:bLDblClick:={|nRow, nCol| if(oBrwMenu:nColSel == 2, MsgInfo("Col 2"),MsgInfo("Some other Column") )}
oBrwMenu:bLDblClick:={|nRow, nCol| ... }
oBrwMenu:MouseColPos( nCol )
#Include "FiveWin.ch"
#Include "xBrowse.ch"
////////////////
PROCEDURE Main()
////////////////
Local oDlg, oBrwMenu, oBtnCancel
Local aClrCol :={ { 0, nRGB( 192, 221, 255 ) }, { 0, nRGB( 221, 245, 255 ) } } // Xbrowse Alternative Column colours
Local aMenu :={;
{ 1, "Masters ", .F., .T. },;
{ 2, " Account Groups ", .F., .F. },;
{ 3, " Account Heads ", .F., .F. },;
{ 4, " Exit ", .F., .F. },;
{ 5, "Transactions ", .F., .T. },;
{ 6, " Voucher Entry ", .F., .F. },;
{ 7, " Sales Postings ", .F., .T. },;
{ 8, " From GDMS ", .F., .T. },;
{ 9, " Test sub menu 1", .F., .F. },;
{ 10, " From PDMS ", .F., .F. },;
{ 11, " Test Menu ", .F., .F. },;
{ 12, "Reports ", .F., .T. },;
{ 13, " Trial Balance ", .F., .F. },;
{ 14, " Profit & Loss Statement ", .F., .F. },;
{ 15, " Balance Sheet ", .F., .F. },;
{ 16, " Statement of Account ", .F., .F. },;
{ 17, " Debtor ", .F., .F. },;
{ 18, "Tools ", .F., .T. },;
{ 19, " Select Financial Year ", .F., .F. },;
{ 20, " Calculator ", .F., .F. },;
{ 21, "Users ", .F., .T. },;
{ 22, " Create User ", .F., .F. },;
{ 23, " Set user Permissions ", .F., .F. } ;
}
DEFINE DIALOG oDlg FROM 70,20 to 630,690 TITLE "Test" PIXEL
@ 0,100 XBROWSE oBrwMenu ;
COLUMNS 2, 3 ;
HEADERS "Menu", "Status" ;
OF oDlg ;
ARRAY aMenu // should not use AUTOCOLS now
oBrwMenu:lHScroll := .F. // Horizontal Scroll Bar not required
oBrwMenu:lFooter := .T.
oBrwMenu:nMarqueeStyle := MARQSTYLE_HIGHLROWRC // MARQSTYLE_HIGHLROWMS MS can be used to place rec point on a partucular record and move futher using mouse scroll
// Sub Menu in different colour and Menu's in different Coclour
oBrwMenu:bClrStd := { || if( oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ], aClrCol[ 1 ], aClrCol[ 2 ] ) }
oBrwMenu:lUpdate := .t.
oBrwMenu:aCols[ 1 ]:nWidth := 350
// Alternative way to display BMP, if multiple conditions and more than 2 bitmaps are there
oBrwMenu:aCols[ 2 ]:AddResource( "CheckOn" )
oBrwMenu:aCols[ 2 ]:AddResource( "CheckOff" )
// Checkbox should be displayed only if the menu type is not a Submenu
oBrwMenu:aCols[ 2 ]:bBmpData := { || if( oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ],;
0,;
if( oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
1,;
2;
);
);
}
oBrwMenu:aCols[ 2 ]:nWidth := 50
oBrwMenu:aCols[ 2 ]:bStrData := { || NIL }
oBrwMenu:aCols[ 2 ]:nDataStrAlign := AL_CENTER
// here the permission is changed when lDblClick happens exactly on column 2
// -------------------------------------------------------------------------
oBrwMenu:bLDblClick := { | nRow, nCol | if( !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ] .and. oBrwMenu:MouseColPos( nCol ) == 2,;
(;
oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ] := !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
oBrwMenu:Refresh();
),;
NIL;
);
}
/*
// here the permission is changed when lDblClick happens on whole row
// ------------------------------------------------------------------
oBrwMenu:bLDblClick := { | nRow, nCol | if( !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ] .and. oBrwMenu:MouseColPos( nCol ) == 2,;
(;
oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ] := !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
oBrwMenu:Refresh();
),;
NIL;
);
}
*/
oBrwMenu:bKeyDown := { | nKey | if( !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 4 ],; // Is submenu the do nothing, bwhen will take care
if ( nKey == VK_SPACE,;
(;
oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ] := !oBrwMenu:aArrayData[ oBrwMenu:nArrayAt ][ 3 ],;
oBrwMenu:Refresh();
),;
NIL;
),;
NIL;
);
}
oBrwMenu:CreateFromCode()
@14.3, 05 BUTTON oBtnCancel PROMPT "Cancel" OF oDlg SIZE 50,15 ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT (;
oBrwMenu:nLeft := 220,;
oBrwMenu:nHeight := oDlg:nHeight - 35,;
oBrwMenu:nWidth := 450,;
oBrwMenu:SetFocus();
)
RETURN
Is this possible Or Am I moving in a wrong direction ?.
oBrwMenu:aCols[2]:nEditType := EDIT_GET
oBrwMenu:aCols[2]:bEditvalue := { || space(0) }
oBrwMenu:nColSel
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 83 guests