Recently i wrote a script that allow you to use the calculator inside 3ds max.
Now I have a few questions about two things:
#1 How to force the drop down to be open all the time.
#2 Is it possible to activate all keys of the numpad to be able to works like with standard Windows Calculator. (enter = equals)
This is the code
(
try(destroydialog ::CalcRoll) catch()
rollout CalcRoll " maxCalculator v1.0" width:(if (maxVersion())[1] == 14000 then (208) else (220)) height:20
(
dotNetControl mxsPnl "MaxCustomControls.MaxUserControl" pos:[0,0]
fn defPoint x y = (dotNetObject "System.Drawing.Point" x y)
fn defSize x y = (dotNetObject "System.Drawing.Size" x y)
fn defColor r g b = ((dotNetClass "System.Drawing.Color").FromArgb r g b)
fn defCalcObj dxCalc Pnl w h bgClr =
(
dxCalc.Location = defPoint (Pnl.pos.x) (Pnl.pos.y)
dxCalc.Width = w ; dxCalc.Height = h ; dxCalc.BackColor = bgClr
)
fn DisableAccel = (enableAccelerators = false) ; fn EnableAccel = (enableAccelerators = true)
fn dxCalcGF = (DisableAccel()) ; fn dxCalcLF = (EnableAccel())
local dncGC = dotNetClass "System.GC"
local bgCol = (defColor 240 240 220)
on CalcRoll open do
(
mxsPnl.Width = CalcRoll.width ; mxsPnl.Height = CalcRoll.height
dxCalc = dotNetObject "DevExpress.XtraEditors.CalcEdit"
defCalcObj dxCalc mxsPnl mxsPnl.Width mxsPnl.Height bgCol
dotnet.AddEventHandler dxCalc "GotFocus" dxCalcGF
dotnet.AddEventHandler dxCalc "LostFocus" dxCalcLF
mxsPnl.Controls.Add(dxCalc)
)
on CalcRoll close do ( dncGC.collect() ; gc light:true ; clearListener() )
)
createDialog CalcRoll style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
)
Thanks in advance

