at init go to add a array aItems I need on xbrowse from a function calcolo()
if I make a check calcolo function have some message boxes
I wish before create the dialog with all object and then the calcolo function can show the messages
my problem is the message is showed before to create the dialog
how I can resolve it ?
I made a small test
- Code: Select all Expand view
- #include "fivewin.ch"
Function test()
Local odlg,oFolder,oPanelGreen
Local aItems:= {}
LOCAL oBrowse
DEFINE DIALOG oDlg TITLE "test" SIZE 1120,650 ;
PIXEL TRUEPIXEL RESIZABLE
@ 1, 0 FOLDEREX oFolder OF oDlg SIZE oDlg:nWidth-585,oDlg:nHeight-390 PIXEL ;
PROMPT "Reservation","Payments"
@ 100, 02 XBROWSE oBrowse OF oFolder:aDialogs[1] ;
ARRAY aItems ;
SIZE 100,90 PIXEL STYLE FLAT NOBORDER
WITH OBJECT oBrowse
:CreateFromCode()
END
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
oFolder:nWidth := oRect:nRight-2
oFolder:nHeight := oRect:nBottom-60
oPanelGreen:nTop := oRect:ntop +80
oPanelGreen:nLeft := oRect:nleft+5
oPanelGreen:nwidth := oRect:nRight - 20
oBrowse:nTop := oRect:nBottom-350
oBrowse:nWidth := oRect:nWidth - 15
return nil
>
ACTIVATE DIALOG oDlg CENTERED;
ON INIT ( oPanelGreen := PanelGreen(oFolder),;
Calcolo(@aItems),EVAL( oDlg:bResized))
return nil
//-----------------------------------------------//
function PanelGreen(oFld)
local oPanel,oBrushGreen
Local aGradgreen := { Rgb( 225,239,219),Rgb( 225,239,219)}
DEFINE BRUSH oBrushGreen GRADIENT aGradgreen
oPanel:=Tpanel():New( 35, 2, 75, oFld:aDialogs[1]:nWidth-5, oFld:aDialogs[1])
oPanel:SetBrush( oBrushGreen )
oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }
return oPanel
//-----------------------------------------------//
function Calcolo(aItems)
msginfo("wwww")
return aItems
//-----------------------------------------------//