Jump to content

Escape key, Edit Control Crash


Xandy
 Share

Recommended Posts

I'm making a chat dialog and to close it I want to use Escape.

During the phase where I collect info to be used as chat.  If I use GuiCtrlCreateEdit() my script will crash when I press Escape.  Bare in mind the Edit also has focus.

If I use GuiCtrlCreateInput to capture User input there is no crash on Escape.

 

I'm sure GuiCtrlCreateEdit works fine in most scripts.

My problem is probably my environment is using DLLs and EnvSet("SDL_WINDOWID", $ghGui).

When I have the EnvSet my error log report is garbled, and when my EnvSet is not set there is no crash.

Anyhow I don't like the GuiCtrlCreateInput() when I read from it while the User inputs it only returns one last char.  So then I'd need to figure out when any key was down append and output.  I really don't want to do it that way.  Maybe I'll learn more about that and find it's the way to go.  Hmm maybe it has something to do with a cursor for the Input is changing when I read it?

; In declaration either
$gChat_window_edit= GUICtrlCreateInput("", 15, -200, 200, 50)
; or
$gChat_window_edit= GUICtrlCreateEdit("", 15, -200, 200, 50)
; in the chat_console()
Local $text = GUICtrlRead($gChat_window_edit)

print2("Chat: " & $text, $gChat_window_surf, 1, 1)

Input Example: abc

input.jpg

 

Does anyone know a way to disable the Escape key code in variable GuiCtrlCreateEdit() returns?  I tried ws_toolbar I think it was called didn't work still crashed on Escape

Perhaps a different control suggestion.

Here is a picture with the Edit control, but remember it crashes on Escape key down.

edit.jpg

*****************************************************************************************************************************************************************************

EDIT: I was able to solve this using an Input field and: ControlSend($ghGUI, "", $gChat_window_edit, "{end}") after I focused the Input control.               *

I would still be interested if anyone can give me information about this issue.                                                                                                                        *

*****************************************************************************************************************************************************************************

If seeing exactly what I'm doing helps, please have a look.

http://songersoft.com/graphics/forum/guictrledit/Map_Editor.zip

and here's a video with an example of both Input and Edit Controls: 

 
Edited by Xandy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...