Class PmpNumberBox
- Namespace
- Hymma.Solidworks.Addins
- Assembly
- Hymma.Solidworks.Addins.dll
creates and allows you to access a number box in a property manager page
public class PmpNumberBox : PmpTextBase<IPropertyManagerPageNumberbox>, IWrapSolidworksObject<IPropertyManagerPageNumberbox>, IReleaseSolidworksObject
- Inheritance
-
PmpControl<IPropertyManagerPageNumberbox>PmpTextBase<IPropertyManagerPageNumberbox>PmpNumberBox
- Implements
-
IWrapSolidworksObject<IPropertyManagerPageNumberbox>
- Inherited Members
Constructors
PmpNumberBox(NumberBoxStyles)
creates a number box in a property manager page
public PmpNumberBox(NumberBoxStyles style = NumberBoxStyles.Default)
Parameters
styleNumberBoxStylesstyle for this numberBox as defined by NumberBoxStyles
Properties
DisplayedUnit
Gets or sets the unit type to display in this PropertyManager page number box.
public NumberBoxUnit DisplayedUnit { get; set; }
Property Value
Remarks
DisplayedUnitallows an add-in to have a number box that shows length values in inches, even though the system default units are meters.
DisplayedUnit simply controls how that value is displayed in the PropertyManager page number box.
You can call this porperty and change the units displayed in a number box while a Propertymanager page is displayed.
Height
Gets or sets the maximum height of the attached drop-down list for this number box.
public short Height { get; set; }
Property Value
Style
style for this numberBox as defined by NumberBoxStyles
public NumberBoxStyles Style { get; set; }
Property Value
Value
Gets and sets the value that appears in the number box.
public double? Value { get; set; }
Property Value
Remarks
will be null if called before AddControl(IPmpControl)
Methods
AddItems(string[])
Adds items to the attached drop-down list of a number box.
public void AddItems(string[] items)
Parameters
itemsstring[]
InsertItem(short, string)
Inserts an item in the attached drop-down list for this number box.
public short InsertItem(short item, string text)
Parameters
itemshortPosition where to add the item in the 0-based list or -1 to put the item at the end of the list
textstringText for item
Returns
SetRange(NumberBoxUnit, double, double, bool, double, double, double)
Sets the range and increment for the slider.
public void SetRange(NumberBoxUnit Units, double Minimum, double Maximum, bool Inclusive, double Increment, double fastIncrement, double slowIncrement)
Parameters
UnitsNumberBoxUnitNumber box units as defined in NumberBoxUnit (see Remarks)
MinimumdoubleMaximumdoubleInclusiveboolwhether the max should be inclusive in the range or not
Incrementdoubleincrement in meter
fastIncrementdoubleFast increment value for scrolling and mouse-wheel
slowIncrementdoubleSlow increment value for scrolling and mouse-wheel
Remarks
This method works while a PropertyManager page is displayed with these restrictions:
You cannot change Units once the page is displayed.The Units parameter is ignored if specified while the page is displayed.
If the range is changed to an invalid value by this method, then you must immediately call Value and set a valid value to prevent displaying the dialog that requests the user to enter a valid value.
SolidWORKS internal units are metric it will treat this methods parameters as such. for example increment will be Meter for lengths.
SetSliderParameters(int, int)
Sets the parameters for the slider.
public void SetSliderParameters(int positionCount, int divisionCount)
Parameters
positionCountintNumber of discreet positions on the slider
divisionCountintNumber of regions separated by tick marks on the slider
Remarks
When a user drags the slider, PositionCount defines how sensitive the slider is. Not all of the specified discreet points are displayed if the PropertyManager page is not wide enough to show them. However, if the user widens the PropertyManager page, then more points are displayed. When a user drags the slider, the user-interface tends to snap to the nearest tick mark when the drag is nearby, making it easier for the user to set whole values.
UnsubscribeFromEvents()
Unsubscribes all event handlers from this control events
public override void UnsubscribeFromEvents()
Events
Changing
fired when user changes the value via typing or clicking the up-arrow or down-arrow buttons to increment or decrement the value
public event EventHandler<double> Changing
Event Type
Remarks
SolidWORKS will pass in the double value upon change
Displaying
fired a moment before this number box is displayed in a property manager page
public event EventHandler<PmpNumberBoxDisplayingEventArgs> Displaying
Event Type
SelectionChanged
fired when Style has AvoidSelectionText | ComboEditBox and user selects an item from the combo box
public event EventHandler<string> SelectionChanged
Event Type
TextChanged
called when user changes the value in an number box by typing in a new value, SolidWORKS will pass in the text that was entered
public event EventHandler<string> TextChanged
Event Type
TrackingCompleted
Called when a user finishes changing the value in the number box on a PropertyManager page.
public event EventHandler<double> TrackingCompleted