Jump to content



Photo

Project: Cplua


  • Please log in to reply
858 replies to this topic

#801 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 04 February 2007 - 11:03 AM

:roflol: It's normal ^_^

#802 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 27 February 2007 - 02:04 AM

@ Orwell

Can you add a vertical font, and their respective draw.text() variants to the next CPLua release?. and a new "microfont'' (The same as the AFX series font that you see when you use drawtext).
a vertical microfont would be really useful in order to display huge data on screen when placed horizontally :D.

I can post here all the characters if you want

#803 Guest_LuaMania_*

Guest_LuaMania_*
  • Guests

Posted 20 April 2007 - 01:03 AM

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?

#804 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 22 April 2007 - 09:39 AM

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?

Well, these are two rather unrelated things.
The first thing is that you will (most certainly) never be able to call a Lua function from the ClassPad "Main" application. This would suppose that you could interact with an Add-In from that application, and it's absolutely not supported at the moment.

The second thing is that you could imagine having a Main-like window inside CPLua, but interactions with the Lua language itself wouldn't be easy. The "interactive" mode of CPLua is a kind of solution to this (and actually it has nothing to do with the Main application), but its main weakness is that the "natural display" (writing formula's in 2D) is currently unsupported. But perhaps this could be improved later ;)

#805 Colombia

Colombia

    Casio Addict

  • Members
  • PipPipPip
  • 94 posts
  • Gender:Male
  • Location:Venezuela

  • Calculators:
    algebra FX 2.0 plus
    Classpad 300

Posted 16 June 2007 - 06:27 AM

I think the 90% of the people like the coke but just the 0.5% have the formula.

I can share my programs but i don't like to share the code. I think it is usefull the make a compress mode as Basic.

#806 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 09 July 2007 - 07:54 PM

Okay let's go back after a long break :nod:
Studies are definitively over ( B) ), I have 2 months free now, so let's do something great :)
Sorry for the long time without news: I have been horribly this year, and I couldn't take much time to work on CPLua until now.

I already created a new mathedit component for the UI package, to input/display 2D math expressions. There are several things I'd like to add/improve, and I must write the documentation too (finally :rolleyes:)

But first I'd like to know what needs to be corrected in CPLua 0.9D. I know that drawing operations are a lot slower than in version 0.8, and I will take care of that ;) I also think that there were some issues with memory management :rolleyes:

In the meantime, I'd like to have your opinion for some changes about the draw package. I plan to add some new useful functions like arc(), ellipse(), patternline() etc, but 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)
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.
For example, if you want the circle to have a width of 4 pixels instead:
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. :) I would like to have your opinion about that anyways ;)
How, and I'm thinking of similar functions draw.setfont{} and draw.getfont{} too :)

About compressed files: There should be possible to do something like that, but it is not a real priority at the moment ;)

#807 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 10 July 2007 - 10:18 AM

Okay let's go back after a long break :nod:
Studies are definitively over ( B) ), I have 2 months free now, so let's do something great :)

Yayyy :roflol:. Welcome back.

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)

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.

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 ;)

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).

About compressed files: There should be possible to do something like that, but it is not a real priority at the moment ;)

I agree, this should have a very low priority.

#808 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 12 July 2007 - 09:15 PM

I definitely prefer the first approach too. Btw, I never write directly COL_BLACK or COL_WHITE, just 1 and 0. Much shorter, and not harder to understand.

And, pleased to see you back here. ^_^

#809 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 25 July 2007 - 04:54 PM

Two weeks later... <_<


Nonono, I'm still here :lol: and guess what I have now...

:!: CPLua version 0.9E :)

