Jump to content



Photo

Cplua Project: Cpluaui


  • Please log in to reply
12 replies to this topic

#1 narmo

narmo

    Newbie

  • Members
  • Pip
  • 7 posts
  • Location:Poland

  • Calculators:
    Classpad

    CFX-9850GB plus

Posted 27 November 2005 - 06:48 PM

CPLuaUI is a library designed for creating user interfaces for CPLua scripts. Currently possible widgets (window gadgets :) ) are: Text, Input, Option, Button and Checkbox. Manual is in readme file, but I recommend to study example file. My English is not very good, so feel free to improve readme file - I will include you in thanks :P . you can download the newest version here: tar.bz2 file 15 KiB or zip file 17 KiB. It is under GNU GPL licence so you can change and redistribute it.

#2 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 27 November 2005 - 07:04 PM

Good job Macieju!!!
Teraz ciekaw jestem jakie to wzbudzi zainteresowanie. Bede tu chyba lookal codziennie...

#3 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 27 November 2005 - 07:05 PM

Yikes - One of the main improvements of CPLua 0.8 was the possibility to create a complete UI system for CPLua... :o But thanks antway, I will take a look at your code; maybe it will be interesting to convert it in C++ later ;)

#4 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 27 November 2005 - 07:10 PM

Yikes - One of the main improvements of CPLua 0.8 was the possibility to create a complete UI system for CPLua... :o But thanks antway, I will take a look at your code; maybe it will be interesting to convert it in C++ later ;)


Where? How?? When???? :huh:
Why those 'small' always get news at the end.... :(
Manual or anything is needed....

#5 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 27 November 2005 - 07:28 PM

CPLua 0.8 is currently under development (I released CPLua 0.8B again today), so there is no real documentation for it... Anyways, this is a kind of things that does not really concerns the user, but rather CPLua developpers :unsure:
I'm planning to make the source code (or at least a part of it) available soon, so if someone is interested in the development of a new package he will just have to ask me.

I tried the example, and (fortunately?) this is not what I had in mind :rolleyes:
With the new structure of CPLua it should be possible to create real windows, buttons and many other widgets, thus we can do even more than that ;)

#6 narmo

narmo

    Newbie

  • Members
  • Pip
  • 7 posts
  • Location:Poland

  • Calculators:
    Classpad

    CFX-9850GB plus

Posted 27 November 2005 - 07:58 PM

Anyways, this is a kind of things that does not really concerns the user, but rather CPLua developpers I'm planning to make the source code (or at least a part of it) available soon, so if someone is interested in the development of a new package he will just have to ask me.

Does it mean, that GUI elements won't be in documentation and only way to find it is to search the source code of CPLua, which isn't freely accessible yet?

I tried the example, and (fortunately?) this is not what I had in mind :rolleyes:
With the new structure of CPLua it should be possible to create real windows, buttons and many other widgets, thus we can do even more than that ;)


Yes, it wasn't worth to create a real GUI in LUA, but my code IMO works good enough. So I'll wait for stable release of CPLua 0.8, you may consider using some of my ideas (creating objects from classes, function executed in a "real time" or just after changing value in widget, possibility of moving around widgets with keyboard)

#7 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 27 November 2005 - 08:18 PM

Does it mean, that GUI elements won't be in documentation and only way to find it is to search the source code of CPLua, which isn't freely accessible yet?

No, it means that it is now possible to create a new package in C++ for CPLua, which will give the possibility to Lua users to define some real windows and widgets and to use them in their programs. ;) Such a thing was not possible before, because CPLua could only manage the console window and the graph window; now there is no limitation anymore on the numbers and kind of windows that CPLua can handle ^_^

Yes, it wasn't worth to create a real GUI in LUA, but my code IMO works good enough. So I'll wait for stable release of CPLua 0.8, you may consider using some of my ideas (creating objects from classes, function executed in a "real time" or just after changing value in widget, possibility of moving around widgets with keyboard)

The way you organized your library is similar to the structure that I already had in mind (except that using the pen should be more confortable than using the keyboard ;) - in CPLua 0.8B you can now use getpen() in the console window too)

#8 narmo

narmo

    Newbie

  • Members
  • Pip
  • 7 posts
  • Location:Poland

  • Calculators:
    Classpad

    CFX-9850GB plus

