Jump to content



Photo

Project: Cplua


  • Please log in to reply
858 replies to this topic

#721 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 04 October 2006 - 07:10 PM

Aaah, THAT is the reason for the strange behavior I have experienced: you run LNAtest/Maketests (which uses doscript()), then the source file is deleted :cry:.

#722 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 04 October 2006 - 07:25 PM

:huh: Huh?
Well I'm talking about dostring() here, not doscript(), but I don't know how your file could have been deleted with doscript()... :blink:

#723 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 04 October 2006 - 07:36 PM

Ooops... my bad :banghead:.
However, I have seen this happening once, and I'm sure it was not my mistake. I can't reproduce that behavior though.

#724 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 06 October 2006 - 05:43 PM

Oh, there is still the focus problem with ui.lineedit :( When I create a line edit, I can't type anything in it, even if I put edit=true :blink:

And btw, I made a starting image for CPLua, how do you find it? :)

Posted Image

As it takes time to start, you could put this at startup.

#725 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 06 October 2006 - 09:14 PM

And btw, I made a starting image for CPLua, how do you find it? :)
As it takes time to start, you could put this at startup.

Nice picture. There are icons showing a folder, a game (the well-known "brickout"), and some things that remind me my LNA library: a square root, and a graph. I like it, but I have some remarks: you should show an integral, instead of a square root, and the moon in the Lua logo should be full ;).

#726 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 07 October 2006 - 07:49 AM

:)

Posted Image

#727 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 07 October 2006 - 08:43 AM

Much better. However, starting CPLua doesn't take too much time; the user will see that "splash" picture for one second or so...
As far as I know, adding a picture doesn't spend user's available memory, but if it does, then it shouldn't be added. However, Orwell will say the last word.

#728 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 08 October 2006 - 11:48 PM

@Orwell: how to make 2 window appear in the same time like other build-in app.

#729 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 09 October 2006 - 08:17 AM

With CPLua? It isn't possible now.

But this was a personal choice (I don't really like the CP's look & feel :P), do you think it is really useful to be able to edit 2 programs on the same screen? :unsure:
I didn't designed the application in that way, but if several people are interested...
However I really don't know how we could manage the edited programs between the 2 possible views, because you can't drag a tab from a notebook and drop it to another one... Any suggestion? :blink:

#730 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 09 October 2006 - 11:02 AM

It's difficult... But i need it, i hope we can have that in the next ver. of CPLua.

One more thing: interactive should improve.

#731 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 09 October 2006 - 12:35 PM

It's difficult... But i need it, i hope we can have that in the next ver. of CPLua.

Please consider the fact that it is a real headache to implement, I don't want to spend time and efforts for something that won't be really useful for most people. <_< Let's see if the same thing is asked by several other people.

I allways receive some general suggestions about "what" people want, but noone tell me "how" they would like it to be implemented. You want to be able to view 2 programs at the same time? Okay, tell me what commands I should add to the menu to manage a potential second window, how I will share the opened programs between the 2 windows, etc.
I must allways imagine everything by myself and try to guess how the users would like to see it. Of course I do it in the most suitable way from my point of view, but people do not all think like me, and this is perfectly normal. Once again, I need more precisions to know how people would like things to be implemented. This is the only way to make something that most people will like :(
I know it's a part of the engineer's work too to ask the client what he exactly wants, how he wants it, and make some suggestions, but I don't really have time here to make several implementations and let you choose the best. I don't need specifications on the code I will have to write, I need more indications about what controls/actions/commands you would like to have in CPLua and how you would like to have access to it (menu, button, ... ?).
Just make some (precise) suggestions, and I will tell you what can be done, and what cannot. :)

One more thing: interactive should improve.

Same remark.
Improve how?

#732 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 09 October 2006 - 01:15 PM

We can make function that can use in the interactive.

#733 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 09 October 2006 - 04:12 PM

:knife:

#734 The_AFX_Master

