首页 > 其他 > 详细

MaxScript 一些结构的记录

时间:2019-12-03 03:23:35      阅读:100      评论:0      收藏:0      [点我收藏+]
struct maxFormBuilderStruct
(
    
    theFrm = dotNetObject "MaxCustomControls.MaxForm"
    ,theBtn = dotNetObject "System.Windows.Forms.Button"
    ,fn theFunc = messageBox "123"
    
    ,on create do
    (
        DotNet.AddEventHandler this.theBtn "click" this.theFunc
        
        this.theFrm.controls.add this.theBtn
        this.theFrm.Show(theHwnd)
    )
)
--maxFormBuilderStruct()
------------------------------------------------------------

rollout maxFormBuilderRoll ""
(
    local theFrm = dotNetObject "MaxCustomControls.MaxForm"
    local theBtn = dotNetObject "System.Windows.Forms.Button"
    
    fn theFunc = messageBox "456"
    
    fn init =
    (
        DotNet.AddEventHandler theBtn "click" theFunc
        theFrm.controls.add theBtn
        theFrm.Show(theHwnd)
    )
)

--maxFormBuilderRoll.init()
------------------------------------------------------------
fn maxFormBuilderFunc = 
(
    local controls = #()
    local theFrm = dotNetObject "MaxCustomControls.MaxForm"; append controls theFrm
    local theBtn = dotNetObject "System.Windows.Forms.Button"; append controls theBtn
    theFrm.controls.add theBtn

    thePtr = DotNetObject "System.IntPtr" (windows.getMAXHWND())
    theHwnd = (dotNetObject "System.Windows.Forms.NativeWindow").FromHandle thePtr
    
    fn theFunc = messageBox "789"
    DotNet.AddEventHandler theBtn "click" theFunc
    
    theFrm.Show(theHwnd)
    return controls
)

--maxFormBuilderFunc()

MaxScript 一些结构的记录

原文:https://www.cnblogs.com/trykle/p/11974131.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!