π
<-
Chat plein-écran
[^]

GUI toolkit under development

C, C++, ASM...

Re: GUI toolkit under development

Unread postby Adriweb » 08 May 2021, 19:26

Yes I saw his comments on GitHub, if you use strings already, it's fine.
But my point was that such functions should already be using const char* as input, since I doubt it's their role to change it.
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 57.4%
 
Posts: 13402
Images: 1093
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Class: (ingénieur)
Twitter: adriweb
GitHub: adriweb

Re: GUI toolkit under development

Unread postby SlyVTT » 08 May 2021, 19:41

Ok, I understood you point in a different way ;)

Yes, agree, but need to rewrite many functions that currently return (char*) to be compliant with that change. You know the story, you change one small line somewhere and then you need to change everything everywhere to make all the code "synchronized" :D
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire
Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 46.5%
 
Posts: 105
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI toolkit under development

Unread postby Lionel Debroux » 08 May 2021, 20:05

On the negative side, fixing your API to achieve const correctness will take you some time, indeed.
On the positive side, next time you design an API, you'll probably make it const correct from the get go, assuming the target language doesn't force you to do it (Rust is one of the few languages which do) :)
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
User avatar
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Level up: 9%
 
Posts: 6677
Joined: 23 Dec 2009, 00:00
Location: France
Gender: Male
Calculator(s):
Class: -
GitHub: debrouxl

Re: GUI toolkit under development

Unread postby Adriweb » 08 May 2021, 20:24

May I suggest using an IDE that will help you refactor things quickly? I like Clion and it's free if you're a student :)
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 57.4%
 
Posts: 13402
Images: 1093
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Class: (ingénieur)
Twitter: adriweb
GitHub: adriweb

Re: GUI toolkit under development

Unread postby SlyVTT » 08 May 2021, 20:43

Lionel Debroux wrote:On the negative side, fixing your API to achieve const correctness will take you some time, indeed.
On the positive side, next time you design an API, you'll probably make it const correct from the get go, assuming the target language doesn't force you to do it (Rust is one of the few languages which do) :)


Agree, the second attempt should be easier, as we can hope I won't do the same mistakes (but certainly others ;-)
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire
Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 46.5%
 
Posts: 105
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI toolkit under development

Unread postby SlyVTT » 08 May 2021, 20:52

Adriweb wrote:May I suggest using an IDE that will help you refactor things quickly? I like Clion and it's free if you're a student :)


Sure this is a good idea, I am a bit old to get CLion free, as I am not a student for almost 20 years now ;-)

Today I am using Code::Blocks cause I was running on a linux virtual machine and then it was complex to have a windows based IDE and a toolchain/SDK on linux.
But I guess I will change to Visual Studio cause on my new PC, I am now using WSL so a windows based IDE is OK.
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire
Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 46.5%
 
Posts: 105
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI toolkit under development

Unread postby Adriweb » 10 May 2021, 02:04

Yes Visual Studio is not bad if you're on Windows. Although Clion works there too :P
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 57.4%
 
Posts: 13402
Images: 1093
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Class: (ingénieur)
Twitter: adriweb
GitHub: adriweb

Re: GUI toolkit under development

Unread postby SlyVTT » 17 May 2021, 21:43

Hello Everybody,

my posts are a bit less regular, but don't be afraid, this does not mean I am not taking care of the GUI Toolkit anymore !!
This is the absolute opposite, I am spending a lot of time in tuning, optimizing and developing the Toolkit.

This week, thanks to the heavy rain, was very fruitful.

Three main actions made the backbone of my development week :
- update the code by changing all (char *) to std::string, which make the code more clean (and more C++ compliant rather than being a strange mixture of C/C++) + rewrite some part of code to make them more homogeneous or to add some functionalities
- pursue the debugging of the Toolkit, with many small bugs/glitches now fixed
- pursue the development of new features.

Some more details of the actions :

