Skip to content

Add MultilineTextBox component #1618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Aergwyn opened this issue Jun 11, 2018 · 5 comments · May be fixed by #6564
Open

Add MultilineTextBox component #1618

Aergwyn opened this issue Jun 11, 2018 · 5 comments · May be fixed by #6564
Labels

Comments

@Aergwyn
Copy link
Member

Aergwyn commented Jun 11, 2018

As I need this and was tinkering with it I thought this is an opportunity to open an issue to ask questions before I open a PR in the coming days. My tinkering consisted of copying the entire TextBox and see if it's feasible with my knowledge to do this.

I managed

  • typing multiple lines of text by removing the scaling from the text and changing the fillmode
  • make the Caret aware of the Y-axis
  • make the delete animation of characters aware of the Y-axis

I need to figure out

  • vertical scrolling
  • visually displaying a selection spanning multiple lines

Question time:

  • Where should it be? Is it its own component sharing code with TextBox or is it just an option you can enable for the usual TextBox? I guess it'll be the former.
  • What additional keys does it have to handle? One I know is the ability to add new lines and up/down keys for navigation.
  • Does it need a scrollbar or any visual indicator that there is text outside of our vision? Something the normal TextBox could use as well maybe?
  • What else super obvious does a TextBox with many lines need that I just overlooked?

Of course this won't ask/answer everything as code should be available for that but something fundamental (like the first question) may already be answered beforehand.

@peppy peppy added the area:UI label Jun 11, 2018
@peppy
Copy link
Member

peppy commented Jun 11, 2018

Where should it be?

I'm not sure if we want to increase the complexity of the TextBox class beyond how complex it is already. It should likely be refactored before attempting this. I'd have to see a sample implementation to decide whether it would be part of TextBox or TextBoxMultiline : TextBox, though.

What additional keys does it have to handle?

The ones you specify would be a fine start.

Does it need a scrollbar or any visual indicator that there is text outside of our vision?

Yes. It will be used for editing longer articles like forum posts.

@peppy peppy added this to the Candidate Issues milestone Jun 11, 2018
@Aergwyn
Copy link
Member Author

Aergwyn commented Jun 11, 2018

It should likely be refactored before attempting this.

Could you elaborate on this? Is there something wrong with the TextBox itself? Would there be a specific goal with the refactoring?

@peppy
Copy link
Member

peppy commented Jun 11, 2018

I thin splitting individual visual components into their own classes would be a good start, if that isn't done yet. ie. Caret and SelectionArea. And trying to move logic in those classes where possible.

@frenzibyte
Copy link
Member

I'll work on this.

@frenzibyte frenzibyte changed the title Add MultiLineTextBox as a component Add MultilineTextBox component Feb 11, 2020
@frenzibyte frenzibyte self-assigned this Feb 11, 2020
@peppy peppy removed this from the Candidate Issues milestone Mar 17, 2020
@frenzibyte
Copy link
Member

Unassigning myself for now as it is a low priority from being worked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants