π
<-
Chat plein-écran
[^]

GUI toolkit under development

C, C++, ASM...

Re: GUI toolkit under development

Message non lude Vogtinator » 07 Mar 2021, 22:12

Awesome!

I spent some time on trying to understand why the size of the TNS file was so big, and I have been able to reduce it from 1250kib to 550kib just by removing <fstream> in the included files.

Some more possible optimizations:
  • Pass "-ffunction-sections -fdata-sections --Wl,--gc-sections" to GCCFLAGS and LDFLAGS -> 530KiB
  • Pass "-fno-exceptions -fno-rtti" if you don't need them -> 500KiB
  • Don't use raw "new", use "new (std::nothrow)" instead to avoid exception handling code. This is unfortunately not directly possible with "std::vector" and "std::string" also likes to throw...
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: GUI toolkit under development

Message non lude SlyVTT » 10 Mar 2021, 11:47

Hello All,

Working hard, still, on the GUI toolkit. Now on its way to revision 0.5 expected to be released soon ...

Current work (almost finished) is focused on Font Management Engine ... Pretty happy with what it can already do :
- 6 embedded fonts and the Engine is open enough to let other fonts being added in a simple way
- possibility to have variations for each (Normal, Italic, Bold, ItalicBold)
- possibility to have underlining options (No, SImple, Double)
- possibility to have striking options (No, Simple, Double)
... and of course a mix of all these ...

The font engine should be robust enough to handle fonts from 1x1pixels (I guess it will not be very useful, except maybe for Morse code :p ) up to 32 pixels wide (4 bytes coding) x unlimited height. But right now all fonts used are 8x8 (cause I have a lot of these, and no time to create font files with different resolutions :? )...

Strings can be rendered left-aligned, centered or right-aligned. Need to add some methods for top-aligned, centered vertically and bottom-aligned, so this is not top priority right now >:] .

Some screenshots of current working revision and debugging/testing screens :

Image

Image

Image

Now I need to re-inject that new code into the rendering system of the widget for getting rev 0.5 (+ add some User Defined Color Management options). But this should not be so difficult.

Stay tuned /!\ ...

Sly
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude SlyVTT » 12 Mar 2021, 21:42

The revision 0.45beta of the GUI Toolkit has been released and can be downloaded here http://ti-pla.net/a2709134

Main changes are :
- improvement of the automatic positioning system, it now works for every widgets (maybe some little bugs still have to be fixed, but it should be OK for most of the widgets) --> Widget resizing is now possible and re-sizing/re-positioning is cascaded to children widgets.
- manual positioning is still possible and has been converted to relative positioning into parent widget (before it was absolute coordinates and very painful !!) --> moving windows will be a piece of cake to develop in coming revisions.
- the new Font Engine and Color Engine are now used for the rendering of the widgets. --> user defined theme is now possible through defined set of colors. Themes import through setting files are planed for soon.


The repository of the project can be found here : https://github.com/SlyVTT/Widget-for-TI-NSpire

With the planed development roadmap here : https://github.com/SlyVTT/Widget-for-TI-NSpire/projects/1
Maybe things are still on the roadmap but it move forward quite quickly and smoothly.

I also started a Wiki for the documentation. Three examples of programs using the GUI toolkit are available right now :

- First a simple Hello World
Image

- A bit more complex Hello World with widgets activating window resizing
Image Image

- A more complex example of widget interactions
Image


