1
Mach4 General Discussion / Re: Bitmap buttons left up action
« on: June 23, 2016, 09:25:58 AM »
Interesting. Tacking on enabling/disabling the panel to the controls enable/disable toggle button fixed the problem.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
At a quick glance you are trying to put the bitmaps onto "childPanel" that does not exist, try "panel" thats already declared ;-)Shoot! That is left over from when I tried seeing if putting another panel on top would fix the problem. Even with those lines fixed it still wont work after leaving the edit mode :/
another thing thats ver good practice is to use "event:Skip()" within each event at the end
DazTheGas
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)