For some reason my code stops working after i edit the screen (even if i enter edit mode and then immediately exit it). It works perfectly fine at start up. Here is an abridged version of the code if anyone has any ideas.
local jog_btn_up ="blah"
local jog_btn_dn ="blah"
local jog_btn_lt ="blah"
local jog_btn_rt ="blah"
local panel = mcLuaPanelParent;
local window = panel:GetParent();
window:SetBackgroundColour(wx.wxColour(230, 230, 230));
local up_btn = wx.wxBitmapButton( childPanel, wx.wxID_ANY, wx.wxBitmap( jog_btn_up, wx.wxBITMAP_TYPE_ANY ), wx.wxPoint(100,0), wx.wxSize(60,70))
local dn_btn = wx.wxBitmapButton( childPanel, wx.wxID_ANY, wx.wxBitmap( jog_btn_dn, wx.wxBITMAP_TYPE_ANY ), wx.wxPoint(100,80), wx.wxSize(60,70))
local lt_btn = wx.wxBitmapButton( childPanel, wx.wxID_ANY, wx.wxBitmap( jog_btn_lt, wx.wxBITMAP_TYPE_ANY ), wx.wxPoint(20,45), wx.wxSize(70,60))
local rt_btn = wx.wxBitmapButton( childPanel, wx.wxID_ANY, wx.wxBitmap( jog_btn_rt, wx.wxBITMAP_TYPE_ANY ), wx.wxPoint(170,45), wx.wxSize(70,60))
up_btn:Connect(wx.wxEVT_LEFT_UP,
function(event)
--blah
end)
up_btn:Connect(wx.wxEVT_LEFT_DOWN,
function(event)
--blah
end)
up_btn:Connect(wx.wxEVT_LEAVE_WINDOW,
function(event)
--blah
end)
dn_btn:Connect(wx.wxEVT_LEFT_UP,
function(event)
--blah
end)
dn_btn:Connect(wx.wxEVT_LEFT_DOWN,
function(event)
--blah
end)
dn_btn:Connect(wx.wxEVT_LEAVE_WINDOW,
function(event)
--blah
end)
rt_btn:Connect(wx.wxEVT_LEFT_UP,
function(event)
--blah
end)
rt_btn:Connect(wx.wxEVT_LEFT_DOWN,
function(event)
--blah
end)
rt_btn:Connect(wx.wxEVT_LEAVE_WINDOW,
function(event)
--blah
end)
lt_btn:Connect(wx.wxEVT_LEFT_UP,
function(event)
--blah
end)
lt_btn:Connect(wx.wxEVT_LEFT_DOWN,
function(event)
--blah
end)
lt_btn:Connect(wx.wxEVT_LEAVE_WINDOW,
function(event)
--blah
end)