Thanks to the improvements of the code done this week, the last example can be produce with significantly less lines of code (about 100 lines only including comments :#fou#: ) :

Code: Tout sélectionner
#include  "Toolkit/GUIToolkit.h"

int main ( int argc, char** argv )
{
    WidgetApplication *MyApp = new WidgetApplication();
    MyApp->setuniformbackgroundcolor(0, 155, 255);

    // We create the main window with automatic positioning feature
    WindowWidget *window = new WindowWidget( "This is a more complex Window", 10, 20, 300, 100, nullptr );
    ContainerVWidget *containerv = new ContainerVWidget( "container", 1, 1, 1, 1, window );
    LabelWidget *label = new LabelWidget( "Let's try some interactions ... ", 1, 1, 1, 1, containerv );
    label->setalignment( centered );
    ContainerHWidget *containerh = new ContainerHWidget( "container", 1, 1, 1, 1, containerv );
    ButtonWidget *buttonCreate = new ButtonWidget( "Create window [7]", 1, 1, 1, 1, containerh );
    ContainerHWidget *containerh2 = new ContainerHWidget( "container", 1, 1, 1, 1, containerv );
    ButtonWidget *buttonHide = new ButtonWidget( "Hide window [4]", 1, 1, 1, 1, containerh2 );
    buttonHide->disable();
    ButtonWidget *buttonShow = new ButtonWidget( "Show Window [5]", 1, 1, 1, 1, containerh2 );
    buttonShow->disable();
    ContainerHWidget *containerh3 = new ContainerHWidget( "container", 1, 1, 1, 1, containerv );
    ButtonWidget *buttonDisable = new ButtonWidget( "Disable window [1]", 1, 1, 1, 1, containerh3 );
    buttonDisable->disable();
    ButtonWidget *buttonEnable = new ButtonWidget( "Enable Window [2]", 1, 1, 1, 1, containerh3 );
    buttonEnable->disable();
    ButtonWidget *buttonQuit = new ButtonWidget( "Quit this Application [0]", 1, 1, 1, 1, containerv );
    window->adjust();

    MyApp->addchild( window );
    MyApp->render();

    // We create a WindowWidget point that will be used at child window creation
    WindowWidget *windowchild;

    bool childexist = false;
    bool done = false;

    while (!buttonQuit->ispressed() && !done)
    {
        MyApp->logic();

        if (MyApp->keyboard->kbCTRL && MyApp->keyboard->kbESC) done = true;

        if (MyApp->keyboard->kb0) done = true;

        // When Create button is pressed or key 7 is pressed
        if ((buttonCreate->ispressed() || MyApp->keyboard->kb7) && !childexist)
        {
                // We create all the widgets in the child window and attached everything to MyApp
                windowchild = new WindowWidget( "Child Window", 80, 150, 160, 80, nullptr );
                LabelWidget *label2 = new LabelWidget( "I am a Child Window", 0, 0, windowchild->getuseablewidth(), windowchild->getuseableheight(), windowchild );
                label2->setalignment( centered );
                windowchild->adjust();

                MyApp->addchild( windowchild );

                buttonCreate->disable();
                buttonHide->enable();
                buttonShow->enable();
                buttonDisable->enable();
                buttonEnable->enable();

                childexist = true;
        }

        // When Hide button is pressed or key 4 is pressed
        if ((buttonHide->ispressed() || MyApp->keyboard->kb4) && childexist)
        {
                windowchild->setinvisible();
                buttonHide->disable();
                buttonShow->enable();
        }

        // When Show button is pressed or key 5 is pressed
        if ((buttonShow->ispressed() || MyApp->keyboard->kb5) && childexist)
        {
                windowchild->setvisible();
                buttonHide->enable();
                buttonShow->disable();
        }

        // When Disable button is pressed or key 1 is pressed
        if ((buttonDisable->ispressed() || MyApp->keyboard->kb1) && childexist)
        {
                windowchild->disable();
                buttonDisable->disable();
                buttonEnable->enable();
        }

        // When Enable button is pressed or key 2 is pressed
        if ((buttonEnable->ispressed() || MyApp->keyboard->kb2) && childexist)
        {
                windowchild->enable();
                buttonDisable->enable();
                buttonEnable->disable();
        }
    }

    return 0;
}


As usual, very open to feedback and ideas for future developments.

Many developments are still planed, but maybe do you have some specific ideas and interest or needs for your own apps.
Do not hesitate to try the toolkit for your developments and give me feedbacks,

Ciao

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude SlyVTT » 14 Mar 2021, 16:25

Hi All,

very happy to announce the revision 0.5beta.
it can be downloaded here https://tiplanet.org/modules/archives/download.php?id=2709940.

Among the new developments :
- we can get a keyboard handler from the Toolkit (able to work in parallel with SDL)
- we can get a mouse handler from the Toolkit (able to work in parallel with SDL)
- we can ask the Toolkit to provide a rendering context (a SDL_surface pointer)
- added some improved destructors for the widgets and collections, avoiding memory leaks ... Maybe some improvement, debugging to be done, but without a proper emulator for nSpire CX II, it is a bit complex
- many other things ...

and this is illustrated by a revision of the example #3 :
Image
we can now delete the childwindow, and recreate it, and rekill it ... I guess you understand the concept :D

and by a new example #4 showing how to use the toolkit in a game engine using SDL, with minimum modifications ..;
This example demonstrate how to use the GUI toolkit in a SDL game. The example is based on the "Link SDL" from Christoffer Rehn and included in the example folder of the Ndless SDK.
Only the main file (called Link.c) has been slightly changed in comparison with the original one. This program demonstrate how one can ask for a rendering context from the Toolkit, for a mouse and keyboard handler (that can both work in parallel of SDL routines) and some other interesting stuffs...
It is a kind of PoC for using the toolkit as an interface for games.

This is how it looks like with the default colors :

Image Image

while the following two pictures show when colors are changed in the ColorEngine::setdefaultcolorpreset() method (see below for the corresponding code). It gives a better smell of Hyrule ... :

Image Image

As usual everything can be found here : https://github.com/SlyVTT/Widget-for-TI-NSpire and in the corresponding Wiki : https://github.com/SlyVTT/Widget-for-TI-NSpire/wiki/Some-more-complex-examples-of-the-GUI-Toolkit-in-action

Ciao

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude Adriweb » 14 Mar 2021, 17:22

That's pretty awesome, i love that last example with the Hyrule look :)
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80%
 
Messages: 14599
Images: 1216
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: GUI toolkit under development

Message non lude SlyVTT » 19 Mar 2021, 20:45

Hello Everybody,

this week was a bit challenging, few time was available for developing the GUI Toolkit, nevertheless, some changes have been made :
- addition of the RadioControl widget
- addition of the Commuter widget
- addition of the ProgressBar widget

Some flavor of this week additions with the following pictures taken from the current rev (0.6 is planed for soon) :

Image Image Image
Image Image Image

But maybe most important, I started to create decent documentation through the code and using Doxygen.

It will be located here : https://slyvtt.github.io

This is far from being finished, but an example of target documentation is available for ButtonWidget here https://slyvtt.github.io/Documentation/html/class_button_widget.html and for CheckBoxWIdget here https://slyvtt.github.io/Documentation/html/class_check_box_widget.html.

For sure it takes time, but as I take the opportunity to review the full code and develop dully documented application examples, I guess it will be profitable to everybody who may interested in using the GUI Toolkit.

That's all for today ...

Ciao

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude SlyVTT » 21 Mar 2021, 21:40

Hello All,

Not the funniest part of the job done over the weekend but happy to have spent some time on this ...
Many time spent on investigating and on fine tuning the code to get a fully clean compile : no error :error: (this is mandatory) but most important, no more warning /!\ (each of them has been resolved, one by one, modifying some portions of the code to have clean routines).
I have to admit that GCC/G++ is very powerful for detecting possible issues in the code and its warning system is very accurate and helpful.

This is my terminal output at compile time :

Show/Hide spoilerAfficher/Masquer le spoiler
rm -f ./ExampleGUIToolkit.o ./Toolkit/ColorEngine.o ./Toolkit/ContainerVWidget.o ./Toolkit/Widget.o ./Toolkit/RadioControlWidget.o ./Toolkit/ContainerHWidget.o ./Toolkit/InputWidget.o ./Toolkit/WindowWidget.o ./Toolkit/WidgetApplication.o ./Toolkit/ProgressBarWidget.o ./Toolkit/MiniButtonWidget.o ./Toolkit/ButtonWidget.o ./Toolkit/KeyboardTask.o ./Toolkit/CommuterWidget.o ./Toolkit/LabelWidget.o ./Toolkit/SliderWidget.o ./Toolkit/FrameWidget.o ./Toolkit/CursorTask.o ./Toolkit/CheckBoxWidget.o ./Toolkit/DesktopWidget.o ./Toolkit/FontEngine.o ./Widgets.tns ./Widgets.elf ./Widgets.zehn
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c ExampleGUIToolkit.cpp -o ExampleGUIToolkit.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/ColorEngine.cpp -o Toolkit/ColorEngine.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/ContainerVWidget.cpp -o Toolkit/ContainerVWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/Widget.cpp -o Toolkit/Widget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/RadioControlWidget.cpp -o Toolkit/RadioControlWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/ContainerHWidget.cpp -o Toolkit/ContainerHWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/InputWidget.cpp -o Toolkit/InputWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/WindowWidget.cpp -o Toolkit/WindowWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/WidgetApplication.cpp -o Toolkit/WidgetApplication.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/ProgressBarWidget.cpp -o Toolkit/ProgressBarWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/MiniButtonWidget.cpp -o Toolkit/MiniButtonWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/ButtonWidget.cpp -o Toolkit/ButtonWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/KeyboardTask.cpp -o Toolkit/KeyboardTask.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/CommuterWidget.cpp -o Toolkit/CommuterWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/LabelWidget.cpp -o Toolkit/LabelWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/SliderWidget.cpp -o Toolkit/SliderWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/FrameWidget.cpp -o Toolkit/FrameWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/CursorTask.cpp -o Toolkit/CursorTask.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/CheckBoxWidget.cpp -o Toolkit/CheckBoxWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/DesktopWidget.cpp -o Toolkit/DesktopWidget.o
nspire-g++ -Wall -W -marm -Wunused-variable -Wunused-parameter -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -Os -c Toolkit/FontEngine.cpp -o Toolkit/FontEngine.o
mkdir -p .
nspire-ld ExampleGUIToolkit.o Toolkit/ColorEngine.o Toolkit/ContainerVWidget.o Toolkit/Widget.o Toolkit/RadioControlWidget.o Toolkit/ContainerHWidget.o Toolkit/InputWidget.o Toolkit/WindowWidget.o Toolkit/WidgetApplication.o Toolkit/ProgressBarWidget.o Toolkit/MiniButtonWidget.o Toolkit/ButtonWidget.o Toolkit/KeyboardTask.o Toolkit/CommuterWidget.o Toolkit/LabelWidget.o Toolkit/SliderWidget.o Toolkit/FrameWidget.o Toolkit/CursorTask.o Toolkit/CheckBoxWidget.o Toolkit/DesktopWidget.o Toolkit/FontEngine.o -o Widgets.elf -Wl,--gc-sections
genzehn --input Widgets.elf --output Widgets.tns.zehn --name "Widgets"
make-prg Widgets.tns.zehn Widgets.tns
rm Widgets.tns.zehn


Good to see that it is not shouting on me anymore B-) .

