

Posted 04 February 2007 - 11:03 AM
Posted 27 February 2007 - 02:04 AM
Posted 20 April 2007 - 01:03 AM
Posted 22 April 2007 - 09:39 AM
Well, these are two rather unrelated things.I just read a post where someone wrote their program in CPBasic only because it can be called from Main in OS 3.0. What are the odds of having a Main-like window in CPLua?
Posted 16 June 2007 - 06:27 AM
Posted 09 July 2007 - 07:54 PM
draw.rect(x1, y1, x2, y2, 2, COL_BLACK, COL_WHITE) draw.circle(x, y, r, 2, COL_BLACK, COL_WHITE)I'm currently thinking of something like this:
draw.setstyle{width=2, border="black", fill="white"} draw.rect(x1, y1, x2, y2) draw.circle(x, y, r)Of course there would be a draw.getstyle() function too to get the current "default" style. And each drawing function would accept a last optional parameters, which would be a specific style overriding the default one.
draw.setstyle{width=2, border="black", fill="white"} draw.rect(x1, y1, x2, y2) draw.circle(x, y, r, {width=4})It's not shorter than the code we would write in the current versions (with arguments "COL_BLACK" etc etc), but I think it is clearer and easier to remember.
Posted 10 July 2007 - 10:18 AM
YayyyOkay let's go back after a long break
![]()
Studies are definitively over (), I have 2 months free now, so let's do something great
I definitely prefer the first (current) approach, a thing which is obvious by the way I have written LNA. If I remeber well, we had had a long conversation about this, more than 1 year ago. The second approach reminds me how GTK+ is implemented. If you will ever use GTK+, you will know how inconvenient it is.I also think of changing the way to define the style:
Actually to draw a black rectangle and a black circle filled in white with a width of 2 pixels, one would write this:draw.rect(x1, y1, x2, y2, 2, COL_BLACK, COL_WHITE) draw.circle(x, y, r, 2, COL_BLACK, COL_WHITE)I'm currently thinking of something like this:draw.setstyle{width=2, border="black", fill="white"} draw.rect(x1, y1, x2, y2) draw.circle(x, y, r)
IMHO, it's not clearer nor easier to remember. Furthermore, one needs to issue multiple setstyle() commands if, for example, he wants to draw several rectangles and/or circles with different borders (one with thick border, one with thin border, then again one with thick border, etc).It's not shorter than the code we would write in the current versions (with arguments "COL_BLACK" etc etc), but I think it is clearer and easier to remember.
I would like to have your opinion about that anyways
I agree, this should have a very low priority.About compressed files: There should be possible to do something like that, but it is not a real priority at the moment
Posted 12 July 2007 - 09:15 PM
Posted 25 July 2007 - 04:54 PM
Posted 25 July 2007 - 09:58 PM
The most interesting thing (in my opinion, of course) is the draw.patternline() and draw.fill() functions (which will be used by the new LNA version), and the ability to import lua files (which I'm going to check soon). Expect a test report concerning these features in the next few days.Nonono, I'm still here
and guess what I have now...
As allways, I need your comments
I suggest to use LaTeX, the de facto standard for creating professional documents. LaTeX is, in fact, a huge set of macros based on a programming language called TeX. Although the resulting printed document is excellent, it is rather difficult to learn LaTeX. Fortunately, there is a front-end, called LyX, which makes things much easier. LaTeX documents can be easily exported to anything, including PDF and HTML, among others. There is a problem, however: LaTeX and LyX are a part of any <{GNULINUX}> distribution, but if you use Window$, you will need to download several programs to make it working properly. If you feel adventurous, give it a try. You will never want to use stupid Word processors anymore. XML is not a bad idea anyway, and it is related to LaTeX.I finally thought that XML would be a good idea; I wrote a first Schema to define the syntax of a Lua XML Reference document, and here is an example of a valid file.
Posted 25 July 2007 - 10:18 PM
Of course, because almost everything else concerns the UI package and you don't use itThe most interesting thing (in my opinion, of course) is the draw.patternline() and draw.fill() functions (which will be used by the new LNA version), and the ability to import lua files (which I'm going to check soon). Expect a test report concerning these features in the next few days.
I've made a lot of tests during the last days and changed several things. I didn't see any crash - or when I saw one I fixed it immediatly. I don't see why it would use a lot of memory btwI don't use the UI package because it needs memory, and it was unstable in version 0.9D (I've got plenty of crashes, as I have reported here some months ago). Is it stable now?
Well... As you may guess, I don't like LaTeX.I suggest to use LaTeX, the de facto standard for creating professional documents. LaTeX is, in fact, a huge set of macros based on a programming language called TeX. Although the resulting printed document is excellent, it is rather difficult to learn LaTeX.
Posted 26 July 2007 - 11:31 AM
Posted 26 July 2007 - 12:05 PM
Good idea, although I think that just typing the keyword is faster than searching for it in the "cat" menu.Maybe you can put all the CPLua's functios in the virtual keyboard->cat, but only when you enter in the CPLua not in the basic... is that possible?
Posted 26 July 2007 - 12:15 PM
For example, how can I draw a 1-pixel on - 1-pixel off line?
Posted 26 July 2007 - 01:00 PM
It could be... I will seeMaybe you can put all the CPLua's functios in the virtual keyboard->cat, but only when you enter in the CPLua not in the basic... is that possible?
Oops, I forgot to change the examples :oops:PD: when I run anyone of your examples I get an error: bad argument #1 to 'window' ('exand' used with dimensions)
it doesn't appear in CPLua 0.9D
Posted 26 July 2007 - 01:09 PM
Posted 26 July 2007 - 01:13 PM
Ok, I think I've already figured it out. But why strictly 8 hex digits? It would be better if the user could supply up to 8 digits (not exactly 8), so that, "A" means 1-dot on - 1-dot off. As it is now, some patterns cannot be implemented. For example, 1-dot on - 4-dots off can be given with 5 digits only: "84210". However, the user is forced to supply 3 more digits, so, as it is now, 1-dot on - 4-dots off cannot be implemented.> PAP: It's not easy to explain exactly how the pattern works
Think about the binary representation (1 pixel = 1 bit, like in vanhoa'example), then convert it to hexadecimal
Posted 26 July 2007 - 01:28 PM
void PegScreen::PatternLine ( PegThing * Caller, SIGNED wXStart, SIGNED wYStart, SIGNED wXEnd, SIGNED wYEnd, PegColor & Color, SIGNED wWidth, DWORD dPattern, UCHAR Rop = RF_SRCCOPY ) This function draws a dashed line. The dash pattern is determined by the dPattern value. For example, a dPattern value of 0xf0f0f0f0 would draw a line alternating between 4 pixels on and four pixels off.
Posted 26 July 2007 - 02:00 PM
Yes, I've already noticed that. I had changed the way grid is implemented in LNAplot, so that draw.patternline() is used. However, the dashed grid line is messed up near the center, plus there is no noticeable speed up, compared to a simple do-loop drawing pixels. So, I decided not to use draw.patternline() at all.Btw, I just noticed that this function applies the pattern from the beggining AND from the end of the line, which could give some strange results at the center
Obviously, the SDK could be much better...Well, you see the kind of things we have to manage with the SDK
Posted 26 July 2007 - 02:02 PM
Posted 26 July 2007 - 02:55 PM
Posted 26 July 2007 - 06:13 PM
Good idea, although I think that just typing the keyword is faster than searching for it in the "cat" menu.
It could be... I will see
But personnaly I think it will be more useful to have a complete page with CPLua reference than just a list in the keypad
Posted 02 August 2007 - 03:33 PM
Posted 02 August 2007 - 07:48 PM
Posted 29 August 2007 - 08:14 PM
Posted 29 August 2007 - 10:26 PM
Could you give me more details about this? I'm afraid I don't really understand what you did and what happenedBecause I have canceled a "dialog.save"-function the OS of my ClassPad can't be loaded without any errors!
The dialogs often can't be closed so that no fatal error ocurres!
Posted 04 September 2007 - 11:54 AM
Posted 04 September 2007 - 07:18 PM
Posted 06 September 2007 - 09:46 AM
require "ui" "draw" ... pict.save(p,dialog.save("pict"))As the dialog appeared I cancelled it and then the Big Error came...
Posted 20 October 2007 - 01:50 PM
Posted 03 November 2007 - 06:52 PM
Posted 05 November 2007 - 10:15 PM
Posted 06 November 2007 - 06:15 AM
Orwell
(D*mn, I really must release at least the final version of CPLua... If only I had enough time for it)
Posted 30 November 2007 - 09:11 AM
Posted 01 December 2007 - 10:49 AM
Posted 01 December 2007 - 10:50 PM
-----------------------function siatka(x_p,y_p,nx_max,ny_max)for n=0,ny_max dodraw.line(x_p,y_p+n*6,x_p+nx_max*6,y_p+n*6)endfor n=0,nx_max dodraw.line(x_p+n*6,y_p,x_p+n*6,y_p+ny_max*6)endwin:update()end-----------------------function maluj(x_pen,y_pen)col=1-- okreslanie aktualnej komorkirepeatx=xset+col*6col=col+1until x_pen<xcol=col-1row=1repeaty=yset+row*6row=row+1until y_pen<yrow=row-1-- przerysowanie komorkiif col<=maxcol and row<=maxrow and col>0 and row>0 thenif mat[col][row]==0thendraw.rect(x-5,y-5,x-1,y-1,1,BLACK,1)mat[col][row]=1elseif mat[col][row]==1thendraw.rect(x-5,y-5,x-1,y-1,1,WHITE,0)draw.pixel(x-3,y-3)mat[col][row]=2elsedraw.rect(x-5,y-5,x-1,y-1,1,WHITE,0)mat[col][row]=0endendendwin:update()end-----------------------function nowyobraz()menu=1menu2=1path=nildraw.clear()init()siatka(xset,yset,maxcol,maxrow)statusbar(path)end----------------------function generujkod()end-----------------------function generujobraz()end-----------------------function obraz_update()end-----------------------function wczytajobraz()end-----------------------function zapisz()end-----------------------function init()xset=35yset=50maxrow=25maxcol=20for i=1,maxcol do local tab = {} for j=1,maxrow do tab[j]=0 end mat[i]=tabendend----------------------function zapisz_data()end----------------------function zapiszjako_data()end----------------------function otworz_data()end----------------------function sprawdz()end------------------------------ Main -------------------------------require("ui","draw","io","string") -- create windowwin = ui.window{ name="Test1", x=0, y=0,expand=false,width=160, height=215 }draw.onpict( win:getpict() )draw.clear()win:update()win:show(true)function win:_pendown(x,y)if menu==1 thenmaluj(x,y)endend---------------------xset=35yset=50maxrow=25maxcol=20mat={}tab1={}tab2={}init()------- menu 1 --------m1 = ui.menu()m1:add{type="button", text="Wczytaj obraz", _action= wczytajobraz}m1:add{type="button", text="Zapisz zmiany", _action=zapisz}m1:add{type="button", text="Sprawdz", _action=sprawdz}m1:add{type="line"}m1:add{type="button", text="Wyjscie", _action=function() ui.stop() end}------- menu 2 --------m2 = ui.menu()m2:add{type="button", text="Nowy obraz", _action=nowyobraz}m2:add{type="line"}m2:add{type="button", text="Otworz", _action=function()otworz_data() end}m2:add{type="button", text="Zapisz", _action=function()zapisz_data() end}m2:add{type="button", text="Zapisz jako", _action=zapiszjako_data}m2:add{type="line"}m2:add{type="button", text="Generuj obraz", _action=generujobraz}------- menu 3 --------m3 = ui.menu()--m3:add{type="button", text="Zasady gry", _action=tytul}m3:add{type="button", text="O programie", _action=function()dialog.message{title="O programie",text="Ver. 1.0 by ndzamana",x=1,y=70,width=157,height=60,buttons={"ok"}} end}------- MENU --------m = ui.menu()m:add{type="menu", text="Gra", menu=m1}m:add{type="menu", text="Rysuj", menu=m2}m:add{type="menu", text="Pomoc",menu=m3}--m:add{type="break"}win:add(m)win:show()ui.start()
Posted 09 December 2007 - 07:13 PM
Posted 11 December 2007 - 10:24 PM
Posted 12 December 2007 - 02:38 AM
Posted 12 December 2007 - 07:49 PM
0 members, 2 guests, 0 anonymous users