I've been working hard during these last days, I hope you will like the changes. So what's new:
  • New UI components: Dialogs and MathEdit
    You can now create your own custom dialogs to display a message, ask for a specific input etc. There are also some predefined dialogs, to display a simple message or ask for a filename.
    There is also the new mathedit component, which can be used to display/input 2D math expressions :) For example it is now very easy to create a dialog replicating the CPBasic "PrintNatural" command. I'll try to add some other examples soon.
  • Faster screen update
    The drawing operations on the screen were faster with CPLua 0.8, because of the predefined size of the Graph Window. Now that this window can be resized with the UI package, the function needed to update the screen is more complicated and is thus slower. I have completely rewritten this function, and it's now a bit faster than the previous CPLua 0.9 versions (but of course not as fast as CPLua 0.8). :)
  • Timers for UI windows and widgets
    The UI Window and Widgets can now use timers to execute some code periodically or after a given time. This is useful e.g. for windows/widgets that need to update themselves periodically, for example to display the current hour etc :lol: The default precision is 0.5 seconds: I will try to implement another solution for programs needing to measure time more accurately ;)
  • Expandable UI Windows
    If you don't specify the size of a new UI Window, it will expand to fit the screen and resize itself automatically if you show/hide the keypad :)
  • New drawing functions
    The functions draw.polygon(), draw.patternline(), draw.fill(), draw.textsize() are now available. I wanted to create draw.ellipse() and draw.arc() too, bug there is a bug in the SDK so it won't work correctly :nonono:
  • Support of *.lua files on the emulator
    The emulator has now 2 special commands ("Import" & "Export") to open/save a Lua file (*.lua or *.txt) on the computer. It's just a small feature to avoid frequent copy/paste operations ;)
I guess that's all... :unsure: I also fixed a couple of minor bugs in the meantime.

As allways, I need your comments ;)


Another thing: I'm also thinking about CPLua's documentation, especially about the functions and packages reference. I was looking for a good way to document the different functions and packages available in CPLua, as well as the new packages and libraries (like LNA etc) created by the users.
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.

The advantage of using XML is that online (HTML) documentation and PDF documents can be easily and automatically generated from these files :) And I plan to create a kind of "Help Browser" for CPLua, with a tool to convert such files into compressed MCS files, which means that we will be able to consult this documentation directly on the handheld :lol:

Of course I'd like to have your opinion about this too (maybe there is something missing in the syntax etc) ;)

#810 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 25 July 2007 - 09:58 PM

Nonono, I'm still here :lol: and guess what I have now...
As allways, I need your comments ;)

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.
I 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?

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.

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.
Btw, as you can guess, LNA's documentation is entirely written in LyX :rolleyes:.

#811 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 25 July 2007 - 10:18 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.

Of course, because almost everything else concerns the UI package and you don't use it :lol2: This package is the most advanced feature of CPLua btw, and the major addition of CPLua 0.9 :) Thus it's normal for me to work on it with top priority for the moment ;) But don't worry, it's almost complete.

I 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?

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 btw :huh: I'll read the topic again to check your old reports ;)

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.

Well... As you may guess, I don't like LaTeX. :P I never tried LyX however, I'm gonna take a look someday :) But I must be sure that anyone will be able to convert such document into a MCS data file for CPLua, and I'm almost certain that it will be a lot easier to use a XML parser than a LyX processor ;)

Edit (after a quick glance on Lyx): No, this is not what I need. :) I need a way to exactly specify the nature of the document's content, not its format. For what I've seen, LyX seems like a sophisticated tool to define the appearance of a document, exactly like HTML - but a lot more powerful. I absolutely don't care about the appearance here: I just want to list the Lua packages, functions, and methods, and describe it precisely (like in a database). Then I'll join a stylesheet or use a XML parser to get the information I need and format it in a convenient way, but this is another story ;) Take a look at the example file, you should see what I mean :)

#812 girdeux

girdeux

    Casio Addict

  • Members
  • PipPipPip
  • 88 posts
  • Location:Spain / Castell?n

  • Calculators:
    casio fx-115ms;
    casio classpad 300

Posted 26 July 2007 - 11:31 AM

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?

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

#813 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 26 July 2007 - 12:05 PM

Hmmm, I must admit that I am a little bit confused with the pattern argument in draw.patternline(). You say that "F0F0F0F0" creates a line 4-pixels on - 4-pixels off, but how exactly? What each hexadecimal digit controls? F=15 decimal, but what this 15 stands for?
For example, how can I draw a 1-pixel on - 1-pixel off line, or a 1-pixel on - 4-pixels off line?

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?

Good idea, although I think that just typing the keyword is faster than searching for it in the "cat" menu.

#814 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 26 July 2007 - 12:15 PM

For example, how can I draw a 1-pixel on - 1-pixel off line?



0b10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101010
=0xAAAAAAAA

#815 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 July 2007 - 01:00 PM

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?

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 :)

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