The base of the Toolkit is now clean (there are still some parts here and there that I would like to rewrite for improving performance and/or for easier read) but as of today, it is robust enough.
This is an important milestone.

My goal for next week is to be able to release rev 0.6beta as per the project roadmap, so still some "not so interesting" things to do.

Wish you all a good week.

Cheers

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude SlyVTT » 28 Mar 2021, 17:43

Hello All,

this place has now the shape of a developer's vlog, don't know if you like this ;)

This week many things have changed and the revision 0.58 & 0.59 have been published. This means we are very close to rev 0.60, but not fully reached the objective yet, there are still some little bugs hidden in the code and now some time is needed to fix them all.

The main achievements for this week are :
- first some new widgets are now available :
1- SpacerWidget : a fully "blank" widget that do nothing except using space, very helpful for optimizing the layout of some forms
2- ListBoxWidget : a list of items that can be navigated with Up and Down, escaped with ESC and validated with ENTER
3- DropBoxWidget : a dropbox list (works in connection with a MiniButtonWidget and a ListBoxWidget), and I am very happy with this new widget cause the development was not a piece of cake and the main widget class has been significantly improved to support this new DropBoxWidget. Up to now it was not possible to have some Widgets or some parts of Widget "poping up" on the screen, now it can be done and is applied with the DropBoxWidget when the ListBox is dropped/undropped.

