Jump to content

Multiline textedit


uriy

Recommended Posts

We are developing a device with a graphical LCD and hardware qwerty keyboard. 

We need the ability to enter text data up to 256 characters.  At this time we use gwinTexteditCreate();

It works, we can type text and move the cursor to left and right by buttons for editing.

But it allows filling only a single line of text. In a single line we can show up to 32 characters, it's a little bit inconvenient. 
It's possible to show on our LCD up to 4 lines of text. 
How to implement multiline text input with the ability to show 4 rows with 32 characters at each line and use cursor for moving up/down, left/right, and scrolling?  

Thanks in advance!

Link to comment
Share on other sites

Hi!

As you stated the existing text edit widget only allows for one line of text.
The proper way of doing this is creating a new widget called MultilineTextedit and implement the functionality. It might make sense to use the exsting Textedit widget as a base for this (i.e. copy-paste & modify).


Other than the API documentation you can find documentation on creating your own widget here: https://wiki.ugfx.io/index.php/Creating_a_widget

Alternatively we can implement the widget for via paid support.

Link to comment
Share on other sites

I did some work. Maybe it will usefull for somebody, you can find sources here https://bitbucket.org/only_uriy/ugfx_multiline/src/master/

There is new widget multilinetextedit. It's not completed, cursor is not redrawing at mouse click position.

And there are other several prerequisites, which make it not ready to use by all.

My aim was to show for other persons that it's possible to do. Because thay told before it's impossible.

In attachements you can find main.c for test project and video how it looks.

 

TestProject.7z

Link to comment
Share on other sites

I haven't had time to check out your code  yet - just the video. Looking good!

 

5 hours ago, uriy said:

My aim was to show for other persons that it's possible to do. Because thay told before it's impossible.

What was their reasoning that it wouldn't be possible?

if you like we might be able to improve this together and eventually put it into the official µGFX library so it's supported out-of-the-box :) 

Link to comment
Share on other sites

I think their reason was to save time and implement it as is right now from the box.

Be honest collaboration like that is interest for me, but right now I have not enough time.

I hope to return to that later.

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
×
×
  • Create New...