91
Mach4 General Discussion / Re: more lua (?) questions
« on: May 03, 2017, 12:39:07 AM »
@Steve
Yes, I treaten it wrong. Now I understood, that mcProfileGetString is used to determine, whether to show the toolchanger dialog.
@DTG
Thanks for the hint about wxFormbuilder. I installed the linux-variant from github - which was straight forward.
@spindoctor
starting the formbuilder shows up, that the builder is targeted to developers, that don't need it =:O
You need the wxWidgets docs. The key of wxWindows are the sizers - when you got that, the rest is straight forward.
But of cause, building gui with formbuilder is not as easy as java gui
anyway - I got it and I'm quite content with my new toolchanger dialog (see picture below)
My changes are - small changes to Mc Master:
Yes, I treaten it wrong. Now I understood, that mcProfileGetString is used to determine, whether to show the toolchanger dialog.
@DTG
Thanks for the hint about wxFormbuilder. I installed the linux-variant from github - which was straight forward.
@spindoctor
starting the formbuilder shows up, that the builder is targeted to developers, that don't need it =:O
You need the wxWidgets docs. The key of wxWindows are the sizers - when you got that, the rest is straight forward.
But of cause, building gui with formbuilder is not as easy as java gui
anyway - I got it and I'm quite content with my new toolchanger dialog (see picture below)
My changes are - small changes to Mc Master:
Code: [Select]
--M6 message box
UI.MyFrame1 = wx.wxDialog (wx.NULL, wx.wxID_ANY, tostring(m_title), wx.wxDefaultPosition, wx.wxSize( 620, 270 ), wx.wxCAPTION + wx.wxCLOSE_BOX + wx.wxSTAY_ON_TOP + wx.wxSYSTEM_MENU+wx.wxTAB_TRAVERSAL )
UI.MyFrame1:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )
UI.MyFrame1 :SetBackgroundColour( wx.wxSystemSettings.GetColour( wx.wxSYS_COLOUR_3DLIGHT ))
UI.fgSizer1 = wx.wxFlexGridSizer( 2, 1, 0, 0 )
UI.fgSizer1:AddGrowableCol( 0 )
UI.fgSizer1:AddGrowableRow( 0 )
UI.fgSizer1:SetFlexibleDirection( wx.wxBOTH )
UI.fgSizer1:SetNonFlexibleGrowMode( wx.wxFLEX_GROWMODE_ALL )
UI.bSizer1 = wx.wxBoxSizer( wx.wxVERTICAL )
UI.m_staticText1 = wx.wxStaticText( UI.MyFrame1, wx.wxID_ANY, tostring(m_message), wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxALIGN_CENTRE )
UI.m_staticText1:Wrap( -1 )
UI.m_staticText1:SetFont( wx.wxFont( 18, wx.wxFONTFAMILY_DEFAULT, wx.wxFONTSTYLE_NORMAL, wx.wxFONTWEIGHT_NORMAL, False, "" ) )
UI.bSizer1:Add( UI.m_staticText1, 0, wx.wxALIGN_CENTER + wx.wxEXPAND, 5 )
UI.fgSizer1:Add( UI.bSizer1, 1, wx.wxEXPAND, 5 )
UI.bSizer2 = wx.wxBoxSizer( wx.wxVERTICAL )
UI.m_okay = wx.wxButton( UI.MyFrame1, wx.wxID_ANY, "Ok", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
UI.bSizer2:Add( UI.m_okay, 0, wx.wxALL, 5 )
UI.fgSizer1:Add( UI.bSizer2, 1, wx.wxALIGN_CENTER_HORIZONTAL, 5 )
UI.MyFrame1:SetSizer( UI.fgSizer1 )
UI.MyFrame1:Layout()
UI.MyFrame1:Centre( wx.wxBOTH )
-- Connect Events
UI.m_okay:Connect( wx.wxEVT_LEFT_UP, function(event)
UI.MyFrame1:Destroy()
end ) -- end of m_okay:Connect() !
UI.MyFrame1:ShowModal(true)
return UI;
end
and some changes to the screen startup code (signal array):Code: [Select]
--M6 messagebox
[mc.OSIG_TOOL_CHANGE] = function (state)
local selectedtool = mc.mcToolGetSelected(inst)
local currenttool = mc.mcToolGetCurrent(inst)
if (selectedtool ~= currenttool) then
if( state == 1) then
local tmp = mc.mcToolGetDesc(inst, selectedtool)
mm.ToolChangeMsg('\n Ein Werkzeugwechsel wurde mit M6 angefordert. \nBitte das folgende Werkzeug einlegen:\n\n#' .. selectedtool .. '\t>>' .. tmp .. '<< ' .. '\n\n und mit Druck auf \"Start\" Verarbeitung fortsetzen!', 'Werkzeugwechsel im Gange!')
end
end
end