1. Help need with space bar
- Posted by jessedavis May 28, 2017
- 1347 views
Windows 7 pro up to date
Euohoria 4.0.5 (5741:362497032f33, 2012-10-11 16:05:19)
Back Again! Easy one this time...
include Win32Lib.ew without warning -- Window main_win constant main_win = createEx( Window, "", 0, 596, 296, 1000, 712, 0, 0 ) constant mw_find_btn = createEx( PushButton, "FIND SOMETHING", main_win, 96, 424, 175, 28, 0, 0 ) -- Window find_win constant find_win = createEx( Window, "FIND SOMETHING", 0, Default, Default, 321, 217, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure mw_find_btn_onClick (integer self, integer event, sequence params) --THE FIND WINDOW BUTTON openWindow(find_win,Normal) end procedure setHandler( mw_find_btn, w32HClick, routine_id("mw_find_btn_onClick")) --------------------------------------------------------- WinMain( main_win,Normal )
1. Run above with interpreter
2. Up comes main window.
3. Press space bar. Nothing happens.
4. Click on find_win button.
5. Up comes find window.
6. Use FIND WINDOW close 'X' & close window.
7. Now, press space bar.
8. Up comes the find_win again.
9. Only does this after the find_win has been opened at least once.
10. Tried on another machine. Same result.
11. Tears of regret.
Any thoughts? Am I missing some default operation of the space bar? Windows maybe?
Thanks & Regards,
jd
2. Re: Help need with space bar
- Posted by Spock May 28, 2017
- 1365 views
Windows 7 pro up to date
Euohoria 4.0.5 (5741:362497032f33, 2012-10-11 16:05:19)
Back Again! Easy one this time...
include Win32Lib.ew without warning -- Window main_win constant main_win = createEx( Window, "", 0, 596, 296, 1000, 712, 0, 0 ) constant mw_find_btn = createEx( PushButton, "FIND SOMETHING", main_win, 96, 424, 175, 28, 0, 0 ) -- Window find_win constant find_win = createEx( Window, "FIND SOMETHING", 0, Default, Default, 321, 217, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure mw_find_btn_onClick (integer self, integer event, sequence params) --THE FIND WINDOW BUTTON openWindow(find_win,Normal) end procedure setHandler( mw_find_btn, w32HClick, routine_id("mw_find_btn_onClick")) --------------------------------------------------------- WinMain( main_win,Normal )
1. Run above with interpreter
2. Up comes main window.
3. Press space bar. Nothing happens.
4. Click on find_win button.
5. Up comes find window.
6. Use FIND WINDOW close 'X' & close window.
7. Now, press space bar.
8. Up comes the find_win again.
9. Only does this after the find_win has been opened at least once.
10. Tried on another machine. Same result.
11. Tears of regret.
Any thoughts? Am I missing some default operation of the space bar? Windows maybe?
Thanks & Regards,
jd
It seems to be a focus issue. Try adding this after the controls are created: setFocus(mw_find_btn)
Better still, add it to the main_win handler to fire when the parent window is first opened.
Spock
3. Re: Help need with space bar
- Posted by ghaberek (admin) May 30, 2017
- 1341 views
1. Run above with interpreter
2. Up comes main window.
3. Press space bar. Nothing happens.
4. Click on find_win button.
5. Up comes find window.
6. Use FIND WINDOW close 'X' & close window.
7. Now, press space bar.
8. Up comes the find_win again.
9. Only does this after the find_win has been opened at least once.
10. Tried on another machine. Same result.
11. Tears of regret.
Any thoughts? Am I missing some default operation of the space bar? Windows maybe?
It seems to be a focus issue. Try adding this after the controls are created: setFocus(mw_find_btn)
Better still, add it to the main_win handler to fire when the parent window is first opened.
I wouldn't even consider this an issue. This is the expected behavior. The space bar activates the button like a click.
When the window first opens, the button does not have focus. Clicking the button sets focus to the button and then focus does not leave because there's nowhere else for it to go.
You can kill the focus manually but it seems that you have to show the window as a dialog. This probably has to do with the "find" window giving focus back to the "main" window when it's closed.
Do you not want the button to have focus? Or were you confused as to why the space bar triggered the button?
procedure mw_find_btn_onClick (integer self, integer event, sequence params) --THE FIND WINDOW BUTTON --openWindow(find_win,Normal) openDialog(find_win) w32Proc( xSetFocus, {NULL} ) end procedure setHandler( mw_find_btn, w32HClick, routine_id("mw_find_btn_onClick"))
-Greg