Oops, I forgot to change the examples :oops:
Indeed, with CPLua 0.9E you cannot use "expand" and x/y/width/height at the same time anymore. Just remove "expand=..." and it will work again ;)

> PAP: It's not easy to explain exactly how the pattern works :unsure: Think about the binary representation (1 pixel = 1 bit, like in vanhoa'example), then convert it to hexadecimal ;)

#816 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 July 2007 - 01:09 PM

About the second example (1-pixel on - 4-pixels off line):
pattern (32 pixels): 10000100001000010000100001000010
binary: 1000 0100 0010 0001 0000 1000 0100 0010
hexadecimal: 84210842
-> pattern string: "84210842" ;)

Of course the pattern won't be "perfect" here, because the max length is 32 pixels (which is not dividable by 5 (=1+4) ).

#817 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 26 July 2007 - 01:13 PM

> PAP: It's not easy to explain exactly how the pattern works :unsure: Think about the binary representation (1 pixel = 1 bit, like in vanhoa'example), then convert it to hexadecimal ;)

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.

#818 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 July 2007 - 01:28 PM

I know it's not a perfect solution at all. I just wanted to map one of the available draw functions of the SDK and make it accessible from Lua, but as many other PEG features, it really could have been better <_<

The function of the SDK is:
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.

As you can see I didn't write it myself ;)
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 :blink:

Well, you see the kind of things we have to manage with the SDK :rolleyes:

#819 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 26 July 2007 - 02:00 PM

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 :blink:

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.

Well, you see the kind of things we have to manage with the SDK :rolleyes:

Obviously, the SDK could be much better...

#820 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 July 2007 - 02:02 PM

*Sigh* girdeux and vanhoa reported some bugs I didn't see before :banghead:
It shouldn't take long to fix it <_<

#821 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 July 2007 - 02:55 PM

OK, the archive was updated :rolleyes:
I modified the first UI example too.

Thanks for your reports :)

#822 girdeux

girdeux

    Casio Addict

  • Members
  • PipPipPip
  • 88 posts
  • Location:Spain / Castell?n

  • Calculators:
    casio fx-115ms;
    casio classpad 300

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.


Yes is more faster type the function, but you could use it when you forget some function, like a help browser (more or less)... :blink:

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 :)


What do you mean with "complete page with CPLua reference" explain more please...

Can you make any more examples with the new things of ui package and draw function. Thanks.

#823 Guest_giov_roger_*

Guest_giov_roger_*
  • Guests

Posted 02 August 2007 - 03:33 PM

i found something (bug), probably someone else might've noticed it

CPLua 0.9D
1) Run the interactive mode
2) any way you can get the >> prompt (type "_VERSION" for example)
3) tap the classpad's menu icon (lower part of the touch screen)

:blink:

i'm guessing an infinite loop.

#824 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 02 August 2007 - 07:48 PM

Oooopsie. -_-

Thanks for your report, it will be fixed soon :)

#825 Hobart

Hobart

    Casio Fan

  • Members
  • PipPip
  • 34 posts
  • Gender:Male
  • Location:Germany (Saxony/Ore Mountains)

  • Calculators:
    ClassPad 300

Posted 29 August 2007 - 08:14 PM

CPLua 0.9E is really great! The new functions are very useful especially the new draw functions.(for me :))
But in the ui package there are some bugs.
Because 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!
I spend a lot of time to program some things with CPLua but it's not good to damage the OS by this application. :unsure:
It would be really great if you could fix this bugs! :rolleyes:

#826 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 29 August 2007 - 10:26 PM

"damage the OS"? :blink: :blink: :blink:

What makes you say that? :huh:

Because 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!

Could you give me more details about this? I'm afraid I don't really understand what you did and what happened :unsure:
And did you ask for a picture, a text file or a data file name with dialog.save?

#827 Hobart

Hobart

    Casio Fan

  • Members
  • PipPip
  • 34 posts
  • Gender:Male
  • Location:Germany (Saxony/Ore Mountains)

  • Calculators:
    ClassPad 300

Posted 04 September 2007 - 11:54 AM

I used the "pict" files.
The errors sometimes appeared when I closed a dialog which had no variable to hold the "closed" status.

#828 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 04 September 2007 - 07:18 PM

Could you give me an example of code showing the bug? :)

#829 Hobart

