From: Richard S. <ric...@gm...> - 2006-07-30 07:05:46
|
Hi List, I'm completely new to wxLua so forgive me if I'm in going completely in the wrong direction. I have just started writing a spreadsheet program in lua that supports functions, cell ranges and sorting. have got to the point where it really needs a user interface to be useable to anyone so am investigating wxLua. How can I use a wxGrid in such a way that the value typed into a cell is not the same as the value displayed? (if a function is inputted) I imagine i need to call grid:SetDefaultRenderer() can a cell renderer object be defined from lua? As it's user-data, I suspect this might not be possible? Help would be appreciated, though I suppose I should read up on wxWidgets a bit more before I launch into this myself... Richard |
From: John L. <jla...@gm...> - 2006-08-01 04:50:14
|
On 7/30/06, Richard Simes <ric...@gm...> wrote: > I have just started writing a spreadsheet program in lua that supports > functions, cell ranges and sorting. have got to the point where it really > needs a user interface to be useable to anyone so am investigating wxLua. Lua should make scripting arbitrary functions fairly easy. > How can I use a wxGrid in such a way that the value typed into a cell is not > the same as the value displayed? (if a function is inputted) This is probably best done using a lua table in addition to the wxGrid's "cell value" which is just the displayed string value. The lua table could store the values using a string represenation of the coords, eg. string.format("%d, %d", row, col). > I imagine i need to call grid:SetDefaultRenderer() > can a cell renderer object be defined from lua? As it's user-data, I suspect > this might not be possible? SetDefaultRenderer has been broken in wxWidgets for years, I submitted a patch quite some time ago, but I think it's been lost since. You can catch the events for set cell value and put them into a separate lua table and then write to the wxGrid what the output of the function or whatever was entered should be. I think this would be simplest and should be enough. > Help would be appreciated, though I suppose I should read up on wxWidgets a > bit more before I launch into this myself... The wxGrid component is hard to get a handle on at first glance, but hopefully since you don't have to compile as in C++ you can get something going fairly quickly. Regards, John Labenski |
From: Richard S. <ric...@gm...> - 2006-08-01 05:08:39
|
Thanks for the tips, I think I'll be going with wxWidgets in C++, rather than wxLua as wxLua seems to have a few memory leaks... is this just my setup? eg, the editor.wx.lua runs fine at first, but if I leave it open for more than 15 minutes it becomes unusable with ~100mb ram and ~ 85% processor. I'm running ubuntu 5 on an amd athlon xp Although, My C++ isn't brilliant so I'll no doubt introduce some myself. With the help of wxGlade I was able to get a basic grid interface working, with a custom wxGridTableBase that will soon contain some basic bindings to my lua code. On 8/1/06, John Labenski <jla...@gm...> wrote: > > On 7/30/06, Richard Simes <ric...@gm...> wrote: > > I have just started writing a spreadsheet program in lua that supports > > functions, cell ranges and sorting. have got to the point where it > really > > needs a user interface to be useable to anyone so am investigating > wxLua. > > Lua should make scripting arbitrary functions fairly easy. Wonderfully easy - I have the lua api working well. I'll post a link to lua-l as soon as I get a working prototype ;-) Thanks for the help. Richard |
From: John L. <jla...@gm...> - 2006-08-02 03:54:43
|
On 8/1/06, Richard Simes <ric...@gm...> wrote: > Thanks for the tips, > > I think I'll be going with wxWidgets in C++, rather than wxLua as wxLua > seems to have a few memory leaks... > is this just my setup? What wxLua version are you using? > eg, the editor.wx.lua runs fine at first, but if I leave it open for more > than 15 minutes it becomes unusable with ~100mb ram and ~ 85% processor. > I'm running ubuntu 5 on an amd athlon xp There have been some fixes to the garbage collection in wxLua since the last release. I don't see this using the snapshots. Hopefully we'll have a new release in the next few weeks, the summer has been very busy for me. :) > Although, My C++ isn't brilliant so I'll no doubt introduce some myself. > > With the help of wxGlade I was able to get a basic grid interface working, > with a custom wxGridTableBase that will soon contain some basic bindings to > my lua code. Good luck, you can also use the wxLuaState in C++ and the binding generation code if you want to mix C++ and Lua a little more easily. If you're not alreasy using a snapshot, try to compile it and hopefully the mem leak you see is fixed. Regards, John Labenski > > On 8/1/06, John Labenski <jla...@gm...> wrote: > > On 7/30/06, Richard Simes <ric...@gm...> wrote: > > > I have just started writing a spreadsheet program in lua that supports > > > functions, cell ranges and sorting. have got to the point where it > really > > > needs a user interface to be useable to anyone so am investigating > wxLua. > > > > Lua should make scripting arbitrary functions fairly easy. > > > > Wonderfully easy - I have the lua api working well. > I'll post a link to lua-l as soon as I get a working prototype ;-) > Thanks for the help. > > Richard > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > Wxlua-users mailing list > Wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users > > > |
From: Richard S. <ric...@gm...> - 2006-08-06 12:53:42
|
Sorry bout slow reply: On 8/2/06, John Labenski <jla...@gm...> wrote: > On 8/1/06, Richard Simes <ric...@gm...> wrote: > > Thanks for the tips, > > > > I think I'll be going with wxWidgets in C++, rather than wxLua as wxLua > > seems to have a few memory leaks... > > is this just my setup? > > What wxLua version are you using? > Latest release - 2.6.2.0 I tried out a snapshot and yes, there was a significant improvement. I've decided to stick with the C++ anyway though - this project is entirely a learning experience so thought it was worth improving my C++ as well as my lua ;-) I've now got it working to a reasonable level... have a look If you like: http://www.mcs.vuw.ac.nz/~simesrich/luacalc-latest.tar.gz supports excel-like functions & sorting. Richard |