Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: Nick on November 27, 2011, 01:24:39 pm

Title: To Do manager
Post by: Nick on November 27, 2011, 01:24:39 pm
in a hurry i started writing a kind of To Do manager for the nspire.
I felt like, wow, i haven't seen many apps for this calc  :w00t: , let's write one  ;D as i didn't felt the power to work on tetris...

now i'm just giving it some extra lay-out and a function to delete item per item, for now you can only delete them all together

you can store as many to do's as you want, and scrolling makes you see them all (not with multiple pages, all on 1) you can see this in the screenshot, release for tonight i think



i notice i did write heven't xp i never saw it during the "filming", so don't laugh at me for that xp
Title: Re: To Do manager
Post by: Jim Bauwens on November 27, 2011, 01:26:27 pm
Very nice :)
Title: Re: To Do manager
Post by: Adriweb on November 27, 2011, 02:21:07 pm
This is really nice indeed, the overall is graphically great :D

Also, why such short description ... ?
Title: Re: To Do manager
Post by: Nick on November 27, 2011, 02:29:43 pm
thx, well, i don't really know how to make it possible to have multiple lines (for drawing reasons). When is display it, it would have to know when it has to start a new row, and then the total lay-out will be f***ed up... so if you know how, tell me, it would certainly improve it (by now the description must be 30 chars long, instead of 20 in the movie)
Title: Re: To Do manager
Post by: renatose on November 27, 2011, 07:08:22 pm
hmm... I can see some usefulness on this, good job nick!
Title: Re: To Do manager
Post by: Jim Bauwens on November 28, 2011, 03:21:48 am
thx, well, i don't really know how to make it possible to have multiple lines (for drawing reasons). When is display it, it would have to know when it has to start a new row, and then the total lay-out will be f***ed up... so if you know how, tell me, it would certainly improve it (by now the description must be 30 chars long, instead of 20 in the movie)

I think [lua]gc:getStringWidth[/lua] will be a big help :)
What you should do is split the sentence in chunks of words (by splitting by space). Then make a variable to store the text in.
Make a loop were you check the size of the variable plus the next word (using the above function). If its bigger than the screen width ([lua]platform.window:width[/lua]), print the variable and start a new sentence with the next word.
That way you will be able to nicely print stuff :)

(of course it is a bit more hard than what I write, but I think you will get it)
Title: Re: To Do manager
Post by: Nick on November 28, 2011, 03:32:27 am
brr xp well,i certainly give it a try, then it could be used as a notepad too, what would be very usefull...
Title: Re: To Do manager
Post by: Chockosta on November 28, 2011, 12:13:11 pm
Nice program ! (even if I don't use my calc to remember things)

BTW, I've already used Jim's method, it's not really hard to do.
Title: Re: To Do manager
Post by: Nick on November 28, 2011, 03:31:02 pm
i've tried over 10.000 possibilities, but it still does not work for some mysterious reasons :'( this is my code:
Code: [Select]
text = "Hello there, something has to be written here"
temptext = text
tempsentence = ""
textsave = ""
drawtext = ""
sentnr = 1

function on.paint(gc)
for i=1,string.len(text) do
if string.sub(text,i,i+1)==" " then
gc:drawString("space",0,180,"top")
tempsentence = tempsentence..string.sub(temptext,0,i)
end
if string.len(tempsentence)==20 then
gc:drawString("20",160,180,"top")
gc:drawString(tempsentence,0,10*sentnr,"top")
temptext = string.sub(temptext,20,string.len(temptext)-20)
sentnr = sentnr+1
tempsentence = ""
end
end
end

it uses string.len() for now, just to make it work, i will change this if it works...
i've placed those "space" and "20" drawstrings to see if it passes them, and they just won't appear, but it loops the for, so something has to be wrong with that string.sub(text,i,i+1)

But now the nice stuff:
Editting the note works, you can now fully adapt the note when stored, even the priority can be changed!
scrolling improved (maybe i'll ad a sidebar)
Title: Re: To Do manager
Post by: Nick on November 28, 2011, 08:50:51 pm
a revolution has changed this manager a lot!
now it has live wordwrapping, see screenie, and a fully unlimited description.
so now every entry has: a title (max 30 chars), a priority (1-5) and a description (unlimited, only limited by screensize as it doesn't scroll...)

maybe i should change the name of the program, as it's starting to look more like a text editor :)

--edit--
i just saw some pixels on the left side of the screen seem to be cut off, but you can read the letters completely irl
Title: Re: To Do manager
Post by: epic7 on November 28, 2011, 08:55:13 pm
i've tried over 10.000 possibilities, but it still does not work for some mysterious reasons
Over 10?
Title: Re: To Do manager
Post by: Nick on November 28, 2011, 08:59:30 pm
ten thousand i mean... but it's fixed, as you can see in the screenie
Title: Re: To Do manager
Post by: Jim Bauwens on November 29, 2011, 03:51:49 am
Looks good, glad you managed to solve it :)
If you want scrolling, you should also split by newlines (before you split by spaces). You also need to count the lines made by word wrapping.
Title: Re: To Do manager
Post by: Nick on November 30, 2011, 07:45:49 pm
Here it is, nearly downloadable (as soon as it gets approved)

a totally new app for the ti-Nspire
now you can save task, each with a title, description and priority!

simple, but good GUI

download here (http://www.omnimaga.org/index.php?action=downloads;sa=downfile&id=753)

(http://img.removedfromgame.com/imgs/ToDoManager.gif)
Title: Re: To Do manager
Post by: Adriweb on December 01, 2011, 06:26:59 am
Congratulations !

I added it on TI-Planet.org here (http://tiplanet.org/forum/archives_voir.php?id=3816&play=).



By the way, attached is the version with both English and French, and with reduced lua (thus .tns) source size (by optimizing the TI.Images).
(this is the version uploaded on tiplanet)
Title: Re: To Do manager
Post by: Nick on December 01, 2011, 06:42:04 am
wow, thanks for that, it's like 2 kB less, how did you do that? it might be usefull for my other projects too...
Title: Re: To Do manager
Post by: Adriweb on December 01, 2011, 07:43:19 am
Just replace the \000 by \0 in the TI.Image big strings  :)
Title: Re: To Do manager
Post by: Jim Bauwens on December 02, 2011, 04:42:08 am
I should rewrite my sprite editor to do those optimizations :)