AhmedElyamani Posted January 25, 2012 Share Posted January 25, 2012 Hello, Yet again while using code lap (Still learning the very basics) , i had something that i can't sum up myself . Okay , what i need to do is to force the Angle chooser to allow the user to choose one of these values: 0.00 (Right) -45.00 (Down Right) -90.00 (Down) -135.00 (Down Left) -180.00 (Left) 135.00 (Top Left) 90.00 (Top) 45.00 (Top Right) These are the only directions i need the user to be able to get , (I Want the plugin to force that , i mean i don't want him to give -47.00 for example). Can somebody please help me? Thanks. Ahmed. Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted January 25, 2012 Share Posted January 25, 2012 I don't think there's a way to do it properly. You could use a dropdown list or just choose the closest one. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 25, 2012 Share Posted January 25, 2012 Let them choose any angle using the full angle chooser. Then programmatically clip the angle to the 45 degree increments: (chosen angle) mod 45 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Simon Brown Posted January 26, 2012 Share Posted January 26, 2012 Shouldn't that be 45 * (int)Math.Round(angle / 45, MidpointRounding.AwayFromZero)? Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 26, 2012 Share Posted January 26, 2012 It was pseudo code and even then it was wrong! Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
AhmedElyamani Posted January 26, 2012 Author Share Posted January 26, 2012 (edited) Gentlemen , i can Do it mathematically , but i don't want this , i don't want the user to be confused , i want a way to force the user to choose one of these . But if this fails , i'll just do it mathematically .. Ahmed Edited January 26, 2012 by AhmedElyamani Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 26, 2012 Share Posted January 26, 2012 This: ....You could use a dropdown list.... Or radio buttons (that will be a long UI). The alternative is to use Visual Studio and create your form and your own custom angle control. Significantly more work! Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
AhmedElyamani Posted January 27, 2012 Author Share Posted January 27, 2012 This: Or radio buttons (that will be a long UI). The alternative is to use Visual Studio and create your form and your own custom angle control. Significantly more work! That's Ok i used A drop down list , it kinda does it . Ahmed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.