Bom dia!
Estou com problema para encerrar um Dialog :D
Eu tenho um fwmarkbrowse dentro de um fwlayer dentro de um msdialog, e criei um botao fechar, ao clicar em fechar o seguinte erro ocorre:
argument #0 error, expected C->U, function upper on CANUSEGED(FWMBROWSE.PRW) 13/09/2023 17:37:37 line : 3527
Só consigo fechar o dialog sem erros caso clique no botao x na barra superior direita do dialog :/
Segue parte do código:
DEFINE MSDIALOG oDialog TITLE "TESTE" FROM 0, 0 TO nJanAltu, nJanLarg PIXEL
oFwLayer := FwLayer():New()
oFwLayer:init(oDialog,.F.)
oFWLayer:addLine("TIT", 10, .F.)
oFWLayer:addLine("COR", 90, .F.)
oFWLayer:addCollumn("COLEMP" , 025, .T., "TIT")
oFWLayer:addCollumn("COLFIL" , 025, .T., "TIT")
oFWLayer:addCollumn("COLEST" , 025, .T., "TIT")
oFWLayer:addCollumn("COLBTN" , 025, .T., "TIT")
oFWLayer:addCollumn("COLGRID", 100, .T., "COR")
oPanEmp := oFWLayer:GetColPanel("COLEMP" , "TIT")
oPanFil := oFWLayer:GetColPanel("COLFIL" , "TIT")
oPanEst := oFWLayer:GetColPanel("COLEST" , "TIT")
oPanBtn := oFWLayer:GetColPanel("COLBTN" , "TIT")
oPanGrid := oFWLayer:GetColPanel("COLGRID" , "COR")
aAllEmp := FwAllCompany()
cCBoxEmp := aAllEmp[1]
oComboEmp := TComboBox():New(014,002,{ |u|if(PCount()>0,cCBoxEmp:=u,cCBoxEmp)},aAllEmp,100,20,oPanEmp,,{||Alert('Mudou item da combo')},/*bValid*/,,,.T.,,,,/*bWhen*/,;
,,,,'cCBoxEmp','Empresa:',1,/*oLabelFont*/,/*nLabelColor*/)
aAllUnit := FwAllUnitBusiness(cCBoxEmp)
cCBoxFil := aAllUnit[1]
oComboFil := TComboBox():New(014,002,{ |u|if(PCount()>0,cCBoxFil:=u,cCBoxFil)},aAllUnit,100,20,oPanFil,,{||Alert('Mudou item da combo')},/*bValid*/,,,.T.,,,,/*bWhen*/,;
,,,,'cCBoxFil','Unidade de Negocio:',1,/*oLabelFont*/,/*nLabelColor*/)
aAllEst := FwIAllEst(cCBoxEmp,cCBoxFil)
cCBoxEst := aAllEst[1]
oComboFil := TComboBox():New(014,002,{ |u|if(PCount()>0,cCBoxEst:=u,cCBoxEst)},aAllEst,100,20,oPanEst,,{||Alert('Mudou item da combo')},/*bValid*/,,,.T.,,,,/*bWhen*/,;
,,,,'cCBoxEst','Estado:',1,/*oLabelFont*/,/*nLabelColor*/)
oMrkBrowse := FWMarkBrowse():New()
oMrkBrowse:SetOwner(oPanGrid)
oMrkBrowse:SetDescription("Teste")
oMrkBrowse:SetMenuDef("")
oMrkBrowse:SetIgnoreARotina(.T.)
oMrkBrowse:ForceQuitButton(.T.)
oMrkBrowse:DisableConfig()
oMrkBrowse:DisableReport()
oMrkBrowse:DisableDetails()
oMrkBrowse:SetWalkThru(.F.)
oMrkBrowse:oBrowse:SetUseFilter(.F.)
oMrkBrowse:oBrowse:SetFieldFilter(aFiltro)
oMrkBrowse:SetAlias(cAliasTemp)
oMrkBrowse:SetColumns(aColumns)
oMrkBrowse:SetFieldMark("MARK")
oMrkBrowse:SetMark('X', cAliasTemp, "MARK")
oMrkBrowse:SetAllMark( { || .T. } )
oMrkBrowse:bAllMark := { || InvertSel(cAliasTemp,oMrkBrowse:Mark(),lMarcar := !lMarcar,.F. ), oMrkBrowse:Refresh(.T.) }
oBtnSair := TButton():New(014, 061, "Fechar", oPanBtn, {|| oDialog:End()}, nLargBtn, 018, , oFontBtn, , .T., , , , , , )
oBtnSalvar := TButton():New(014, 122, "Salvar", oPanBtn, {|| oDialog:End()}, nLargBtn, 018, , oFontBtn, , .T., , , , , , )
oMrkBrowse:Activate()
Activate MsDialog oDialog Centered
oTmpTable:Delete()
Cade o codigo do botao sair, que voce fez ?
— Lucas de Paulo Santos 17 de Jan de 2024oBtnSair := TButton():New(014, 061, "Fechar", oPanBtn, {|| oDialog:End()}, nLargBtn, 018, , oFontBtn, , .T., , , , , , )
— Diogo 17 de Jan de 2024