Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Goran on August 07, 2013, 09:58:22 am

Title: documentation on ETK API?
Post by: Goran on August 07, 2013, 09:58:22 am
Hello,

Is there any API documentation for ETK?

I currently go through the code itself, I made a cetrain progress in using it, but anyway I have some doubts that can be removed in this way only after I go 100% through to grasp all the concepts.

Best regards,
Gooran
Title: Re: documentation on ETK API?
Post by: Adriweb on August 07, 2013, 03:08:10 pm
Hi,

We (Jim Bauwens and I) haven't released what we can call an official documentation (we'll probably do that for version 3, though !), however learning by examples isn't bad neither :
I advise you to download this demo document :
http://tiplanet.org/forum/archives_voir.php?id=9275
in which the princples of ETK are showed.

And, well, of course, FormulaPro (https://github.com/adriweb/EEPro-for-Nspire) which uses it extensively...
Title: Re: documentation on ETK API?
Post by: Goran on August 07, 2013, 04:03:29 pm
Thanx adriweb,

FormulaPro is the exact script I am learning from. On the other hand, I see now in the mentioned demo additional nice widgets! (as I am currently at vacation without my development environment, peeking into demo will have to wait for few days).

Maybe for now only one question:

Is it meant that WScreen has at least one child widget? The reason for question is the following: originally I had a graphical editor that, after discovery of ETK, I have "embeded" into a WScreen.
On PC everything works as planned (Moving, flipping, rotating, editing, connecting of graphical elements).
When I downloaded the app to the handheld, everything worked ok except connecting two elements: I grab the first point, drag a line to the second point, but I cannot make connection on "release" action (mouseUp).

Then I looked to ETK code, and thought maybe the handling of mouseUp event would be correct if I had put the whole graphical editor into a child screen widget? Or I talk rubbish?

Regards,
Goran
Title: Re: documentation on ETK API?
Post by: Adriweb on August 08, 2013, 07:21:35 am
Hmm, on the demo code, the Main screen is defined as : Main = WScreen(), and usual init stuff.

You can see the code directly here :
http://pastebin.com/1Yv7EvC9

Starting code really starts at line ~ 1760.


The problem you describe with things working on the computer software but not on the handheld seems weird though :o
What OS versions are you using ?
Have you checked that all the needed platform.window:invalidate() are here, just in case ?
Title: Re: documentation on ETK API?
Post by: Goran on August 08, 2013, 09:49:33 am
Thanks for the link, I will go into it soon.

I use 3.2.3.1233 on the handheld.

Regarding invalidite() calls, I'll check them thoroghfully again when I return home. Nevertheless, good you mentioned them, I've also noticed that in the software (after one operation) the screen is refreshed immediatelly, while on the handheld I have to move the mouse first. Why this difference? Is there a list of differnces that are considered as normal when running an app in software and on the handheld?

Secondly, whenever I want mouse cursor to appear at the handheld, I have to scroll across the touchpad for 1-2 seconds before the cursor appears, what is a bit annoying, especially if you compare it with the prompt response in the software; also in software the cursor is always on, while on handheld it dissapears after several seconds of inactivity; which means that when I operate upon the elements on the screen, I constantly have to scroll around the touchpad to get the cursor first. This is the general behavior, not just within my app. Is there a way to improve here anything?

Thirdly, what is/are keystrokes on the handheld that are equivalent to releasing mouse left button in software?
On my side I will have to check again my code where I was messing around with on.charIn, on.mouseDown, on.mouseUp and on.mouseMove functions.

Regards and thanks,
Goran

Title: Re: documentation on ETK API?
Post by: Jim Bauwens on August 09, 2013, 12:37:34 pm
Yes, be sure to invalidate your screen if you want your application to be updated. On the PC/Mac software this happens very much without needing to invalidate yourself, so your application might seem to work properly on the computer software but not on the handheld. Also moving your mouse on the handheld might trigger invalidation of the screen (causing it to update). So just invalidate your screen when you want it to update.

Sadly enough we can't change how the cursor reacts. It's indeed quite horrid how it works now.

Normally on.mouseUp should be called when releasing the left mouse button on the handheld.