I wish insert a name of field into a dialog :
I made this
- Code: Select all Expand view
- Function Insert_Fields(oDlg)
Local oStru
Local oDlgFields
local lOk:=.f.
USE CUSTOMER NEW ALIAS CUST SHARED VIA "DBFCDX"
DEFINE DIALOG oDlgFields TITLE "Insert Fields" SIZE 500, 300
@ 0,0 XBROWSE oStru SIZE -10,-10 PIXEL OF oDlgFields ;
DATASOURCE CUST->( DbStruct() ) ;
COLUMNS 1,2,3,4 ;
HEADERS "FldName","Typ","Len","Dec" ;
AUTOCOLS CELL LINES NOBORDER FASTEDIT
WITH OBJECT oStru
:bClrSel := { || { CLR_BLACK, CLR_HGRAY }}
:nStretchCol := 4
:bLDClickData := {|| ( lOk := .t., CreateSay( oStru:ColPos(oStru:oCol( oStru:nArrayAt )) , oDlg ) ) }
:CreateFromCode()
END
ACTIVATE DIALOG oDlgFields CENTERED
if lOK
CreateSay( oStru:nArrayAt[nat] , oDlg )
Endif
return nil
function CreateSay(ctext, oDlg )
local oSay
@ 1, 2 SAY oSay PROMPT "<"+alltrim(ctext)+">" OF oDlg SIZE 70, 20 DESIGN
oSay:bGet = nil
oSay:lWantClick = .T.
BringWindowToTop( oSay:hWnd )
oSay:SetFocus()
return nil
But not run ok
How I can to have the name of field?...thanks