From: John L. <jr...@us...> - 2007-06-08 01:36:58
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/scripts In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15480/wxLua/apps/wxluacan/scripts Modified Files: incircles.lua Log Message: Add a simple method to get the binding info, seems small and works well Addd sample lua program bindings.wx.lua to show them in a listctrl Fix incircles to work with new bindings Put the "name" of the struct binding items first always Index: incircles.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/scripts/incircles.lua,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** incircles.lua 4 May 2007 19:04:41 -0000 1.9 --- incircles.lua 8 Jun 2007 01:36:21 -0000 1.10 *************** *** 1,22 **** ----------------------------------------------------------------------------- -- Name: incircles.lua ! -- Purpose: Sample wxLua program for wxLua's wxluacan sample app -- Author: Klaas Holwerda -- Modified by: ! -- Created: ! -- RCS-ID: -- Copyright: (c) 2005 Klaas Holwerda. All rights reserved. -- Licence: wxWidgets licence ----------------------------------------------------------------------------- ! bluebrush = wx.wxBrushFromColourName("Blue", wx.wxSOLID) ! redbrush = wx.wxBrushFromColourName("Red", wx.wxSOLID) ! purplebrush = wx.wxBrushFromColourName("Purple", wx.wxSOLID) ! greenbrush = wx.wxBrushFromColourName("Green", wx.wxSOLID) ! bluepen = wx.wxPenFromColourName("Blue", 5, wx.wxSOLID) ! redpen = wx.wxPenFromColourName("Red", 2, wx.wxSOLID) ! purplepen = wx.wxPenFromColourName("Purple", 10, wx.wxSOLID) ! greenpen = wx.wxPenFromColourName("Green", 2, wx.wxSOLID) ! purplepen1p = wx.wxPenFromColourName("Purple", 1, wx.wxSOLID) function MonoDraw( dc, x, y ) --- 1,22 ---- ----------------------------------------------------------------------------- -- Name: incircles.lua ! -- Purpose: Sample wxLua program for wxLua's wxluacan sample app -- Author: Klaas Holwerda -- Modified by: ! -- Created: ! -- RCS-ID: -- Copyright: (c) 2005 Klaas Holwerda. All rights reserved. -- Licence: wxWidgets licence ----------------------------------------------------------------------------- ! bluebrush = wx.wxBrush("Blue", wx.wxSOLID) ! redbrush = wx.wxBrush("Red", wx.wxSOLID) ! purplebrush = wx.wxBrush("Purple", wx.wxSOLID) ! greenbrush = wx.wxBrush("Green", wx.wxSOLID) ! bluepen = wx.wxPen("Blue", 5, wx.wxSOLID) ! redpen = wx.wxPen("Red", 2, wx.wxSOLID) ! purplepen = wx.wxPen("Purple", 10, wx.wxSOLID) ! greenpen = wx.wxPen("Green", 2, wx.wxSOLID) ! purplepen1p = wx.wxPen("Purple", 1, wx.wxSOLID) function MonoDraw( dc, x, y ) *************** *** 48,54 **** dc:SetPen( redpen ) for i = -20, 20 do ! local y2 if i ~= 0 then ! y2 = 150*math.sin(i/2)/(i/2) else y2 = 150; --sin(x)/x goes to one at zero --- 48,54 ---- dc:SetPen( redpen ) for i = -20, 20 do ! local y2 if i ~= 0 then ! y2 = 150*math.sin(i/2)/(i/2) else y2 = 150; --sin(x)/x goes to one at zero *************** *** 72,76 **** end ! function AddSome() for list = 1, 10 do --- 72,76 ---- end ! function AddSome() for list = 1, 10 do *************** *** 83,87 **** if wx.wxMessageBox( "Now we will add some objects to the canvas", "wxLuaCan Message", ! wx.wxYES_NO + wx.wxCENTRE) == wx.wxYES then -- fill the canvas --- 83,87 ---- if wx.wxMessageBox( "Now we will add some objects to the canvas", "wxLuaCan Message", ! wx.wxYES_NO + wx.wxCENTRE) == wx.wxYES then -- fill the canvas *************** *** 89,93 **** canobjrect = wxluacan.wxlCanObjRect( 40, 160, 100, 40) canobjrect:SetBrush( bluebrush ) ! canobjrect:SetPen( purplepen ) canvas:AddObject( canobjrect ) canobjrect:SetPending( true ) --- 89,93 ---- canobjrect = wxluacan.wxlCanObjRect( 40, 160, 100, 40) canobjrect:SetBrush( bluebrush ) ! canobjrect:SetPen( purplepen ) canvas:AddObject( canobjrect ) canobjrect:SetPending( true ) *************** *** 114,118 **** end ]] ! -- add the object using the above string as input script canobjAddScript = wxluacan.wxlCanObjAddScript( 150, 250, TheObjectAddScript ) --- 114,118 ---- end ]] ! -- add the object using the above string as input script canobjAddScript = wxluacan.wxlCanObjAddScript( 150, 250, TheObjectAddScript ) *************** *** 130,136 **** canobj:AddObject( canobj1 ) for i = -30, 30 do ! local y2 if i ~= 0 then ! y2 = -150*math.sin(i/3)/(i/3) else y2 = -150; --sin(x)/x goes to one at zero --- 130,136 ---- canobj:AddObject( canobj1 ) for i = -30, 30 do ! local y2 if i ~= 0 then ! y2 = -150*math.sin(i/3)/(i/3) else y2 = -150; --sin(x)/x goes to one at zero *************** *** 142,146 **** end ]] ! -- add the object using the above string as input script canobjAddScript = wxluacan.wxlCanObjAddScript( 150, 250, TheObjectAddScript_2 ) --- 142,146 ---- end ]] ! -- add the object using the above string as input script canobjAddScript = wxluacan.wxlCanObjAddScript( 150, 250, TheObjectAddScript_2 ) |