- second, many work has been done on making the GUI Toolkit fully "themable". A new class as been added (ThemeEngine) which works in agreement with the ColorEngine and FontEngine classes and the rendering methods. Not so difficult, but damn long to update all the widgets accordingly.

As usual, some pictures are following, with a DropBoxWidget used to change the theme of the interface. 3 themes are available (I need to admit I have to check more accurately if the colors are fully OK in each theme config file) :
- Normal theme (=default one) : note this one is in a CFG file and is also hardcoded in the Theme/Color/FontEngine (just in case of problem)
- Dark theme : as explicitely said by its name, uses dark color pattern
- Hyrule : this is a transcription of the theme I used for the Link-SDL/GUI Toolkit integration (see some post above).

Default theme: DropBoxWidget demo:
Image Image Image

Dark theme:
Image Image Image

Hyrule theme:
Image Image Image

And back to default theme (using the hard coded version of the Normal theme)
Image Image

The code for this little example is the following one :

Code: Tout sélectionner
#include "Toolkit/GUIToolkit.h"


int main ( void )
{
    bool done = false;

    WidgetApplication *MyApp = new WidgetApplication();
    MyApp->setuniformbackgroundcolor(100, 100, 100);

    DesktopWidget *desktop1 = new DesktopWidget( (char*) "First Desktop", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, nullptr );

    WindowWidget *window = new WindowWidget( (char*) "Examples of DropBox & Themes", 5, 5, 310, 160, desktop1 );
    ContainerVWidget *containervert = new ContainerVWidget( (char*) "container", 1, 1, 1, 1, window );

    // this is the new DropBow Widget
    DropBoxWidget *mydropbox = new DropBoxWidget( (char*) "Test Drop", 1, 1, 1, 1, containervert );

    // this is a spacer widget (blank one, do nothing, jsut for the layout)
    // note , this may disappear if contraint layout is implemented in later revisions
    SpacerWidget *spacer1 = new SpacerWidget( (char*) "Spacer1", 1, 1, 1, 1, containervert );
    SpacerWidget *spacer2 = new SpacerWidget( (char*) "Spacer2", 1, 1, 1, 1, containervert );
    SpacerWidget *spacer3 = new SpacerWidget( (char*) "Spacer3", 1, 1, 1, 1, containervert );

    ContainerHWidget *containerH = new ContainerHWidget( (char*) "containerH", 1, 1, 1, 1, containervert );

    SpacerWidget *spacer1H = new SpacerWidget( (char*) "Spacer1", 1, 1, 1, 1, containerH );
    ButtonWidget *buttonQuit = new ButtonWidget( (char*) "Quit !!", 1, 1, 1, 1, containerH );
    SpacerWidget *spacer2H = new SpacerWidget( (char*) "Spacer2", 1, 1, 1, 1, containerH );

    // We ask for an automatic positioning of the widgets in the grid
    // Note : this will fully override the dimensions given to the Widgets manually
    window->adjust();

    MyApp->addchild( desktop1 );


    // We fill the list of the dropbox with items to be selectable by the user
    mydropbox->additem( (char*) "Default GUI Toolkit Theme" );
    mydropbox->additem( (char*) "Bright GUI Toolkit Theme" );
    mydropbox->additem( (char*) "Dark GUI Toolkit Theme" );
    mydropbox->additem( (char*) "Hyrule GUI Toolkit Theme" );


    // We need to init the theme engine, by default, this is not done at startup to save memory
    MyApp->initthemeengine();
    // We apply the default theme while using theme (this is for safe use and avoid any risk of crash)
    MyApp->setdefaulttheme();

    KeyboardTask *keyboard = MyApp->getkeyboardhandler();

    // We render the app for the first time so what we can see what's happening on the screen
    MyApp->render();


    while (!done)
    {

        MyApp->logic();

        // Check if the dropbox has been updated by the user and if there is actually something selected (-1 means no selection yet
        if (mydropbox->isupdated() && (mydropbox->getselected()!=-1))
        {
            if (mydropbox->getselected() == 0)
            {
                // We reset the theme to default
                MyApp->setdefaulttheme();
            }
            if (mydropbox->getselected() == 1)
            {
                // We load a theme file and aply it on-the-fly
                // the theme NrmClr.CFG.tns is the default theme
                MyApp->loadtheme( (char*) "/documents/widget/Themes/NrmClr.CFG.tns" );
            }
            if (mydropbox->getselected() == 2)
            {
                // We load a theme file and aply it on-the-fly
                // the theme DrkClr.CFG.tns is the dark theme
                MyApp->loadtheme( (char*) "/documents/widget/Themes/DrkClr.CFG.tns" );
            }
            if (mydropbox->getselected() == 3)
            {
                // We load a theme file and aply it on-the-fly
                // the theme Hyrule.CFG.tns is the theme used is the LinkSDL example (put in a theme file)
                MyApp->loadtheme( (char*) "/documents/widget/Themes/Hyrule.CFG.tns" );
            }
        }

        // As usual, Quit is pressed or the magic keyboard shortcut is activated (CTRL+ESC)
        if ((keyboard->kbCTRL && keyboard->kbESC) || buttonQuit->ispressed()) done = true;

    }

    return 0;
}