Hobart

    Casio Fan

  • Members
  • PipPip
  • 34 posts
  • Gender:Male
  • Location:Germany (Saxony/Ore Mountains)

  • Calculators:
    ClassPad 300

Posted 06 September 2007 - 09:46 AM

I only remember the error that made my CP broken. :unsure:
It was about:
require "ui" "draw"
...
pict.save(p,dialog.save("pict"))
As the dialog appeared I cancelled it and then the Big Error came...
I don't exactly remember the arguments... :rolleyes:
But don't try it with the ClassPad!!! I do not know what will happen but it's better for the CP... ;)

#830 Guest_Carlos Marquez_*

Guest_Carlos Marquez_*
  • Guests

Posted 20 October 2007 - 01:50 PM

En CPLua 9E.
No corren los programas hechos en CPLua 9D.
Muestra error.

Por favor alguien podria ayudarme.

#831 ndzamana

ndzamana

    Newbie

  • Members
  • Pip
  • 13 posts
  • Gender:Male
  • Location:Poland

  • Calculators:
    ClassPad 300, fx-9860G SD, Algebra FX 2.0 Plus, CFX-9850G PLUS

Posted 03 November 2007 - 06:52 PM

Hi!
I have problem with all ui examples on my CP (CPLua 0.9E). When I run it this error occurs "bad argument #1 to 'window' ('expand' used with dimensions)" but on PC it works ok! :huh: What is wrong?

#832 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 05 November 2007 - 10:15 PM

There are some changes in the UI package since CPLua 0.9E... Just reload the example from the MCS file and everything should be fine ;)

Orwell
(D*mn, I really must release at least the final version of CPLua... If only I had enough time for it :()

#833 omegavirus

omegavirus

    Casio Freak

  • Members
  • PipPipPipPip
  • 150 posts
  • Gender:Male
  • Location:Morelia, M?xico

  • Calculators:
    ClassPad 300

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 :()


We are waiting it, you have made the most important add in for the classpad and it isn't finished yed :rolleyes:

Good luck and try to get some time for CPLua :greengrin:

#834 ndzamana

ndzamana

    Newbie

  • Members
  • Pip
  • 13 posts
  • Gender:Male
  • Location:Poland

  • Calculators:
    ClassPad 300, fx-9860G SD, Algebra FX 2.0 Plus, CFX-9850G PLUS

Posted 30 November 2007 - 09:11 AM

Hi!
Thanks for help! :) I've just started to write in Lua, it's cool!!!

I have problem with
function win:_pendown(x,y)
maluj(x,y) // <-- this draw something on the screen
end

On PC emulator everything works ok, but on CP it works good only for few cliks on the screen. After it CP crash... (I have to reset CP). I don't know why??? :unsure: I've already tested a few possibilities. My program is small, it doesn't get a lot of memory... . Function maluj(x,y) also works good in loop...

Do you know, what could be wrong?

#835 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 01 December 2007 - 10:49 AM

Hmm, it seems like there is a bug somewhere <_<
Could you give us the entire code so I can test it myself? :)

#836 ndzamana

ndzamana

    Newbie

  • Members
  • Pip
  • 13 posts
  • Gender:Male
  • Location:Poland

  • Calculators:
    ClassPad 300, fx-9860G SD, Algebra FX 2.0 Plus, CFX-9850G PLUS

Posted 01 December 2007 - 10:50 PM

Oki ;) This is my program after little minimize. Sorry, I haven't translate it into english. To run the draw's part, you have to click Rysuj and next Nowy Obraz.

-----------------------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()


#837 Guest_Carlos Marquez_*

Guest_Carlos Marquez_*
  • Guests

Posted 09 December 2007 - 07:13 PM

Alguin sabe por que no se puede adicionar objetos a "WIDGETS".

En CPLua9D, se adiciona normal.

Someone knows if i can add objects to a widget?
In CPLua 0.9D i can do it normally

#838 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 11 December 2007 - 10:24 PM

Of course, a widget is just an empty container for other components :)

#839 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 12 December 2007 - 02:38 AM

My bad,the translation is suppossed to be: "why i can't add objects to widgets"

#840 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 12 December 2007 - 07:49 PM

Could you give an example of code that works correctly with CPLua 0.9D and not with CPLua 0.9E? :huh:




2 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users


    Bing (1)