Project: Cplua
#721
Posted 04 October 2006 - 07:10 PM
#722
Posted 04 October 2006 - 07:25 PM
Well I'm talking about dostring() here, not doscript(), but I don't know how your file could have been deleted with doscript()...
#723
Posted 04 October 2006 - 07:36 PM
However, I have seen this happening once, and I'm sure it was not my mistake. I can't reproduce that behavior though.
#724
Posted 06 October 2006 - 05:43 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.
#725
Posted 06 October 2006 - 09:14 PM
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 .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.
#726
Posted 07 October 2006 - 07:49 AM
#727
Posted 07 October 2006 - 08:43 AM
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
Posted 08 October 2006 - 11:48 PM
#729
Posted 09 October 2006 - 08:17 AM
But this was a personal choice (I don't really like the CP's look & feel ), do you think it is really useful to be able to edit 2 programs on the same screen?
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?
#730
Posted 09 October 2006 - 11:02 AM
One more thing: interactive should improve.
#731
Posted 09 October 2006 - 12:35 PM
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.It's difficult... But i need it, i hope we can have that in the next ver. of CPLua.
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.
Same remark.One more thing: interactive should improve.
Improve how?
#732
Posted 09 October 2006 - 01:15 PM
#733
Posted 09 October 2006 - 04:12 PM
#734
Posted 09 October 2006 - 06:25 PM
Counter Terrorists Win!
the emoticon is just the headshot ones on CS1.5
#735
Posted 10 October 2006 - 12:13 AM
#736
Posted 10 October 2006 - 08:05 AM
What kind of functions? Basic? Lua? others?We can make function that can use in the interactive.
How would we have access to it?
Give me more precisions! A single sentence is not enough.
#737
Posted 10 October 2006 - 01:34 PM
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
Posted 10 October 2006 - 03:27 PM
#739
Posted 10 October 2006 - 06:13 PM
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 filesWe 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.
I'm not sure I really understand what you want Please try to be more clear.
It's already the case: you just have to call showgraph() and a function like waitkey() to display graphics...the inter active should have 2 module: console and graph. You can image, just like "run-mat" of Afx or fx.
As far as I know there isn't any memory leak in CPLua 0.9D...could you release a stable version which doesn't have memory leaks at all, and maybe with the function dostring() ?
What's your idea?
#740
Posted 10 October 2006 - 07:02 PM
:never happy:
#741
Posted 18 October 2006 - 01:17 PM
#742
Posted 19 October 2006 - 02:22 AM
#743
Posted 19 October 2006 - 03:34 AM
#744
Posted 19 October 2006 - 08:14 AM
#745
Posted 19 October 2006 - 10:39 AM
#746
Posted 19 October 2006 - 11:31 AM
#747
Posted 19 October 2006 - 12:09 PM
#748
Posted 19 October 2006 - 12:24 PM
#749
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
Posted 19 October 2006 - 02:06 PM
HmmI suspect than there is a memory leak in the UI package.
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
Orwell, please make it able to index a button.
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.
So please, and for the last time, BE MORE EXPLICIT
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?
#751
Posted 19 October 2006 - 02:40 PM
#752
Posted 19 October 2006 - 02:51 PM
#753
Posted 19 October 2006 - 03:30 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[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
Posted 19 October 2006 - 03:41 PM
local x,y = :getposition()==>
local x,y = self:getposition()
#755
Posted 20 October 2006 - 12:25 AM
#756
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
Posted 21 October 2006 - 01:56 PM
#758
Posted 22 October 2006 - 01:52 AM
#759
Posted 22 October 2006 - 02:47 PM
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.Orwell, where are you? Or any one can finh what is the bug in that code.
#760
Posted 23 October 2006 - 10:57 AM
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?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users