Page 1 of 1

Text Edit control 'focus'

Posted: Thu Mar 15, 2012 1:48 pm
by bryan20miles
Trying to write 'chat' type application using Edit control, etc.
The idea is to type a text message in an input box, have it appear in a scrolling output box.
The issue I'm experiencing is that the button I'm using as a Send button needs to be clicked twice in order to operate (accept the text, etc.). I THINK this is because the first click changes the (Windows) focus from the text input box to the Send button, and the second click actually activates the button (sends trigger pulse).
Alternatively, if I click anywhere off of the text input box before clicking the Send button, it also accepts the text.

So the result of this is that I have to click twice to perform a function I'd like to accomplish using only one click.
Can anyone assist me with my quandry? Would an element to test, report or change Windows focus be useful?
Thanks!

Bryan

Re: Text Edit control 'focus'

Posted: Thu Mar 15, 2012 5:57 pm
by Embedded
Classic FlowStone missing redraw issue. When programming some things you need to first send the data and then redraw the part of the GUI screen with the new data displayed. This doesn't happen automatically when you program things yourself, which is a good thing as you can then optimise the redraws to save on waisted CPU.

Quick solution - in the module where the text is displayed go inside and connect a wire from the String input to the redraw trigger input on the Redraw module, if you can find it. That way every time the text data changes it will also refresh the GUI.

Re: Text Edit control 'focus'

Posted: Thu Mar 15, 2012 9:49 pm
by bryan20miles
Thanks Embedded, I'll give it a try!