MDIchild window Focus diferent behavior as FW16

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Antonio,

There is a different behavior from Win16 to Win32 when using embeded dialogboxes into mdichild windows. This is a workaround that seems ok for samples\TestMdi4.prg:

Code: Select all

   for n = 1 to Len( oDlg:aControls )
      oDlg:aControls[ n ]:bLClicked = GenBlock( oWndChild, oDlg:aControls[ n ] )
   next 	 
   	
   ACTIVATE DIALOG oDlg NOWAIT ;
   ...

function GenBlock( oWndChild, oControl )

return { || oWndChild:SetFocus(), oControl:SetFocus() }
You also need to make this change in Class TGet:

Code: Select all

METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet
...
      if ::bLClicked != nil  // new
         Eval( ::bLClicked ) // new
      endif   // new 
      return 1
Anyhow, in recent FWH builds we do recommend a better way to place controls in mdichild windows. Please review samples\TestMdiR.prg. That sample has been improved in FWH 7.11
regards, saludos

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Post by AHF »

Antoino,

Thanks the button solution seems to work.
On the gets this problem doesn't exist. If you click the get it doesn't happen anything. Also it doesn't focus the mdichild. But at least this beahviour it's ok. Th user must tehn click anywere on the window to get focus of it.

Antonio
Post Reply