1) Update of the existing code


This was by far the most time consuming part of this week's actions. This is something I was postponing for weeks but now I cannot escape anymore. Procrastination is not good at all. Very boring part of development job !!! But necessary.

So I started to rewrite all the widgets code that was based on utilization of (char *) to now use std::string instead. This means double checking all the code and rewrite many part of it to be compliant with the new variable types. The problem being that when you wait too long for doing such major change, it is really a pain to do that. But now this is done and even if it was long and tough, it worth the job.

The second big part of code refurbishing was the implementation of a "asciiget" function in the keyboard handling class which aims at replacing the nio_ascii_get() function of libndls. Why doing this ? Just because I want the user to be able to map the keyboard of the nSpire CX/CX-II just as he wants, without having to recompile/modify the files of the Ndless SDK. Now this is managed by the KeyboardTask class through a dedicated method.

The current default mapping is one of libndls, but it can be easily changed by tuning the KeyboardTask.cpp file that looks like this

Code: Select all
       if (keyevent && kbPAROPEN && !capsonmode && !kbSHIFT && ! kbCTRL) return '(';
       if (keyevent && kbPAROPEN && (capsonmode || kbSHIFT) && !kbCTRL) return '[';
       if (keyevent && kbPAROPEN && !(capsonmode || kbSHIFT) && kbCTRL) return '{';

       if (keyevent && kbPARCLOSE && !capsonmode && !kbSHIFT && ! kbCTRL) return ')';
       if (keyevent && kbPARCLOSE && (capsonmode || kbSHIFT) && !kbCTRL) return ']';
       if (keyevent && kbPARCLOSE && !(capsonmode || kbSHIFT) && kbCTRL) return '}';

so if you want the combination :nsct: + :nspo: to correspond to the character '&' instead of '{', you just need to change the adequate line in that later file like this :
Code: Select all
       if (keyevent && kbPAROPEN && !capsonmode && !kbSHIFT && ! kbCTRL) return '(';
       if (keyevent && kbPAROPEN && (capsonmode || kbSHIFT) && !kbCTRL) return '[';
       if (keyevent && kbPAROPEN && !(capsonmode || kbSHIFT) && kbCTRL) return '&';

       if (keyevent && kbPARCLOSE && !capsonmode && !kbSHIFT && ! kbCTRL) return ')';
       if (keyevent && kbPARCLOSE && (capsonmode || kbSHIFT) && !kbCTRL) return ']';
       if (keyevent && kbPARCLOSE && !(capsonmode || kbSHIFT) && kbCTRL) return '}';

Of course this is just a dummy example to explain the concept :p



2) Bug/Glitches fixed


Many, many !! The main ones (and most significant to be reported) :
- fixed a bug on MenuPaneWidget when attached to a MenuBarWidget directly on the desktop.
- fixed the positioning of the MenuItemWidget in the MenuBarWidget to have something more aesthetic
- fixed a drawing glitch with IconBarWidget
- added a line on the IconBarWidget to create a delimitation with widgets on the bottom side of the icon bar
- fixed some bugs in the FileDialogBoxWidget
- ... many others that I even forgot ...

3) New features


As always, the best part for the end B-)

I started the development of two new widgets :

-
MultiLineTextBoxWidget
which intends to contain/modify text that cannot be drawn in one single line. This will be very helpful for people who would like to code text editor or console application catchers or terminal or code editor or whatever ...

This is how it looks like :
Image Image Image

This part is still under development and some part are missing. I also need to spend some time on debugging.
I am also considering a possible extension of this widget to contain some basic "formatting" options of the text (color; bold/italic; underlining/striking ...) but I need to think how I can manage this.

-
GraphicalContextWidget
which intends to contain pictures. This can be used either for picture viewer or to create some drawing applications. Why not having Gimp on nSpire :p

Today this is rather a proof of concept, but it work and I need add feature like scaling, scrolling, zooming/shrinking ...