Everything has been uploaded on the GitHub repository. Please note that the documentation has not been updated yet (this is still ongoing and new stuff has not been put into Doxygen format yet). This is Damn long to write a (I hope) good and clear documentation.

As always, please feel free to give your comments/suggestion and to report bugs.

Ciao

Sly
Dernière édition par SlyVTT le 02 Avr 2021, 19:39, édité 2 fois.
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude SlyVTT » 01 Avr 2021, 14:49

Hello,

The toolkit has now reached revision 0.6.

It can be downloaded here : http://ti-pla.net/a2719174

An application demo can be downloaded here : http://ti-pla.net/a2719173
This is a dummy application that uses the main widget controls and the last functionalities of the GUI Toolkit.
This is just for testing purpose and demonstrate what it can actually do.

Revision 0.6 is a major release including the following improvements and additional features :
- windows can be enlarged/reduced and all widget sizes are recalculated automatically (positions and dimensions)
- windows can be moved on the screen
- the SCRATCHPAD key can be used for "mouse click" cause sometime using just the Touchpad Click + move is challenging
- the application can be fully "themeable" - 3 themes are included (Normal / Dark / Hyrule)
- widget textual content is adjusted to fit the size of the widgets
- ... and many more

You can see the project roadmap here : https://github.com/SlyVTT/Widget-for-TI-NSpire/projects/1

As usual a bunch for screenshots follows :

Image Image Image

Image Image Image

Please give your feedbacks and let me know if applications of the toolkit can be envisaged for some applications.

Ciao

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 42.9%
 
Messages: 481
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: GUI toolkit under development

Message non lude Adriweb » 01 Avr 2021, 19:22

Good progress as usual :)
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80%
 
Messages: 14599
Images: 1216
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

PrécédenteSuivante

Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 5 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
838 utilisateurs:
>817 invités
>15 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)