Tenho a dialog "main"
Código: Selecionar todos
FUNCTION gui_MainMenu( xDlg, aMenuList, aAllSetup, cTitle )
LOCAL aGroupList, cDBF
gui_DialogCreate( @xDlg, 0, 0,1024, 768, cTitle )
MENU OF xDlg
FOR EACH aGroupList IN aMenuList
MENU TITLE "Data" + Ltrim( Str( aGroupList:__EnumIndex ) )
FOR EACH cDBF IN aGroupList
MENUITEM cDBF ACTION frm_Main( cDBF, aAllSetup )
NEXT
ENDMENU
NEXT
MENU TITLE "Exit"
MENUITEM "&Exit" ACTION gui_DialogClose( xDlg )
ENDMENU
ENDMENU
gui_DialogActivate( xDlg )
RETURN Nil
Código: Selecionar todos
FUNCTION gui_DialogCreate( xDlg, nRow, nCol, nWidth, nHeight, cTitle, bInit )
LOCAL oFont
IF Empty( bInit )
bInit := { || Nil }
ENDIF
oFont := HFont():Add( DEFAULT_FONTNAME, 0, -11 )
INIT DIALOG xDlg ;
CLIPPER ;
FONT oFont ;
NOEXIT ;
TITLE cTitle ;
AT nRow, nCol ;
SIZE nWidth, nHeight ;
BACKCOLOR COLOR_WHITE ;
ON INIT bInit
RETURN Nil
E tem o activate, também igual pra qualquer dialog, que faz a centralização.
Código: Selecionar todos
FUNCTION gui_DialogActivate( xDlg, bCode )
xDlg:Center()
IF Empty( bCode )
xDlg:Activate()
ELSE
ACTIVATE DIALOG xDlg ON ACTIVATE bCode
ENDIF
RETURN Nil