Posted 27 November 2005 - 08:46 PM

The way you organized your library is similar to the structure that I already had in mind (except that using the pen should be more confortable than using the keyboard ;) - in CPLua 0.8B you can now use getpen() in the console window too)

I like keyboard :D It would be great if user can use both keys and pen - something like using tab on PC instead of mouse. But I understand that it may be difficult to implement.

#9 narmo

narmo

    Newbie

  • Members
  • Pip
  • 7 posts
  • Location:Poland

  • Calculators:
    Classpad

    CFX-9850GB plus

Posted 27 November 2005 - 10:08 PM

Finally I've found where you had written about the GUI.

the new structure makes it really easy to create some other kinds of window if we want, for example for the CAS's 2D display or for 3D graphics etc.


So it will be possible to create window with 3D graph or spreadsheet and manipulate it (ie. fill cells in spreadsheet, calculate regression and integral of this regression) from lua? It would be wonderful!

#10 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 27 November 2005 - 10:22 PM

I don't think that the spreadsheet will be available in Lua (I can't see any function in the SDK to do that) :(
However it should be possible to create a custom window for 3D graphs (but not the standard window of the CP), and a "special window type" containing widgets specified in a Lua program (like in your example) ;)

#11 unique33

unique33

    Casio Freak

  • Possibly hacked
  • PipPipPipPip
  • 229 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    classpad 300 , fx5500

Posted 28 November 2005 - 02:46 AM

when I use Interface:Button -> action :doscript
it does not work as expected

the called program does not end by itself and if I press the K_EXE then the Called program executes agian
So the menu is not reachable !

Is it possible to have to column selective bottons?

column1 ...... column2
------------------------------
botton1 ...... botton1
botton2 ...... botton2
botton3 ...... botton3
botton4 ...... botton4
botton5 ...... botton5

#12 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 681 posts
  • Gender:Male
  • Location:Somewhere in Europe.
  • Interests:Computer Algebra, Numerical Analysis.

  • Calculators:
    ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 28 November 2005 - 03:01 PM

So it will be possible to create window with 3D graph or spreadsheet and manipulate it (ie. fill cells in spreadsheet, calculate regression and integral of this regression) from lua? It would be wonderful!

Like Orwell said, the spreadsheet will not be available in CPLua. However, regressions and integrals are already available. These are CAS commands, so they can be called by using the "cas" package. The only "problem" is that statistical computations in ClassPad are implemented as commands, not functions. This means that you need to call a statistical command, then access system variables to get the results, just as in CP Basic (this is a CP peculiarity, and has nothing to do with CPLua). For example, the code
require("cas")

cas("OnePropZTest \">\",0.5,15,40")

probability=cas("approx(prob)")
performs a one-sample, one-tail hypothesis test of a percentage. The first CAS command calls CP's statistical command "OnePropZTest". After that, the system variable "prob" holds the result (in this example, the so-called "p-value"). Then, the second CAS command assigns the result to a CPLua variable named "probability". In other words, you always need a couple of CPLua statements in order to perform statistical computations. See the appendix of the CP manual for details about system variables returned by statistical commands.

#13 narmo

narmo

    Newbie

  • Members
  • Pip
  • 7 posts
  • Location:Poland

  • Calculators:
    Classpad

    CFX-9850GB plus

Posted 28 November 2005 - 11:48 PM

when I use Interface:Button -> action :doscript
it does not work as expected

You can't set as an action a function which requires arguments. So
addWidget ("Button", {action = doscript}
is wrong and
addWidget ("Button", {action = function () doscript ("cat/file", {args}) end})
is correct

the called program does not end by itself and if I press the K_EXE then the Called program executes agian
So the menu is not reachable !

Yeah, I know, I'll fix it in the future. Currently moving cursor clears and redraws screen.

Is it possible to have to column selective bottons?

column1 ...... column2
------------------------------
botton1 ...... botton1
botton2 ...... botton2
botton3 ...... botton3
botton4 ...... botton4
botton5 ...... botton5

Currently not, maybe in future.

PAP, thanks for help, I'll read about it. Currently I'm looking for a way to speed up work with spreadsheet, but since it's not possible in LUA i'll stay with what I have.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users