Anyone know of a simple lightweight GUI widget library that could be ported

Continuing the discussion from Libraries for GUI supported by Photon?:

Following on from this thread - I have been looking for a lightweight GUI widget library - I only really want to handle virtual buttons but apart from uGFX (open source) and easygui (proprietary and expensive) I haven’t seen anything else suitable to embedded controllers. Aside from starting a port of uGFX has anyone got any other ideas? Thanks

@armor, have you looked at ITead Nextion displays or Digole displays?

Yes I have evaluated the itead Nextion, 2 issues for the application I have: 1. Price and 2. Robustness of touch screen display. I know you can put gorilla glass over it but then that costs even more. The last reason is that I have invested a bit effort in development of a menu manager and basic input handling (validation) - going with Nextion (or digiole) would mean an amount of rework and the number of buttons/controls does not justify. Given you ported adafruit mfGFX - I guess there isn’t a better answer in the Community?

@armor I’m planning on creating a user interface for a project with a LCD display also and I have found very little in the way of pre-made menu systems to navigate the different functions and settings of my device.

Here is one simple sketch that may or may-not be helpful:

And it looks like this guy has a nice menu system worked out, I’m sure the code is somewhere if you wanted to ask him:

I have a 4+ inch Nextion displays here to try out but have not gotten to the point of trying to use their software to create a custom layout yet but I have high hopes that it will allow me to get it looking as nice as I want to.

Here is a decent article on programming the Nextion display I ran across:

I’m using the mfGFX library to create a nice custom LCD interface and it’s awesome stuff by @peekay123

What do you have worked up so far? Anything you can share?

I’m looking at this library which is based on UTFT. Need to assess effort for porting.

Also found:

@RWB Thanks for replying. The menu and response management part is sorted. I am following an MVC model. The menu screens (view functions) get called to output to the TFT according to the screen state (with a global int variable to control the screen or field shown or highlighted. Within the main controller function there is a check on key entry/press and then a nested series of switches structured according to the menu structure, each screen/field combination requires a function to handle the key entries and decide what to do; store in a buffer, remove last input to buffer, echo to screen, process the buffer, return to the previous menu/field. This also allows for validation of input fields; integer, float, date, time according to the field.

Not sure this is the most efficient way to do it but this ensures the main loop is not blocked. I could have done more Object stuff!!!

Regards the button, I have come to the conclusion I will need to write my own button widget object to sit on top of the mfGFX library and do the things that otherwise would clutter the main program.

@peekay123 That updated JOS touchscreen library looks pretty good. I think I remember seeing the older version of that from many years ago so it’s nice to see it updated. I like how to has the screen auto off feature setup and saved to Eeprom to keep the screen from killing batteries so quickly.

For the Memory LCD’s I’m going to be without a touch screen so I’m planning on using a magnetic rotary sensor with push sensing for a old iPod style wheel selector type of user interface.

Keep us updated.

@armor Be sure to share a video of what you have cooked up if possible.

1 Like

@peekay123 Thanks for finding these - AWind looks more like what I am looking to implement - however I can see there would be a quite an investment in time to port this. I don’t have that such time available nor the C++ skills as some of the code I could not understand. Since my requirement is only for a button class (properties such as x, y, w, h, background colour, text colour, text, visible, enabled, pressed). I will post something back on this thread when I have something.


@armor I would really appreciate you sharing it once it’s ready :smiley: