Focus on EditBox

For questions about using Classic.

Post » Mon Jul 23, 2012 3:41 pm

Hi, I have a problem so I hope someone will help me. :)
I have an editbox and an object with gridmovment behavior, on a layout. When I click on the editbox : focus ON; and when i click away : focus OFF. However when i put focus OFF, others behaviors don't work !

Hope i'm clear. I'm french so can't explain a lot in english, but if you don't understand something ask me i'll try to explain more.

Thanks !
B
7
G
1
Posts: 20
Reputation: 657

Post » Mon Jul 23, 2012 5:12 pm

B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Jul 23, 2012 6:39 pm

Hi, and thanks. However I have questions about it.

"1. Destroying the EditBox or Button will restore the keyboard focus." But if i want to write text again in this box, what can i do ?

"2. If you want to use python:" this will give focus without deleting the box ?

Thanks again !
B
7
G
1
Posts: 20
Reputation: 657

Post » Mon Jul 23, 2012 6:56 pm

1.
Save the value in the editbox to a global variable then recreate the box and set the text.

2.
yes.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Jul 23, 2012 7:07 pm

Ok thanks, i'll use the 1st solution because i don't know how to use python correctly.

Thanks again !
B
7
G
1
Posts: 20
Reputation: 657

Post » Mon Jul 23, 2012 9:55 pm

Hi, sorry for double-post. Can you explain me how to put the python code properly please ? When i put him i have an error. I've seen tutorials but there is still this error : "File <string>, line 1 in <module> ImportError: No module named ctypes"

Thanks.
B
7
G
1
Posts: 20
Reputation: 657

Post » Mon Jul 23, 2012 10:32 pm

The ctypes module isn't included with Construct.

So here is a complete example with all the required files:
http://dl.dropbox.com/u/5426011/examples13/focus2.zip
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Jul 23, 2012 10:42 pm

Ok thanks. I have to put the "py" folder at the root (where my project is) ? And distribute it ?
B
7
G
1
Posts: 20
Reputation: 657


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest