MDI Window

MDI Window

Postby Colin Haig » Mon Oct 08, 2007 12:35 am

To All

How do I bring an allready open MDI window back into focus - I have
a particular user who wont check to see if he has a window allready open - he just keeps openning new ones.

Thanks for any help

Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Postby James Bott » Mon Oct 08, 2007 3:53 am

Colin,

That is just one of many reasons I avoid using MDI.

Here is how I used to deal with this problem.

Code: Select all  Expand view  RUN
         MENUITEM "&New Order...   Ctrl+N" RESOURCE "new";
            ACTION if( ! wndSetFocus(::oWnd,"Order"), Torder():new():add(),)


// Sets focus to child MDI window with cTitle
static function wndSetFocus(oWnd,cTitle)
   local i:=0,lSuccess:=.f.
   cTitle:=upper(cTitle)
   for i=1 to len(oWnd:oWndClient:aWnd)
      if upper( oWnd:oWndClient:aWnd[i]:cCaption )=cTitle
         oWnd:oWndClient:aWnd[i]:setFocus()
         lSuccess:=.t.
      endif
   next
return lSuccess



Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

MDI

Postby Colin Haig » Mon Oct 08, 2007 6:50 am

Hi James

Thanks for that - works great.

Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 79 guests