Help with edit box please ;(

For questions about using Classic.

Post » Sun Dec 05, 2010 4:14 am

Hello :D
I made an edit box in my project and I checked the ''autoscroll'' options but it's not scrolling. Not sure if it's working properly...
There is a manual way to do this with events or scripts, if so, how?

Sorry for my bad english =/

thanks for any help! ;)
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sun Dec 05, 2010 7:30 am

Hi. In my experience, those options just make it so that the text contained by the EditBox can be larger than the box itself.

If you're looking to make it scroll so that you can see text that has been added to the EditBox through events, you can use the EditBox's Set Selection action to force it to show any area in the text.

The following simple example would add the amount of time that the application has been running in a new line each time the LMB is pressed, then set a null-selection the end of the text.

+ MouseKeyboard: On Left mouse button Clicked
-> EditBox: Append text Timer & NewLine
-> EditBox: Select characters len(EditBox.Text) to len(EditBox.Text)
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sun Dec 05, 2010 5:36 pm

[quote="Silent Cacophony":mkwb8r96]Hi. In my experience, those options just make it so that the text contained by the EditBox can be larger than the box itself.

If you're looking to make it scroll so that you can see text that has been added to the EditBox through events, you can use the EditBox's Set Selection action to force it to show any area in the text.

The following simple example would add the amount of time that the application has been running in a new line each time the LMB is pressed, then set a null-selection the end of the text.

+ MouseKeyboard: On Left mouse button Clicked
-> EditBox: Append text Timer & NewLine
-> EditBox: Select characters len(EditBox.Text) to len(EditBox.Text)[/quote:mkwb8r96]

thanks it worked, but now I got a new question.. It's possible to put a different background color on edit box? it's always white and also, how do I change the Font, color font, size of the font of the Edit Box? And finally, when I maximize my screen the edit box is not expanding, it stay in the same place with the same size, nothing happens..

thanks for help!
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sun Dec 05, 2010 8:28 pm

The EditBox is a Windows object, so it does not behave like most other Construct objects do, such as sprites.

I'm not aware of any way to change any of the things that you have mentioned, other than the position and size of it.

I don't think that there is a 'On window resized' condition, but you could store the current size at start of layout in a couple of global variables, and compare those against the current size each tick, then resize the EditBox based upon the change if they are different. Then set the stored size to the current size...

The System object has expressions under it's Display category for the display size, and the Window object has similar expressions for window size.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sun Dec 05, 2010 8:54 pm

[quote="Silent Cacophony":l0jgdrg1]The EditBox is a Windows object, so it does not behave like most other Construct objects do, such as sprites.

I'm not aware of any way to change any of the things that you have mentioned, other than the position and size of it.

I don't think that there is a 'On window resized' condition, but you could store the current size at start of layout in a couple of global variables, and compare those against the current size each tick, then resize the EditBox based upon the change if they are different. Then set the stored size to the current size...

The System object has expressions under it's Display category for the display size, and the Window object has similar expressions for window size.[/quote:l0jgdrg1]
If I activate the fullscreen mode the editbox actually changes his size but it become invisible and nothing appear when writing, I can see the size is right because of the mouse pointer...
any solution you may know how make it become visible with fullscreen mode? this would already help.. ;)
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sun Dec 05, 2010 9:16 pm

I've never tried full screen with an editbox until now, and I see it doesn't work correctly.

I would guess that it doesn't work well because full screen uses DirectX to display, and it doesn't play well with Windows API. I don't know...

I don't see a way to fix that, other than not using full screen.

Perhaps you can use the Text object, or SpriteFont Plugin to do the display portion instead of the EditBox. If input is needed, there is an Input plugin in the WIP plugins forum that could be used for that. I'm sure that it's possible to emulate an EditBox.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sun Dec 05, 2010 10:06 pm

[quote="Silent Cacophony":pqeovz46]I've never tried full screen with an editbox until now, and I see it doesn't work correctly.

I would guess that it doesn't work well because full screen uses DirectX to display, and it doesn't play well with Windows API. I don't know...

I don't see a way to fix that, other than not using full screen.

Perhaps you can use the Text object, or SpriteFont Plugin to do the display portion instead of the EditBox. If input is needed, there is an Input plugin in the WIP plugins forum that could be used for that. I'm sure that it's possible to emulate an EditBox.[/quote:pqeovz46]
any idea how to make a text object scrolls down and have options to scroll up and down? I'm having some dificulties here hehe
B
30
S
6
G
5
Posts: 433
Reputation: 6,061


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests