MDIchild window Focus diferent behavior as FW16
MDIchild window Focus diferent behavior as FW16
Hello ,
I've tried with other w32 bit programs like excel, etc and when you click any control in the back mdichild window (unfocused) it immediatly brings it to front focused before processing the click event control.
In FW16 it worked like this but in FWH it doesn't anymore.
Can anyone confirms this?
Antonio
I've tried with other w32 bit programs like excel, etc and when you click any control in the back mdichild window (unfocused) it immediatly brings it to front focused before processing the click event control.
In FW16 it worked like this but in FWH it doesn't anymore.
Can anyone confirms this?
Antonio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
Please review this thread for a very interesting way to avoid the use of a dialog box inside the mdichild:
http://fivetechsoft.com/forums/viewtopi ... parent+mdi
Please review this thread for a very interesting way to avoid the use of a dialog box inside the mdichild:
http://fivetechsoft.com/forums/viewtopi ... parent+mdi
Thanks for your reply, however and although it is a very nice solution for me doesn't work.
I treat every Mdichild container for each dialog that corresponds to a particular program rotine.
I navigate through the dialogs (rotines) foward and backward inside the mdichild.
It is not very common but it has been working without any probelms for some yeras now using FW16.
The only problem in xHarbour is that you can click a chebox or any other control on another child without focusing it it is still active and works wihtout focusing the mdichild.
Is it possible to disable all controls when the mdichild loose focus and enable them when it gain focus again ?
Antonio
I treat every Mdichild container for each dialog that corresponds to a particular program rotine.
I navigate through the dialogs (rotines) foward and backward inside the mdichild.
It is not very common but it has been working without any probelms for some yeras now using FW16.
The only problem in xHarbour is that you can click a chebox or any other control on another child without focusing it it is still active and works wihtout focusing the mdichild.
Is it possible to disable all controls when the mdichild loose focus and enable them when it gain focus again ?
Antonio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
Yes, you can disable any control just doing:
oControl:Disable()
and enable it doing:
oControl:Enable()
i.e. to disable all controls of a dialog, or a window, just do:
AEval( oWnd:aControls, { | o | o:Disable() } )
You can use oWnd:bGotFocus = { || AEval( oWnd:aControls, { | o | o:Enable() } ) } and oWnd:bLostFocus = { || AEval( oWnd:aControls, { | o | o:Disable() } ) }
Yes, you can disable any control just doing:
oControl:Disable()
and enable it doing:
oControl:Enable()
i.e. to disable all controls of a dialog, or a window, just do:
AEval( oWnd:aControls, { | o | o:Disable() } )
You can use oWnd:bGotFocus = { || AEval( oWnd:aControls, { | o | o:Enable() } ) } and oWnd:bLostFocus = { || AEval( oWnd:aControls, { | o | o:Disable() } ) }
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Thanks for your help, now the behaviour it's like win16.
I've solved the problem with the code below following the James idea that clicking in every control should give the focus to windchild.
aEval(odlg:acontrols,{|octrl|(octrl:bgotfocus:= {||::setfocus() })})
nlist1 := len(odlg:acontrols)
for n:= 1 to nlist1
odlg:acontrols[n]:bgotfocus:= {||::setfocus() }
if odlg:acontrols[n]:classname == "TFOLDER"
nlist2 := len(odlg:acontrols[n]:adialogs)
for x := 1 to nlist2
nlist3 := len(odlg:acontrols[n]:adialogs[x]:acontrols)
for z := 1 to nlist3
odlg:acontrols[n]:adialogs[x]:acontrols[z]:bgotfocus:= {||::setfocus() }
next
next
endif
next
Antonio
I've solved the problem with the code below following the James idea that clicking in every control should give the focus to windchild.
aEval(odlg:acontrols,{|octrl|(octrl:bgotfocus:= {||::setfocus() })})
nlist1 := len(odlg:acontrols)
for n:= 1 to nlist1
odlg:acontrols[n]:bgotfocus:= {||::setfocus() }
if odlg:acontrols[n]:classname == "TFOLDER"
nlist2 := len(odlg:acontrols[n]:adialogs)
for x := 1 to nlist2
nlist3 := len(odlg:acontrols[n]:adialogs[x]:acontrols)
for z := 1 to nlist3
odlg:acontrols[n]:adialogs[x]:acontrols[z]:bgotfocus:= {||::setfocus() }
next
next
endif
next
Antonio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
I use this code :
nlist1 := len(odlg:acontrols)
for n:= 1 to nlist1
bBlock = odlg:acontrols[n]:bgotfocus
odlg:acontrols[n]:bgotfocus:= {||::setfocus(),eval(bBlock) }
if odlg:acontrols[n]:classname == "TFOLDER"
nlist2 := len(odlg:acontrols[n]:adialogs)
for x := 1 to nlist2
nlist3 := len(odlg:acontrols[n]:adialogs[x]:acontrols)
for z := 1 to nlist3
bBlock = odlg:acontrols[n]:adialogs[x]:acontrols[z]:bgotfocus
odlg:acontrols[n]:adialogs[x]:acontrols[z]:bgotfocus:= {||::setfocus(),eval(bBlock) }
next
next
endif
next
but I get error :
Args:
argumentos <nenhuma>
descrição Class: 'NIL' has no exported method
ficheiro <nenhuma>
genCode 13: EG_NOMETHOD
operação EVAL
osCode (Não é erro do sistema operativo)
severity 2
subCode 1004
subSystem BASE
tries 0
Regards
Antonio
I use this code :
nlist1 := len(odlg:acontrols)
for n:= 1 to nlist1
bBlock = odlg:acontrols[n]:bgotfocus
odlg:acontrols[n]:bgotfocus:= {||::setfocus(),eval(bBlock) }
if odlg:acontrols[n]:classname == "TFOLDER"
nlist2 := len(odlg:acontrols[n]:adialogs)
for x := 1 to nlist2
nlist3 := len(odlg:acontrols[n]:adialogs[x]:acontrols)
for z := 1 to nlist3
bBlock = odlg:acontrols[n]:adialogs[x]:acontrols[z]:bgotfocus
odlg:acontrols[n]:adialogs[x]:acontrols[z]:bgotfocus:= {||::setfocus(),eval(bBlock) }
next
next
endif
next
but I get error :
Args:
argumentos <nenhuma>
descrição Class: 'NIL' has no exported method
ficheiro <nenhuma>
genCode 13: EG_NOMETHOD
operação EVAL
osCode (Não é erro do sistema operativo)
severity 2
subCode 1004
subSystem BASE
tries 0
Regards
Antonio
Hello,
After several trials I 'm convince that something is wrong either with xHarbour or FWH.
The windows behaviour on focusing mdichilds is exactly the same for win xp for both 32bits and 16 bits apps and with FW16 it works as expected.
If you try with excel when you have 2 mdichilds and you click the one without focus first it focus first that window, after you must click again to initiate click action on that window. In FH16 it's working like that but FWH isn't anymore.
This brings big problems when programing with Mdichilds where you are in a non modal programing and the events must work absolutly as expected.
FWH March 2006 build
FW16 2.3
Perhaps Antonio Linares could check this ?
Antonio
After several trials I 'm convince that something is wrong either with xHarbour or FWH.
The windows behaviour on focusing mdichilds is exactly the same for win xp for both 32bits and 16 bits apps and with FW16 it works as expected.
If you try with excel when you have 2 mdichilds and you click the one without focus first it focus first that window, after you must click again to initiate click action on that window. In FH16 it's working like that but FWH isn't anymore.
This brings big problems when programing with Mdichilds where you are in a non modal programing and the events must work absolutly as expected.
FWH March 2006 build
FW16 2.3
Perhaps Antonio Linares could check this ?
Antonio