I couldn't run that one... it throws errors I can't even interpret with my limited knowledge. Lack of 'strict' to require, whatever it is.., lack of value for #textControls, some of the error messages I saw resulting from my attempts to fix this had so many lines I didn't even try to diagnose them.
After correcting a linewrap and omitting the first three lines of code I saw a displayed frame but it looks like this is all headed in directions I really don't want to go. > maybe wxEVT_COMMAND_SPINCTRL_UPDATED might work I did not try it. First thing I tried. This is the core of the problem, because it doesn't work! If the value does not change because it is already at set limit, no event signal is sent, so we cannot handle this case, ever! This is where we need to return to my first mail and consider the implications deeply. > You probably want the text to always be numeric etc leaving this to the > reader, always mean to me the writer has no clue how to doit :) Well, yes. :) That's sort of the point. Like I said in the first mail, we often need to show the user a list of stuff like thread sizes, musical note values... The original Spinctrl could handle this. Any valid (in-range) numeric input typed and entered would work, and my FeedBack() function would update the Spinctrl with a text display that made much better sense to the user than the number, which the machine was better able to use. So everyone's happy. Or they were, until some wiseguy broke Spinctrl! Andre Arpin <ar...@kingston.net> wrote: (30/12/2010 18:23) >try this you have full control if yo do not like using the ID for an offset to >an index you could use Set/GetClientData on the control > >textControl.ClientData = #textControls >spinControl.ClientData = #textControls > >require 'strict' >local baseID = wx.wxID_HIGHEST + 1 > >textControls = {} >frame = wx.wxFrame(wx.NULL, wx.wxID_ANY,'Test spin control') >frame:Show(true) > >function spin(event) > local localSpin = event:GetEventObject():DynamicCast("wxSpinButton") > print(localSpin.Value) > print(event.Id) > textControls[event.Id - baseID + 1][1].Value = tostring >(localSpin.Value)..'!' >end > >function text(event) > print(event.KeyCode) > event:Skip() > local localText = event:GetEventObject():DynamicCast("wxTextCtrl") > local v = tonumber(localText.Value) > print(v) > if v then > textControls[event.Id - baseID + 1][2].Value = v > end >end > >for ID= baseID, baseID + 10 do > local top = 30*#textControls > local textControl = wx.wxTextCtrl(frame, ID, 'test', wx.wxPoint(20,top)) > local spinControl=wx.wxSpinButton(frame, ID, wx.wxPoint(0,top)) > table.insert(textControls, {textControl, spinControl}) > spinControl:SetRange(10,20) > spinControl:Connect(wx.wxEVT_SCROLL_LINEUP, spin) > spinControl:Connect(wx.wxEVT_SCROLL_LINEDOWN, spin) > textControl:Connect(wx.wxEVT_KEY_DOWN, text) >end > >wx.wxGetApp():MainLoop() > >maybe wxEVT_COMMAND_SPINCTRL_UPDATED might work I did not try it. > >You probably want the text to always be numeric etc leaving this to the >reader, always mean to me the writer has no clue how to doit :) > >Good luck > >Andre > > >------------------------------------------------------------------------------ >Learn how Oracle Real Application Clusters (RAC) One Node allows customers >to consolidate database storage, standardize their database environment, and, >should the need arise, upgrade to a full multi-node Oracle RAC database >without downtime or disruption >http://p.sf.net/sfu/oracle-sfdevnl >_______________________________________________ >wxlua-users mailing list >wxlua-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/wxlua-users ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users