This is how it looks like :
Image Image


So I reach my goal in terms of Widget to be implemented, I will now spend time of finishing the code and debugging it. This may need numerous hours to make sure the code is safe and robust.

As usual, please feel free to give me your feedback.

And some final pictures with various themes

Image Image Image

Ciao

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire
Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 46.5%
 
Posts: 105
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI toolkit under development

Unread postby SlyVTT » 21 May 2021, 07:04

Hello Everybody,

this time, this is a post with a different taste, related neither to code update (despite it is moving on) nor to issues with bugs.

this time, this is just to introduce the logo of the toolkit. Yesterday I was a bit lazy for coding and hence wanted to have something to appear as a splash screen, being said that the project still has no logo. So worked on this. I am then very happy to present the new Logo of the GUI Toolkit for TI-nSpire in its two versions:

- bright colors :
Image

- dark colors:
Image

This is the logo for upcoming revision 1.0 to be in release candidate soon.

Please let me know what you are thinking of it.

Ciao

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire
Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 46.5%
 
Posts: 105
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

Re: GUI toolkit under development

Unread postby SlyVTT » 22 May 2021, 19:47

Dear All,

this is the status of the art of the GUI Toolkit for TI nSpire, as usual for each end of week.

Things are still moving quite smoothly and development is now ready to start the very final step before reaching revision 1.0RC (release candidate) : the debugging stage.

The new widgets GraphicContextWidget and MultiLineTextBoxWidget are now fully implemented and are working fine.

GraphicContextWidget
is able to adjust the size of the picture to fit its width, its height or both as well as handling various zoom factors between 10% to 500%. Of course if the picture to be drawn is greater than the size of the widget, the user can move it with the arrows. Zoom in / out are also possible with the +/ - keys.
The following pictures give an example showing the logo of the project with initial opening session of the application, a zoom of the picture by the user to different levels and then panning the picture with the arrow keys. at the end, return to the initial size of the window with the picture still zoomed.

Image Image Image Image Image Image Image

MultiLineTextBoxWidget
is able to handle text over multiple lines and is able to load a text file to be drawn and navigated through. A special version of this widget
MultiLineRichTextBoxWidget
is an extension with the ability to handle formatted text with user-defined styles. This should be usefull for applications such as code editor or text based consoles.
The following pictures show the widget after loading a text from a file. Scrolling through the lines is done with SHIFT + UP / DOWN and the cursor is moved with arrow keys.

Image Image Image

The main difference between
MultiLineTextBoxWidget
and
MultiLineRichTextBoxWidget
is that the first one just draw the text without any treatment while the second one is looking for formatting options (through tags) and then draw the corresponding formatted text.
This is shown by the following pictures, with the same text in both widgets (MultiLineTextBoxWidget in the top and MultiLineRichTextBoxWidget in the bottom). The tags shown in the top are in real time converted into the bottom text.

Image Image Image Image Image Image

At the moment, the tag system is very simple, but it is very easy to change it to have a real parser/interpreter to handle a language like python/C/Pascal...

As usual, please feel free to give your feedbacks.

Ciao

Sly
Developing the GUI Toolkit for nSpire
see current revision here : https://github.com/SlyVTT/Widget-for-TI-NSpire
Image Image Image Image
User avatar
SlyVTTProgrammeur
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Level up: 46.5%
 
Posts: 105
Images: 0
Joined: 19 Jan 2021, 09:41
Gender: Male
Calculator(s):

PreviousNext

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 3 guests

-
Search
-
Social
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Découvre les nouvelles fonctionnalités en Python de l'OS 5.2 pour les Nspire CX II
Découvre les nouvelles fonctionnalités en Python de l'OS 5.5 pour la 83PCE/84+C-T Python Edition
Omega, le fork étendant les capacités de ta NumWorks, même en mode examen !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
554 utilisateurs:
>537 invités
>11 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)

-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)