码迷,mamicode.com
首页 > 其他好文 > 详细

MaxScript 一些结构的记录

时间:2019-12-03 01:27:23      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:control   show   window   box   ati   end   click   controls   button   

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 一些结构的记录

标签:control   show   window   box   ati   end   click   controls   button   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!