<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Maxscript .net Spinner in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190304#M20606</link>
    <description>&lt;PRE&gt;form=dotNetObject "form"&lt;BR /&gt;&lt;BR /&gt;nud=dotNetObject "System.Windows.Forms.NumericUpDown"&lt;BR /&gt;nud.DecimalPlaces=2&lt;BR /&gt;nud.Increment=.1&lt;BR /&gt;nud.maximum=10&lt;BR /&gt;nud.minimum=-10&lt;BR /&gt;nud.ReadOnly=false&lt;BR /&gt;showProperties nud&lt;BR /&gt;&lt;BR /&gt;form.controls.add nud&lt;BR /&gt;form.show()&lt;/PRE&gt;</description>
    <pubDate>Fri, 25 Feb 2011 19:40:59 GMT</pubDate>
    <dc:creator>paulneale</dc:creator>
    <dc:date>2011-02-25T19:40:59Z</dc:date>
    <item>
      <title>Maxscript .net Spinner</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190303#M20605</link>
      <description>How do i get the spinner to scrub through values like the max spinner when the cursor is dragged up or down.&lt;BR /&gt;How do i place a decimal value in it as well?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;rollout NumericUpDownTestRollout "" height:50 width:80&lt;BR /&gt;(&lt;BR /&gt; dotNetControl upDown "System.Windows.Forms.NumericUpDown" align:#center height:50 width:50&lt;BR /&gt;&lt;BR /&gt; on NumericUpDownTestRollout open do&lt;BR /&gt; (&lt;BR /&gt; upDown.Value = 50&lt;BR /&gt; upDown.Maximum = 100&lt;BR /&gt; upDown.Minimum = 0&lt;BR /&gt; )&lt;BR /&gt;)&lt;BR /&gt;createdialog NumericUpDownTestRollout&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Feb 2011 18:30:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190303#M20605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-25T18:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript .net Spinner</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190304#M20606</link>
      <description>&lt;PRE&gt;form=dotNetObject "form"&lt;BR /&gt;&lt;BR /&gt;nud=dotNetObject "System.Windows.Forms.NumericUpDown"&lt;BR /&gt;nud.DecimalPlaces=2&lt;BR /&gt;nud.Increment=.1&lt;BR /&gt;nud.maximum=10&lt;BR /&gt;nud.minimum=-10&lt;BR /&gt;nud.ReadOnly=false&lt;BR /&gt;showProperties nud&lt;BR /&gt;&lt;BR /&gt;form.controls.add nud&lt;BR /&gt;form.show()&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Feb 2011 19:40:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190304#M20606</guid>
      <dc:creator>paulneale</dc:creator>
      <dc:date>2011-02-25T19:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript .net Spinner</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190305#M20607</link>
      <description>Forgot to mention &lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;enableAccelerators=false&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;so that you can type in the value as well.</description>
      <pubDate>Fri, 25 Feb 2011 19:44:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190305#M20607</guid>
      <dc:creator>paulneale</dc:creator>
      <dc:date>2011-02-25T19:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript .net Spinner</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190306#M20608</link>
      <description>And I completely forgot to answer the other question. You are going to have to use multiple event handlers and track the movement of the mouse your self.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.penproductions.ca/tutorials/dotNet/numericUpDown/numericUpDown.htm" target="_blank"&gt;http://www.penproductions.ca/tutorials/dotNet/numericUpDown/numericUpDown.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;--Create a dotNet form control.&lt;BR /&gt;form=dotNetObject "form"&lt;BR /&gt;&lt;BR /&gt;--Create a dotNet NumericUpDown control.&lt;BR /&gt;nud=dotNetObject "System.Windows.Forms.NumericUpDown"&lt;BR /&gt;nud.DecimalPlaces=2&lt;BR /&gt;nud.Increment=.1&lt;BR /&gt;nud.maximum=1000&lt;BR /&gt;nud.minimum=-10&lt;BR /&gt;nud.value=10&lt;BR /&gt;nud.ReadOnly=false&lt;BR /&gt;&lt;BR /&gt;--This is needed so that we can type in the values as well as use the spinner. &lt;BR /&gt;enableAccelerators=false&lt;BR /&gt;&lt;BR /&gt;--Set variables to hold the mouse position and current value of the spinner. &lt;BR /&gt;lastMousePos=0&lt;BR /&gt;curVal=0&lt;BR /&gt;&lt;BR /&gt;--Mouse down function to set the variables above to the starting values. &lt;BR /&gt;fn nudMouseDown sender arg=&lt;BR /&gt;(&lt;BR /&gt; case arg.button of&lt;BR /&gt; (&lt;BR /&gt; --Check for the left mouse button&lt;BR /&gt; (arg.button.left):&lt;BR /&gt; (&lt;BR /&gt; lastMousePos=(arg.location).y&lt;BR /&gt; curVal=sender.value&lt;BR /&gt; )&lt;BR /&gt; --Check for the right mouse button&lt;BR /&gt; (arg.button.right):&lt;BR /&gt; (&lt;BR /&gt; sender.value=0&lt;BR /&gt; )&lt;BR /&gt; )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;--On mouseMove event&lt;BR /&gt;fn nudMouseMove sender arg=&lt;BR /&gt;(&lt;BR /&gt; case arg.button of&lt;BR /&gt; (&lt;BR /&gt; --Check for the left mouse button. &lt;BR /&gt; (arg.button.left):&lt;BR /&gt; (&lt;BR /&gt; --Get the offset from the last position of the mouse&lt;BR /&gt; mouseOffSetY=(lastMousePos-arg.location.y)*.1&lt;BR /&gt; --Add that position to the curVal variable&lt;BR /&gt; curVal=curVal+=mouseOffSetY&lt;BR /&gt; &lt;BR /&gt; --Check if the curVal is within limits of the spinner.&lt;BR /&gt; if curVal&amp;gt;=sender.minimum and curVal&amp;lt;=sender.maximum do&lt;BR /&gt; (&lt;BR /&gt; --Set the value of the spinner&lt;BR /&gt; sender.value=curVal&lt;BR /&gt; )&lt;BR /&gt; --Check if the value has gone above or below the min max values and set them.&lt;BR /&gt; --This is needed if the value changes more rapidly then the spinner can react.&lt;BR /&gt; if curVal&amp;lt;sender.minimum do sender.value=sender.minimum&lt;BR /&gt; if curVal&amp;gt;sender.maximum do sender.value=sender.maximum&lt;BR /&gt; &lt;BR /&gt; --Set the lastMousePos value to the current value of the mouse. &lt;BR /&gt; lastMousePos=arg.location.y&lt;BR /&gt; )&lt;BR /&gt; )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;--Create the event handlers&lt;BR /&gt;dotNet.addEventHandler nud "mouseDown" nudMouseDown&lt;BR /&gt;dotNet.addEventHandler nud "mouseMove" nudMouseMove&lt;BR /&gt;--Set the life time control of the spinner to be handled by dot net and not Max script. &lt;BR /&gt; --This stops garbage collections from deleting the event handlers. &lt;BR /&gt;dotNet.setLifeTimeControl nud #dotNet&lt;BR /&gt;&lt;BR /&gt;--Add the NumericUpDown to the form and show the form. &lt;BR /&gt;form.controls.add nud&lt;BR /&gt;form.show()&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Feb 2011 21:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190306#M20608</guid>
      <dc:creator>paulneale</dc:creator>
      <dc:date>2011-02-25T21:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript .net Spinner</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190307#M20609</link>
      <description>Thanks Paule,&lt;BR /&gt;I was searching the net for solutions and a lot of the sites and forums I found were just other people asking how to do it. There were no solutions. It's to bad the .net spinner by default does not do the same things as the max spinner. It is a bummer that the .net spinner requires a handful of code to equal that of max. &lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Fri, 25 Feb 2011 21:39:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-net-spinner/m-p/4190307#M20609</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-25T21:39:43Z</dc:date>
    </item>
  </channel>
</rss>