The_AFX_Master

    Casio Overlord

  • [Legends]
  • PipPipPipPipPipPipPip
  • 519 posts
  • Gender:Male
  • Location:Black Mesa Research Facility (sector C)
  • Interests:BASIC +FORTRAN 90+ C++.....and HALF LIFE

  • Calculators:
    Casio Algebra FX 2.0 Plus, Casio fx 570 ms, Classpad 300, And a crowbar

Posted 09 October 2006 - 06:25 PM

Vanhoa :knife: Orwell

Counter Terrorists Win!
the emoticon is just the headshot ones on CS1.5

#735 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 10 October 2006 - 12:13 AM

:blink:

#736 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 10 October 2006 - 08:05 AM

We can make function that can use in the interactive.

What kind of functions? Basic? Lua? others?
How would we have access to it?
Give me more precisions! A single sentence is not enough. :angry:

#737 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 10 October 2006 - 01:34 PM

We should make a source program with name "funcs" for example. That source program cant delete but can edit. In it we can write functions to use.

One more suggestion: Math Window must be included, the inter active should have 2 module: console and graph. You can image, just like "run-mat" of Afx or fx.

#738 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 10 October 2006 - 03:27 PM

I actually need something, but maybe it's impossible now... :P If you still have CPLua 0.8 source code, could you release a stable version which doesn't have memory leaks at all, and maybe with the function dostring() ?


:hammer:

#739 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 10 October 2006 - 06:13 PM

We should make a source program with name "funcs" for example. That source program cant delete but can edit. In it we can write functions to use.

Well, all Lua functions can be used in interactive mode too... That means that require(), doscript() etc can be used in interactive mode as well to execute some Lua functions saved into files :unsure:
I'm not sure I really understand what you want :blink: Please try to be more clear.

the inter active should have 2 module: console and graph. You can image, just like "run-mat" of Afx or fx.

It's already the case: you just have to call showgraph() and a function like waitkey() to display graphics...


could you release a stable version which doesn't have memory leaks at all, and maybe with the function dostring() ?

As far as I know there isn't any memory leak in CPLua 0.9D... :unsure:
What's your idea? :)

#740 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 10 October 2006 - 07:02 PM

Oh, I'm just working on some games, but with CPLua 08, there are memory leaks, and with CPLua 09, the drawing functions are much slower. :(

:never happy:

#741 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 18 October 2006 - 01:17 PM

Popup would be nice (like Ti).

#742 The_AFX_Master

The_AFX_Master

    Casio Overlord

  • [Legends]
  • PipPipPipPipPipPipPip
  • 519 posts
  • Gender:Male
  • Location:Black Mesa Research Facility (sector C)
  • Interests:BASIC +FORTRAN 90+ C++.....and HALF LIFE

  • Calculators:
    Casio Algebra FX 2.0 Plus, Casio fx 570 ms, Classpad 300, And a crowbar

Posted 19 October 2006 - 02:22 AM

popup already exists.. create your own routines with the UI package

#743 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 October 2006 - 03:34 AM

Popup... Message, Dialog...

#744 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 19 October 2006 - 08:14 AM

I know, I know, it is planned :rolleyes:

#745 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 October 2006 - 10:39 AM

That would be nice. But please fast.

#746 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 19 October 2006 - 11:31 AM

<_<

#747 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 October 2006 - 12:09 PM

:( ;)

#748 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 19 October 2006 - 12:24 PM

Although I'm not planning to use the UI package too much, I tried to "play" a little with the widgets available. I have created a simple window containing 2 buttons, 2 checkboxes, and a widget containing 3 comboboxes. It worked well, but, after several modifications, I suddently got a "Not enough memory to run", and all work after last save was lost. I hadn't had opened anything else when this happened. Note that I didn't wrote a large program, defining large matrices etc; it was only a small program to create a window containing a few widgets. Nevertheless, I got a memory error :blink:. I suspect than there is a memory leak in the UI package. I'm surprised that several CPLua users, who use the UI package more often than me, didn't reported something similar so far.

#749 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 October 2006 - 12:28 PM

