Amigos,
He revisado el foro y no he encontrado un ejemplo con el efecto pijama utilizando array y en modo edición.
Alguien tendría un ejemplo?
Saludos y gracias de antemano.
oBrw:bClrStd := { || If( oBrw:nArrayAt % 2 == 0, { CLR_BLACK, RGB( 224, 236, 255 ) }, { CLR_BLACK, RGB( 189, 211, 253 ) } ) }
#INCLUDE "FiveWin.ch"
#INCLUDE "XBrowse.ch"
STATIC oWnd
STATIC oWndChild
STATIC oDlg
STATIC oBrw
STATIC aLin := {}
function Main()
LOCAL i
for i := 1 TO 6
AAdd( aLin, { i, "Description " + Str( i ), Replicate( Chr( 64 + i ), 2 ) } )
next
DEFINE WINDOW oWnd TITLE "INCOS" MDI
ACTIVATE WINDOW oWnd ON INIT dialogo()
RETURN NIL
FUNCTION dialogo()
DEFINE DIALOG oDlg RESOURCE "BRW" TRANSPARENT
oBrw := TxBrowseW():New( oDlg )
oBrw:SetArray( aLin )
oBrw:lTransparent := .f.
oBrw:l2007 := .t.
oBrw:lHScroll := .t.
oBrw:lVScroll := .t.
oBrw:lAllowColSwapping := .f.
oBrw:lRecordSelector := .t.
oBrw:lAllowRowSizing := .f.
oBrw:nStretchCol := STRETCHCOL_LAST
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
oBrw:bClrStd := { || If( oBrw:nArrayAt % 2 == 0, { CLR_BLACK, RGB( 224, 236, 255 ) }, { CLR_BLACK, RGB( 189, 211, 253 ) } ) }
oBrw:aCols[1]:cHeader := 'Cod'
oBrw:aCols[1]:cEditPicture := '99'
oBrw:aCols[1]:bClrEdit := oBrw:bClrStd
oBrw:aCols[1]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aLin[ oBrw:nArrayAt,1] := xVal,) }
oBrw:aCols[1]:nEditType := EDIT_GET
oBrw:aCols[1]:bEditValid := { | oGet, oCol | Valida( oGet, oCol ) }
//--
oBrw:aCols[2]:cHeader := 'Description'
oBrw:aCols[2]:bClrEdit := oBrw:bClrStd
oBrw:aCols[2]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, ( aLin[ oBrw:nArrayAt,2] := xVal, oBrw:GoDown() ),) }
oBrw:aCols[2]:nEditType := EDIT_GET
//--
oBrw:aCols[3]:cHeader := 'Cd'
oBrw:aCols[3]:bClrEdit := oBrw:bClrStd
oBrw:aCols[3]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aLin[ oBrw:nArrayAt, 3 ] := xVal,) }
oBrw:aCols[3]:nEditType := EDIT_LISTBOX
oBrw:aCols[3]:aEditListBound := ;
oBrw:aCols[3]:aEditListTxt := { "AA", "BB", "CC", "DD", "EE", "FF", "GG", "HH" }
oBrw:CreateFromResource( 401 )
oBrw:bRClicked = { | nRow, nCol | ShowPopup( nRow, nCol, oBrw, aLin ) }
oDlg:oClient:=oBrw
ACTIVATE DIALOG oDlg
RETURN NIL
STATIC FUNCTION Valida( oGet, oCol )
local nVal := 0
if oGet:Value() > 6
MsgAlert( "Must be lower than 7" )
if MsgGet( "New value", "Enter number between 1 and 6", @nVal )
if nVal > 0 .and. nVal < 7
oGet:VarPut( nVal )
oCol:PostEdit()
return .T.
endif
endif
return .F.
endif
return .T.
function ShowPopup( nRow, nCol, oBrw, aLin )
local oMenu
MENU oMenu POPUP 2007
MENUITEM "Add" ACTION ( AAdd( aLin, ;
{ Len( aLin ) + 1 , "New item " + Str( Len( aLin ) + 1 ), ;
Replicate( Chr( 64 + Len( aLin ) + 1 ), 2 ) } ), oBrw:Refresh() )
MENUITEM "Delete" ACTION ( ADel( aLin, oBrw:nArrayAt ), ASize( aLin, Len( aLin ) - 1 ), oBrw:Refresh() )
MENUITEM "Select 3rd Row" ACTION ( oBrw:GoTop(), oBrw:nArrayAt := 3, oBrw:nRowSel := 3, oBrw:Refresh() )
MENUITEM "Delete All" ACTION ( ASize( aLin, 0 ), oBrw:Refresh() )
MENUITEM "Report" ACTION oBrw:Report()
MENUITEM "Excel" ACTION oBrw:ToExcel()
ENDMENU
ACTIVATE POPUP oMenu WINDOW oBrw AT nRow, nCol
return nil
CLASS TXBROWSEW FROM TXBROWSE
ENDCLASS
BRW DIALOGEX DISCARDABLE 6, 18, 210, 142
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 0, 0, 1
{
CONTROL "Custom control", 401, "TXBROWSEW", 0x00000000, 0, 0, 208, 140
}
ACTIVATE DIALOG oDlg ON INIT ( oBrw:lTransparent := .F., .T. )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot], Willi Quintana and 33 guests