Notifications
Clear all

[Closed] Hosting maxRollouts inside NET forms ?

is This possible ? i’m actually trying to host the regular Rollouts inside MaxForm
if not , is there any equivalent to rollouts in dotnet ?

4 Replies
 PEN

There is no way to do this that I’m aware of. I have not seen a rollout control for dotNet but it wouldn’t be hard to set up something that looks just the same. Note that there would be no way to host a Max script UI item in the dotNet rollout.

thanks Paul

that’s so sad to know , its not hard to setup something like max rollouts , true but being compatible and work like those controls AD provided is hard … i’ll take my chances and try to build one in c#
thanks again

 PEN

You need to consider that a Max rollout is not a dotNetControl, how would dotNet even know about them. You can do it the other way around. What I did in a recent project as I needed a mix I used a createDialog to display a rollout with sub rollouts in it. In one of the subs I have a dotNetControl that I populated with dotNetObjects and in the other I have Max rollouts.


try (DestroyDialog DotNetPanelRollout) catch()
Rollout DotNetPanelRollout "DotNetPanel" width:300 height:200
(
    DotNetControl DotNetPanel "System.Windows.Forms.Panel" Pos:[0,0] Width:DotNetPanelRollout.Width Height:DotNetPanelRollout.Height
    local Fn_FloatColorConvertToIntegerPoint3,Fn_PanelAddButton,Fn_PanelButtonMouseUpEvent

    Fn Fn_FloatColorConvertToIntegerPoint3 FloatColor = 
    (
        local IntegerColor = [0,0,0]
        if classof FloatColor == Point3 do
        (
            IntegerColor.X = (mod FloatColor.X 1) * 255
            IntegerColor.Y = (mod FloatColor.Y 1) * 255
            IntegerColor.Z = (mod FloatColor.Z 1) * 255
            IntegerColor
        ) 
        IntegerColor
    )
    
    Fn Fn_PanelAddButton TargetPanel =
    (
        local TempDotNetButton
        TempDotNetButton = DotNetObject "System.Windows.Forms.Button"
        TempDotNetButton.Text = "Left Click To Add || Right Click To Remove"
        TempDotNetButton.Size = DotNetObject "System.Drawing.Size" 50 50
        TempDotNetButton.BackColor = (DotNetClass "System.Drawing.Color").FromArgb (Random 0 255) (Random 0 255) (Random 0 255)
        TempDotNetButton.Dock = (DotNetclass "System.Windows.Forms.DockStyle").Top
        TargetPanel.Controls.Add TempDotNetButton 
        TempDotNetButton.BringToFront()
        DotNet.addEventHandler TempDotNetButton "MouseUp" Fn_PanelButtonMouseUpEvent 
    )
    
    Fn Fn_PanelButtonMouseUpEvent TheSender TheEvent = 
    (
        local MouseButton = DotnetClass "System.Windows.Forms.MouseButtons"
        if MouseButton.Left     == TheEvent.Button do Fn_PanelAddButton DotNetPanel
        if MouseButton.Right    == TheEvent.Button do TheSender.Parent.Controls.Remove TheSender
    )
    
    on DotNetPanelRollout open do
    (
        local MaxUIBackGroundColor
        MaxUIBackGroundColor = Fn_FloatColorConvertToIntegerPoint3 (ColorMan.GetColor #BackGround)
        DotNetPanel.BackColor = (DotNetClass "System.Drawing.Color").FromArgb  MaxUIBackGroundColor[1] MaxUIBackGroundColor[2] MaxUIBackGroundColor[3]
        DotNetPanel.AutoScroll = true
        Fn_PanelAddButton DotNetPanel
    )
    
    on DotNetPanelRollout resized RollSize do
    (
        DotNetPanel.Size = DotNetObject "System.Drawing.Size" RollSize[1] RollSize[2]
    )
)

CreateDialog DotNetPanelRollout
Cui.RegisterDialogBar DotNetPanelRollout