Code: Select all
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar
SET _3DLOOK ON
DEFINE WINDOW oWnd TITLE "MDIChilds from resources" MDI
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION child() //( Child(), MsgInfo( oWnd:oWndClient:aWnd[ 1 ]:cCaption ) )
ACTIVATE WINDOW oWnd maximized
return nil
//----------------------------------------------------------------------------//
function Child()
local oWndChild, oDlg, oBtn, n
local cName := "Testing..."
DEFINE WINDOW oWndChild MDICHILD OF oWnd ;
FROM 5,5 TO 6,6;
COLOR "N/W"
oWndChild:bGotFocus = { || oDlg:SetFocus() }
DEFINE DIALOG oDlg RESOURCE "Child1" OF oWndChild
REDEFINE GET cName ID 110 OF oDlg
REDEFINE BUTTON oBtn ID 120 OF oDlg ;
ACTION ( MsgInfo( "First" ), oBtn:SetFocus() )
REDEFINE BUTTON ID 130 OF oDlg ACTION MsgInfo( "Second" )
for n = 1 to Len( oDlg:aControls )
oDlg:aControls[ n ]:bLClicked = GenBlock( oWndChild, oDlg:aControls[ n ] )
next
ACTIVATE DIALOG oDlg NOWAIT ; // It has to be NonModal --> NOWAIT clause
ON INIT oDlg:Move( 0, 0 ) ;
valid ( if(Salir(),;
(Eval( {|| oWndChild:End(), .T. }), .t. ),;
(.f.) ))
// Correct window size to match dialog
oWndChild:nWidth := oDlg:nWidth+7
oWndChild:nHeight := oDlg:nHeight+32
ACTIVATE WINDOW oWndChild ON INIT oWnd:paint()
return nil
//----------------------------------------------------------------------------//
function GenBlock( oWndChild, oControl )
return { || oWndChild:SetFocus(), oControl:SetFocus() }
//----------------------------------------------------------------------------//
Static Function Salir()
Local iRet:= .f.
iRet:= MsgYesNo("Abandona la opcion ?","Cerrar de Ventas")
RETURN iRet
Es algum Bug, FwH712 ?
Saluds