On Sat, May 30, 2009 at 8:19 AM, lostgallifreyan
<lostgallifre...@gmail.com> wrote:
>
> I thought wxLua was a C-coded binary. But I did notice that the Lua script 
> produced what appeared to be the same thing. I think you mentioned this a 
> month or so back, but I still manage to get confused by this. How much of the 
> wxLua editor is actually Lua?

All of it, except for command line processing.

>>>That fails too because it doesn't recognise spaces in file names! This is 
>>>definitely not
>>> an improvement. While the script does open in wxLua, it won't run because 
>>> even though
>>> it has it opened, it can't actually FIND it by file name to run it.
>>
>>Really? I have no problems opening files with spaces in its name.
>>Please give more details.
>
> Not much I can add, but there is some...
> I open the file "GPS Chart/lua" by manually browsing from the v2.10 wxLua, 
> then try to run it from the Debug menu. A "wxLua Console" window pops up 
> saying:
> Lua: Error occurred while opening file
> cannot open C:\WINDOWS\Desktop\GPS: No such file or directory
>

It is probably failing in the function "OpenFile(event)" or io.open()
in LoadFile() in editor.wx.lua. As you can see, there's no special
filename processing going on. Can you open the file if you hardcode
the path for io.open() in LoadFile()?

>>
>>> Another thing I have found is a failure in EVT_ERASE_BACKGROUND blocking. 
>>> I'm getting
>>> flicker in something that didn't flicker in the previous release of wxLua. 
>>> Note the two commented lines...
>>

Yes the static bitmap flickers. Why don't you draw it yourself like this?

function Main()
 FRAME=wx.wxFrame(wx.NULL,-1,"")
 FRAME:CreateStatusBar()  FRAME:SetStatusText(" ")
 LAYER=wx.wxPanel(FRAME,-1)  PANEL=wx.wxPanel(FRAME,-1)
--CHART=wx.wxStaticBitmap(PANEL,-1)
 FRAME:SetSize(800,600)  FRAME:Centre()

 BITMAP=wx.wxBitmap("image.jpg")
 BX,BY,OX,OY,PX,PY=BITMAP:GetWidth(),BITMAP:GetHeight(),0,0,0,0
--CHART:SetBitmap(BITMAP)

 FRAME:Connect(wx.wxEVT_SIZE,OnSize)
 LAYER:Connect(wx.wxEVT_LEFT_DOWN,function(E)
PX,PY=OX-E:GetX(),OY-E:GetY()  end)
 LAYER:Connect(wx.wxEVT_MOTION,OnMotion)
 LAYER:Connect(wx.wxEVT_ERASE_BACKGROUND,function() end)
 PANEL:Connect(wx.wxEVT_ERASE_BACKGROUND,function() end)  --Either of
these ought to stop flicker but don't.
 --CHART:Connect(wx.wxEVT_ERASE_BACKGROUND,function() end)  --Neither
of them are needed in earlier wxLua anyway.

 PANEL:Connect(wx.wxEVT_PAINT,OnPaint)

 FRAME:Show(true)
end

function OnPaint(E)
    local pdc = wx.wxPaintDC(E:GetEventObject():DynamicCast("wxWindow"))
    pdc:DrawBitmap(BITMAP, OX, OY, false)
    pdc:delete()
end

function OnSize(E)
 CX,CY=FRAME:GetClientSizeWH()  PANEL:SetClientSize(CX,CY)
LAYER:SetClientSize(CX,CY)  CX,CY=CX-BX,CY-BY
 if OX<CX then  OX=CX  end  if OY<CY then  OY=CY  end  LAYER:Refresh()
 PANEL:Refresh()
end

function OnMotion(E)
 if E:LeftIsDown() then
   OX,OY=PX+E:GetX(),PY+E:GetY()
   if OX>0 then  OX=0  end  if OY>0 then  OY=0  end  if OX<CX then
OX=CX  end  if OY<CY then  OY=CY  end
   --CHART:Move(OX,OY)
   PANEL:Refresh()
 end
end

Main()

Regards,
    John

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to