Jump to content

Multiline textedit

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 post
Share on other sites


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 post
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.



Link to post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...