| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. Question: preselect input field with cursor #11324 | Is it possible to preset one entry field to contain the cursor, so one can just start entering data without having to click that box first ? I'm sure I'm just missing something obvious here, but I haven't found it.Doug | 2. #11326 | Make sure the ENTRY control appears first in the WINDOW definition. The "Grouping" dialog can rearrange control order. | 3. #11338 | Doesn't seem to help, still have to click the entry box to activate a cursor so typing is allowed. Even making a window with only one entry box, same thing.Doug | 4. #11341 | Post a test script. | 5. #11344 | Discovered that when I punch the 'run' button, that it doesn't work, however, if i use 'execute script' or 'start debugger' first, i do get the desired action.
However, it's only good for one iteration. Try the following test, note that the cursor does come up in the entry box, then press the close button, the second display of the window, no cursor.
/* GUIBEGIN
WINDOW , 61, 341, 400, 80, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , My Window FONT 8, 400, MS Shell Dlg ENTRY 89, 23, 110, 12, H_AUTO|BORDER|TABSTOP, , MyEntry ENTRY 89, 43, 110, 12, H_AUTO|BORDER|TABSTOP PUSH 247, 33, 40, 14, TABSTOP, , close, , close DEND GUIEND */
LIBRARY rexxgui GuiErr = "SYNTAX" GuiHeading = 1
GuiCreateWindow('NORMAL') Do 2 GuiGetMsg() end GuiDestroyWindow() Return
WM_CLICK_close: GuiWake() RETURNDoug | 6. #11765 | Why do you have a "DO 2" there??? That should be DO FOREVER (and may be the reason for what you're seeing). I also don't get the GuiWake() for the close button. Do a GuiSendMsg(, "POST CLOSE") instead. | 7. Your problem isn't #11766 | as trivial as
guisetctlplacement('entry_control')
is it ?
This places focus in entry_control and you're ready to type | 8. #11777 Posted by: DougA 2007-09-09 03:40:22 | Michael, perfect, yes it was as trivial as that, that fixes it. (put guisetctlplacement('MyEntry') after the Do 2 in my example ) I guess i'm just not 'pulling' this info out of the doc very well.
Sorry Jeff, I was trying to make a simple, short example that showed the cursor is active in the entry box the first time the window is displayed, but the next time guigetmsg is run, no cursor. The do 2 demo'ed that, then exited (not what you'd want in a real program)
However, since you're teaching us something, would you elaborate on the 'POST CLOSE' ?Doug | 9. #11778 | "POST" used with GuiSendMsg() means "don't invoke any event handler right here and now on this call to GuiSendMsg. Wait until later when I get around to calling GuiGetMsg again.". "CLOSE" means "cause a CLOSE event", so if you have a CLOSE event handler (WM_CLOSE), then your handler will get called when you do a GuiGetMsg. Essentially, you're causing that button to simulate a CLOSE event as if the user clicked on the window's close box. | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|