I need some help
I have this small test application (See code below) where a MDI window calls 2 other windows.
Please follow these steps:
1) Start the test application.
2) Click "Menu", than "Open Window 1"
-> Standard window opens
3) Click "Menu", than "Open Window 2"
-> Second window opens, above Window1.
-> Window2 has focus now
4) Click on Window1
-> Window1 gets focus
5) Click in the GET field of Window2
-> Window2 SHOULD get focus, but it does not
6) Click anywhere IN Window2
-> Window2 SHOULD get focus, but it does not
7) Click on the title bar of Window2
-> Window2 gets focus
What should I change to get 5) and 6) working.
Meaning, I'd like Window2 to get focus when the GET is activated or when the user clicks somewhere IN window2. Now Window2 ONLY gets focus if you click on its title bar.
I have created a ZIP fie for you to download here:
http://upgrades.winfakt.com/TestFWH-FOCUS.zip
This is the source code for Test.prg:
- Code: Select all Expand view RUN
#include "fivewin.ch"
STATIC oWndH,oWnd1,oWnd2
PROCEDURE Main
LOCAL oMenu
MENU oMenu
MENUITEM "Menu"
MENU
MENUITEM "Open Window 1";
ACTION OpenWindow1()
MENUITEM "Open Window 2";
ACTION OpenWindow2()
SEPARATOR
MENUITEM "Quit";
ACTION __Quit()
ENDMENU
ENDMENU
DEFINE WINDOW oWndH MDI ;
MENU oMenu ;
FROM 0,0 TO 30,70 ;
ACTIVATE WINDOW oWndH
RETURN
//-------------------------------------------------------------//
PROCEDURE OpenWindow1()
DEFINE WINDOW oWnd1;
FROM 1,1 TO 20,40
@ 1,1 SAY "Test"
ACTIVATE WINDOW oWnd1
SetParent( oWnd1:hWnd, oWndH:oWndClient:hWnd )
Aadd(oWndH:oWndClient:aWnd,oWnd1)
RETURN
//-------------------------------------------------------------//
PROCEDURE OpenWindow2()
LOCAL oDlg
LOCAL oGet1,cGet1:=Space(30)
LOCAL oGet2,cGet2:=Space(30)
DEFINE WINDOW oWnd2 MDICHILD ;
OF oWndH ;
FROM 5,5 TO 15,55
DEFINE DIALOG oDlg ;
NAME "TEST" OF oWnd2
REDEFINE GET oGet1 ;
VAR cGet1 ;
ID 100 OF oDlg
REDEFINE GET oGet2 ;
VAR cGet2 ;
ID 101 OF oDlg
ACTIVATE DIALOG oDlg;
NOMODAL;
VALID (.F.)
ACTIVATE WINDOW oWnd2
RETURN
//-------------------------------------------------------------//
This is the code for test.rc:
- Code: Select all Expand view RUN
TEST DIALOG 0, 0, 300, 300
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
{
EDITTEXT 100, 30, 25, 200, 12
EDITTEXT 101, 30, 45, 200, 12
}
Thank you guys!
Patrick