Replacing the wxTexCtrl by any kind of window should work.
local baseID = wx.wxID_HIGHEST + 1
frame = wx.wxFrame(wx.NULL,wx.wxID_ANY, 'Test spin control')
local function GetChild(event, index, controlType)
local wlist = event:GetEventObject():DynamicCast("wxWindow"):GetParent
():GetChildren()
return wlist:Item(index):GetData():DynamicCast(controlType)
end
local function spinEvt(event)
local spinButton = event:GetEventObject():DynamicCast("wxSpinButton")
local textControl = GetChild(event, 0, "wxTextCtrl")
textControl.Value = tostring(spinButton.Value)
end
local function textEvt(event)
local textCtrl = event:GetEventObject():DynamicCast("wxTextCtrl")
local spinButton = GetChild(event, 1, "wxSpinButton")
local number = tonumber(textCtrl.Value)
if number then spinButton.Value = number end
end
function GetSpin(id, position)
local spinner = wx.wxControl(frame, id, position, wx.wxSize(100,50))
local tc = wx.wxTextCtrl(spinner, id, 'text', wx.wxPoint(0,0),wx.wxSize
(50,50))
local sc = wx.wxSpinButton(spinner, id, wx.wxPoint(50,0), wx.wxSize(50,50))
sc:Connect(wx.wxEVT_SCROLL_LINEDOWN, spinEvt)
sc:Connect(wx.wxEVT_SCROLL_LINEUP, spinEvt)
tc:Connect(wx.wxEVT_KEY_UP, textEvt)
return spinner
end
local sp = GetSpin(baseID, wx.wxPoint(0,0) )
sp = GetSpin(baseID + 1, wx.wxPoint(0,75))
frame:Show(true)
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users