require("draw","ui") gr={"Educational","Additional","All"} grht=1 temp=0 sc={} sc[grht]={} action=0 win=ui.window{name="",x=0,y=0,width=160,height=215}

function drawicon() b={} for i=1,#sc[grht] do 

b=ui.button{x=85-80*(i-2*math.floor(i/2)),y= 40*math.floor((i+1)/2)-15,width=50,text=sc[grht][i][1]} function b:_clicked() if action==0 then ui.stop() doscript(sc[grht][i][2]) ui.start() end if action==1 then local x,y = :getposition() temp=y/20+(85-x)/80 statusbar("") for i=temp,#sc[grht]-1 do sc[i]=sc[i+1] end sc[#sc[grht]]=nil print(temp) drawicon() end end destop:add(b) end end m1=ui.menu()

m1:add{type="button",text="Add Shortcut",_action=function() ui.stop() showconsole() clear() print("Add a shortcut: First input a name then the give the path for it, finally input the icon path (\"0\" to use default).") keypad(1) sc[grht][#sc[grht]+1]={input("Name:"),input("Path:"),input("Icon:")} if sc[grht][#sc[grht]][3]=="0" then sc[grht][#sc[grht]][3]=pictdefault end keypad(0) drawicon() win:show(true) ui.start() end} m1:add{type="button",text="Remove Shortcut",_action=function() statusbar("Tap any button to del.") action=1 end}

m1:add{type="line"}

m1:add{type="button",text="Edit Shortcut",_action=function() statusbar("Tap any button to edit") action=2 end} 

m1:add{type="line"}

m1:add{type="button",

text="Move Shortcut",_action=function() statusbar("Icon to move") action=3 end}

m1:add{type="button",text="Swap Shortcut",_action=function() statusbar("Icon to swap") action=4 end}

m2=ui.menu()

m2:add{type="button",text="Add Group",_action=function() end} m2:add{type="button",text="Remove Group",_action=function() end}

m2:add{type="line"}

m2:add{type="button",text="Edit Group",_action=function() end} m2:add{type="line"}

m2:add{type="button",text="Rearrange Group",_action=function() end}

m=ui.menu()

m:add{type="menu",text="Shortcut",menu=m1}

m:add{type="menu",text="Group",menu=m2}

m:add{type="button",text="Exit",_action=function() win:show(false) ui.stop() end}

win:add(m)

draw.onpict(win:getpict())

draw.rect(4,3,60,15,1,1,1)

draw.text(21,5,"MENU",0,9,0)

grdd=ui.combobox{x=67,y=4,width=87,height=10*#gr+9,parent=win}

for i=1,#gr do grdd:addstring(gr[i]) end

destop=ui.widget{x=1,y=18,width=156,height=194,scroll="v",frame="thin",parent=win}

win:show(true)

ui.start()
Orwell, please make it able to index a button.

#750 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 19 October 2006 - 02:06 PM

I suspect than there is a memory leak in the UI package.

Hmm :blink:
It doesn't sound like a leak, maybe there is a bug somewhere and CPLua tries to allocate a huge memory block, hence the error. Thanks, we will have to investigate a little bit :huh:

Orwell, please make it able to index a button.

:banghead: :cry:
I know English isn't your native language (it isn't mine neither). I understand that it's not allways easy for you to say exactly what you want.
But it's not easy for us to understand you neither. :rolleyes:
So please, and for the last time, BE MORE EXPLICIT :rant:
You have an idea, okay. You would like me to do something new, okay.
But I can't guess what you want with just a few words.
Stop writing very small sentences and give me details, explanations, examples of code of what you want and then I will understand you. "index a button"? What does it mean? I can't guess it like that :(
Please explain more (and don't wait to give more explanations: if you have an idea, explain it completely, not with just a few words).
Now, what do you want to be able to do? :rolleyes:

#751 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 October 2006 - 02:40 PM

for example, b[i]=ui.button{...} function b[i]:_clicked...

#752 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 19 October 2006 - 02:51 PM

But you can already do that without any problem :blink:

#753 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 October 2006 - 03:30 PM

if you write
require("draw","ui") gr={"Educational","Additional","All"} grht=1 temp=0 sc={} sc[grht]={} action=0 win=ui.window{name="",x=0,y=0,width=160,height=215}
function drawicon() b={} for i=1,#sc[grht] do 
b[i]=ui.button{x=85-80*(i-2*math.floor(i/2)),y= 40*math.floor((i+1)/2)-15,width=50,text=sc[grht][i][1]} function b[i]:_clicked() if action==0 then ui.stop() doscript(sc[grht][i][2]) ui.start() end if action==1 then local x,y = :getposition() temp=y/20+(85-x)/80 statusbar("") for i=temp,#sc[grht]-1 do sc[i]=sc[i+1] end sc[#sc[grht]]=nil print(temp) drawicon() end end destop:add(b) end end m1=ui.menu()
m1:add{type="button",text="Add Shortcut",_action=function() ui.stop() showconsole() clear() print("Add a shortcut: First input a name then the give the path for it, finally input the icon path (\"0\" to use default).") keypad(1) sc[grht][#sc[grht]+1]={input("Name:"),input("Path:"),input("Icon:")} if sc[grht][#sc[grht]][3]=="0" then sc[grht][#sc[grht]][3]=pictdefault end keypad(0) drawicon() win:show(true) ui.start() end} m1:add{type="button",text="Remove Shortcut",_action=function() statusbar("Tap any button to del.") action=1 end}
m1:add{type="line"}
m1:add{type="button",text="Edit Shortcut",_action=function() statusbar("Tap any button to edit") action=2 end} 
m1:add{type="line"}
m1:add{type="button",
text="Move Shortcut",_action=function() statusbar("Icon to move") action=3 end}
m1:add{type="button",text="Swap Shortcut",_action=function() statusbar("Icon to swap") action=4 end}
m2=ui.menu()
m2:add{type="button",text="Add Group",_action=function() end} m2:add{type="button",text="Remove Group",_action=function() end}
m2:add{type="line"}
m2:add{type="button",text="Edit Group",_action=function() end} m2:add{type="line"}
m2:add{type="button",text="Rearrange Group",_action=function() end}
m=ui.menu()
m:add{type="menu",text="Shortcut",menu=m1}
m:add{type="menu",text="Group",menu=m2}
m:add{type="button",text="Exit",_action=function() win:show(false) ui.stop() end}
win:add(m)
draw.onpict(win:getpict())
draw.rect(4,3,60,15,1,1,1)
draw.text(21,5,"MENU",0,9,0)
grdd=ui.combobox{x=67,y=4,width=87,height=10*#gr+9,parent=win}
for i=1,#gr do grdd:addstring(gr[i]) end
destop=ui.widget{x=1,y=18,width=156,height=194,scroll="v",frame="thin",parent=win}
win:show(true)
ui.start()
You cant run it.

#754 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 19 October 2006 - 03:41 PM

you just forgot a "self" somewhere:

local x,y = :getposition()
==>
local x,y = self:getposition()


#755 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 20 October 2006 - 12:25 AM

Oh, thanks.

#756 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 20 October 2006 - 02:51 AM

require("draw","ui") gr={"Educational","Additional","All"} grht=1 temp=0 seac=0 sc={} sc[grht]={} action=0 win=ui.window{name="",x=0,y=0,width=160,height=215}
function drawicon() ui.stop() destop:removeall() for i=1,#sc[grht] do 
b=ui.button{x=85-80*(i-2*math.floor(i/2)),y= 40*math.floor((i+1)/2)-15,width=50,text=sc[grht][i][1]} function b:_clicked() if action==3 then x,y=self:getposition() temp=y/20+.75-(85-x)/80 if seac==0 then seac=temp statusbar("Icon to move to") else local cur=sc[grht][seac] sc[grht][seac]=sc[grht][temp] sc[grht][temp]=cur drawicon() end end if action==0 then local x,y = self:getposition() temp=y/20+.75-(85-x)/80 ui.stop() doscript(sc[grht][temp][2]) ui.start() end if action==1 then local x,y = self:getposition() temp=y/20+.75-(85-x)/80 statusbar("") sc[#sc[grht]+1]=nil for i=temp,#sc[grht] do sc[grht][i]=sc[grht][i+1] end drawicon() end if action==2 then ui.stop() showconsole() clear() x,y= self:getposition() temp=y/20+.75-(85-x)/80 print("Edit a shortcut: First reinput a name then the regive the path for it, finally reinput the icon path (\"0\" to use default).\n\nCurrent setting:\n-Name:"..sc[grht][temp][1].."\n-Path:"..sc[grht][temp][2].."\n-Icon:"..sc[grht][temp][3]) keypad(1)
sc[grht][temp]={input("Name:"),input("Path:"),input("Icon:")} if sc[grht][temp][3]=="0" then sc[grht][temp][3]=pictdefault end keypad(0) drawicon() end end destop:add(b) end win:show(true) ui.start() end m1=ui.menu()
m1:add{type="button",text="Add Shortcut",_action=function() ui.stop() showconsole() clear() print("Add a shortcut: First input a name then the give the path for it, finally input the icon path (\"0\" to use default).") keypad(1) sc[grht][#sc[grht]+1]={input("Name:"),input("Path:"),input("Icon:")} if sc[grht][#sc[grht]][3]=="0" then sc[grht][#sc[grht]][3]=pictdefault end keypad(0) drawicon() end} m1:add{type="button",text="Remove Shortcut",_action=function() statusbar("Tap any button to del.") action=1 end}
m1:add{type="line"}
m1:add{type="button",text="Edit Shortcut",_action=function() statusbar("Tap any button to edit") action=2 end} 
m1:add{type="line"}
m1:add{type="button",
text="Move Shortcut",_action=function() statusbar("Icon to move") action=3 seac=0 end}
m1:add{type="button",text="Swap Shortcut",_action=function() statusbar("Icon to swap") action=4 seac=0 end}
m2=ui.menu()
m2:add{type="button",text="Add Group",_action=function() end} m2:add{type="button",text="Remove Group",_action=function() end}
m2:add{type="line"}
m2:add{type="button",text="Edit Group",_action=function() end} m2:add{type="line"}
m2:add{type="button",text="Rearrange Group",_action=function() end}
m=ui.menu()
m:add{type="menu",text="Shortcut",menu=m1}
m:add{type="menu",text="Group",menu=m2}
m:add{type="button",text="Exit",_action=function() ui.stop() clear() print("Good bye!") end}
win:add(m)
draw.onpict(win:getpict())
draw.rect(4,3,60,15,1,1,1)
draw.text(21,5,"MENU",0,9,0)
grdd=ui.combobox{x=67,y=4,width=87,height=10*#gr+9,parent=win}
for i=1,#gr do grdd:addstring(gr[i]) end
destop=ui.widget{x=1,y=18,width=156,height=194,scroll="v",frame="thin",parent=win}
win:show(true)
ui.start()

Try to add 5 shortcuts and then remove them. A fatal error will come. What is wrong with my code?

#757 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 21 October 2006 - 01:56 PM

No body here???

#758 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 22 October 2006 - 01:52 AM

Orwell, where are you? Or any one can finh what is the bug in that code.

#759 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 22 October 2006 - 02:47 PM

Orwell, where are you? Or any one can finh what is the bug in that code.

You post large codes. Nobody has time to find your error in a complicated code. Try to reproduce the "bug" you suspect you have found in a small (as small as possible) code.

#760 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 23 October 2006 - 10:57 AM

:cry: I cant find what's wrong :!:
Orwell, can you build a build-in MyLuaProgram? When we open CPLua, it appear the Menu: we can add, del, edit, move, swap shortcuts; and the first icon linked to start screen... Or build a window-explore-like to open programs, folder... Much more... And much more...
Can you do this? :cry:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users