Amigos foreros:
Algún ejemplo de un ComboBox en xBrowse?
Gracias
STATIC FUNCTION ArrayEdit( oWnd )
local oChild, oBrw, oCol, n
local aStruc
DEFINE WINDOW oChild TITLE "DBF structrure with edition & no scroll bars" MDICHILD OF oWnd
aStruc := DBStruct()
Aeval( aStruc, {|v| v[1] := Padr( v[1], 10 ) } )
/*
oBrw := TXBrowse():New( oWnd )
oBrw:SetArray( aStruc)
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:aCols[1]:cHeader := Padr("NAME", 15)
oBrw:aCols[1]:cEditPicture := "@K !!!!!!!!!!"
oBrw:aCols[1]:bClrEdit := oBrw:bClrStd
oBrw:aCols[1]:bOnPostEdit := {|o,x| aStruc[ oBrw:nArrayAt, 1 ] := x }
oBrw:aCols[1]:nEditType := EDIT_GET
oBrw:aCols[2]:cHeader := "TYPE"
oBrw:aCols[2]:nDataStrAlign := AL_CENTER
oBrw:aCols[2]:nHeadStrAlign := AL_CENTER
oBrw:aCols[2]:nEditType := EDIT_GET_LISTBOX
oBrw:aCols[2]:aEditListTxt := {"C", "N", "D", "L", "M"}
oBrw:aCols[2]:bOnPostEdit := {|o,x| aStruc[ oBrw:nArrayAt, 2 ] := x }
oBrw:aCols[2]:aEditListBound := {"C", "N", "D", "L", "M"}
oBrw:aCols[2]:bClrEdit := oBrw:bClrStd
oBrw:aCols[3]:cHeader := "SIZE"
oBrw:aCols[3]:nDataStrAlign := AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign := AL_RIGHT
oBrw:aCols[3]:nEditType := EDIT_GET_BUTTON
oBrw:aCols[3]:bOnPostEdit := {|o,x| aStruc[ oBrw:nArrayAt, 3 ] := x }
oBrw:aCols[3]:bEditBlock := {|| Msginfo("Your code goes here ...", "TXBrowse power" ) }
oBrw:aCols[4]:cHeader := "LENGTH"
oBrw:aCols[4]:nDataStrAlign := AL_RIGHT
oBrw:aCols[4]:nHeadStrAlign := AL_RIGHT
oBrw:aCols[4]:bOnPostEdit := {|o,x| aStruc[ oBrw:nArrayAt, 4 ] := x }
oBrw:aCols[4]:nEditType := EDIT_GET
*/
@ 0,0 XBROWSE oBrw OF oChild ;
HEADERS "Name", "Type", "Len", "Dec", "Ext" ;
JUSTIFY .F., AL_CENTER, .T., .T., .T. ;
COLSIZES 80,60 ;
ARRAY aStruc AUTOCOLS
for n := 1 to Len( oBrw:aCols )
oCol := oBrw:aCols[ n ]
if n == 2
oCol:nEditType := EDIT_GET_LISTBOX
oBrw:aCols[2]:aEditListTxt := {"Charcter", "Numeric", "Date", "Logical", "Memo"}
oBrw:aCols[2]:aEditListBound := {"C", "N", "D", "L", "M"}
else
oCol:nEditType := EDIT_GET
endif
oCol:bOnPostEdit := { |o,x,n| If( n != VK_ESCAPE, oBrw:aRow[o:nArrayCol] := x, ) }
next
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:lHScroll := .f.
oBrw:lVScroll := .f.
oBrw:lFastEdit:= .t.
oBrw:CreateFromCode()
oChild:oClient := oBrw
ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()
RETURN NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 43 guests