Hi ! I have one problem with MDIChilds windows . The situation looks like that :
1 - open first MDIChild window oWnd1 ;
2 - open second MDIChild window oWnd2 ;
( this second MDI Child have folders ) ;
3 - maximize it .The first window maximized too ;
4 - let to close the second ( oWnd2 ) window ;
- application hangs up ... (
It appears not allways , but sometimes . At first I was thinking that this is my problem , because I'm using owns classes for window management - to save states of windows , browses and etc. . But with not maximized window or windows without folders it works OK . With one MDIChild if it's maximized ( with folder too ) it works OK . So why it hangs up only for maximized ( with folders ) and if are open some windows ?
If I will close the first window oWnd1 ( from described sequence ) , then and second will be closelly without problems . It seem that folder dialogs are interfere in sequence of MDI Childs ... That's mine opinion . What it's really - I believe that guru will help to elucidate .
Here is my pieces of sources :
METHOD WCreate() CLASS TMyBasic // to create MDI CHild window
::WndBasic()
if ::nWd == 1
::Bar()
endif
if ::lFld
::oFld := TFolder():New( 5, 5, ::aFold,, ::oWnd,,,, .t.,,,,, .t. )
::oFld:SetOption( ::nFld )
::oFld:bChange := { || ::nOldFld := ::nFld, ::nFld := ::oFld:nOption, ::FldChg() }
::oFld:aDialogs[ ::nFld ]:bLClicked := { || ::nOldFld := ::nFld, ::nFld := ::oFld:nOption, ::FldChg() }
::oFld:SetFont( wndMain():oFont )
if ::nWd == 1
::oWnd:SetControl( ::oFld )
endif
endif
::oBrw := array( len( ::aAlias ) ) // browse obj arrays
::oSel := array( len( ::aAlias ) )
::BrwBasic()
::oWnd:bLostFocus := { || if( ::nLst <= 0, ::LstFcs(), ) }
::oWnd:bGotFocus := { || if( ::nLst <= 0, ::GotFcs(), ) }
::oWnd:bValid := { || ( ::End(), .t. ) }
::oWnd:bKeyDown := { | nKey, nFlags | ::Keys( nKey ) }
return( NIL )
METHOD Start() CLASS TMyBasic
local n := 0
if ::nWd == 1 // for MDIChilds
if !::lMax
for n := 1 to len( wndMain():oWndClient:aWnd )
if IsZoomed( wndMain():oWndClient:aWnd[ n ]:hWnd )
::lMax := .t.
exit
endif
next
endif
::oWnd:Activate( if( ::lMax, "MAXIMIZED", "NORMAL" ) )
::nPrvWnd := GetFocus()
::oWnd:SetFocus()
::Focus()
else // for dialogs
::oWnd:lHelpIcon = .F.
::oWnd:Activate( ,,,, { || ::End(), SetFocus( ::nPrvWnd ), .t. },, ;
{ || ::oWnd:Move( ::nWk1, ::nWk2, ::nWk3, ::nWk4, .t. ), ::DlgCtrl(), ;
::nPrvWnd := GetFocus(), ::PradIrs( ::cPrdKnt, ::aPrdBsn, ::cPrdAls ), ::oBrw[ ::nFld ]:SetFocus(), oApp:OpWd( ::cCargo, Self, 1 ) },,)
endif
return( NIL )
METHOD End() CLASS TMyBasic
local cCrg := ::cCargo
local n := 0
if ::bEnd !=NIL // codeblock for needfuls ends of windows
eval( ::bEnd )
endif
if ::oWnd != NIL
if ::lEnv
for n := 1 to len( ::aBrwID )
wbrw_save( ::cCargo, ::aBrwID[ n ], ::oBrw[ n ], ::aColSrw[ n ] )
next
wind_save( padr( ::cCargo, 10 ), ::oWnd )
endif
::LstFcs()
endif
if ::bEndPst !=NIL // another codeblock from my class
eval( ::bEndPst )
endif
oApp:OpWd( cCrg,, 2 ) // to release object from
::lEnd := .t.
if ::nWd == 1
// it hangs up in this place - I don't reach PostMessage function .
PostMessage( ::oWnd:hWnd, WM_CLOSE )
endif
return( NIL )
Any ideas and help are very appreciatable . With best regards !
P.S. Antonio , this isn't related to FiveHc or xHarbour , it was in earlier . Only at this moment I decided to direct for help ..