453
« on: June 21, 2016, 03:53:44 PM »
Then on a case like that then not, the only work around i know would be to use a panel then inside the panel create a bitmap button and use the event codes to your likeing. you can create such things with formbuilder.
Example from my own screen might get you on track ;-)
local cstart_btn_dis = btn_path.."CStart_dis.png"
local cstart_btn_dwn = btn_path.."CStart_dwn.png"
local cstart_btn_up = btn_path.."CStart_up.png"
local cstart_btn_hov = btn_path.."CStart_hov.png"
Cont.cstart_btn = wx.wxBitmapButton( Cont.Panel, wx.wxID_ANY, wx.wxBitmap( cstart_btn_up, wx.wxBITMAP_TYPE_ANY ), wx.wxPoint(10,440), wx.wxDefaultSize, wx.wxBU_AUTODRAW + wx.wxNO_BORDER)
Cont.cstart_btn:SetBackgroundColour( wx.wxSystemSettings.GetColour( wx.wxSYS_COLOUR_ACTIVECAPTION ) )
Cont.cstart_btn:SetBitmapDisabled( wx.wxBitmap( cstart_btn_dis, wx.wxBITMAP_TYPE_ANY ) )
Cont.cstart_btn:SetBitmapSelected( wx.wxBitmap( cstart_btn_dwn, wx.wxBITMAP_TYPE_ANY ) )
Cont.cstart_btn:SetBitmapFocus( wx.wxBitmap( cstart_btn_up, wx.wxBITMAP_TYPE_ANY ) )
Cont.cstart_btn:SetBitmapHover( wx.wxBitmap( cstart_btn_hov, wx.wxBITMAP_TYPE_ANY ) )
Cont.cstart_btn:SetToolTip( "Cycle Start" )
Cont.cstart_btn:Connect( wx.wxEVT_LEFT_UP, function(event)
mc.mcCntlCycleStart(inst);
Cont.main_gcode:SetFocus()
gcLine_timer:Start(100)
event:Skip()
end )
The code above is useing the EVT_LEFT_UP but you can add the EVT_LEFT_DOWN to start the jogging and then the EVT_LEFT_UP and EVT_LEAVE_WINDOW to stop the joggin.
DazTheGas