Table of Contents

Class PmpEventHandler

Namespace
Hymma.Solidworks.Addins
Assembly
Hymma.Solidworks.Addins.dll

handles property manager page events

[ComVisible(true)]
public class PmpEventHandler : PropertyManagerPage2Handler9, IPropertyManagerPage2Handler9
Inheritance
PmpEventHandler
Implements
PropertyManagerPage2Handler9
IPropertyManagerPage2Handler9
Inherited Members

Constructors

PmpEventHandler(PmpUiModel)

default constructor

public PmpEventHandler(PmpUiModel uiModel)

Parameters

uiModel PmpUiModel

Properties

UiModel

wrapper for controls in this property manager page

public PmpUiModel UiModel { get; }

Property Value

PmpUiModel

Methods

AfterActivation()

fires after user opens a pmp

public void AfterActivation()

AfterClose()

fires after users closes the pmp

public void AfterClose()

OnActiveXControlCreated(int, bool)

public int OnActiveXControlCreated(int Id, bool Status)

Parameters

Id int
Status bool

Returns

int

Exceptions

NotImplementedException

OnButtonPress(int)

fires when button is pressed

public void OnButtonPress(int Id)

Parameters

Id int

id of the button in pmp

OnCheckboxCheck(int, bool)

fires when check box status is changed

public void OnCheckboxCheck(int Id, bool Checked)

Parameters

Id int
Checked bool

OnClose(int)

fired when user closes the pmp

public void OnClose(int Reason)

Parameters

Reason int

OnComboboxEditChanged(int, string)

solidworks calls this every time combo box text is edited

public void OnComboboxEditChanged(int Id, string Text)

Parameters

Id int
Text string

OnComboboxSelectionChanged(int, int)

solidworks calls this every time combo box selection is changed

public void OnComboboxSelectionChanged(int Id, int Item)

Parameters

Id int
Item int

OnGainedFocus(int)

fired when user start interacting with a control

public void OnGainedFocus(int Id)

Parameters

Id int

OnGroupCheck(int, bool)

on checkable groups, this method responds to check event

public void OnGroupCheck(int Id, bool Checked)

Parameters

Id int
Checked bool

OnGroupExpand(int, bool)

fires when users expands a group

public void OnGroupExpand(int Id, bool Expanded)

Parameters

Id int
Expanded bool

OnHelp()

fires once user clicks on help button

public bool OnHelp()

Returns

bool

OnKeystroke(int, int, int, int)

Processes a keystroke that occurred on this PropertyManager page.

public bool OnKeystroke(int Wparam, int Message, int Lparam, int Id)

Parameters

Wparam int

wparam argument from Windows processing; indicates the keystroke that occurred

Message int

Message being processed by Windows; one of these values:

Lparam int

lparam argument from Windows processing; bit-mask containing various pieces of information; dependent on specific message

Id int

ID of the control that has focus when the keystroke was made; this is the ID specified when the control was created in IPropertyManagerPage2::AddControl or IPropertyManagerPage2::IAddControl or IPropertyManagerPage2::AddGroupBox or IPropertyManagerPage2::IAddGroupBox.

Returns

bool

True indicates that the keystroke has been handled by the add-in and SOLIDWORKS should not continue to try to process it, false indicates that the keystroke has not been handled by the add-in and SOLIDWORKS will continue to try to process it

OnListboxRMBUp(int, int, int)

fired when user right clicks on one of list box items

public void OnListboxRMBUp(int Id, int PosX, int PosY)

Parameters

Id int
PosX int
PosY int

OnListboxSelectionChanged(int, int)

Called when a user changes the selected item in a list box or selection list box on this PropertyManager page.

public void OnListboxSelectionChanged(int Id, int Item)

Parameters

Id int
Item int

OnLostFocus(int)

fired when user browses away from a control

public void OnLostFocus(int Id)

Parameters

Id int

OnNextPage()

fires when users selects on next page button in pmp

public bool OnNextPage()

Returns

bool

OnNumberBoxTrackingCompleted(int, double)

Called when a user finishes changing the value in the number box on a PropertyManager page.

public void OnNumberBoxTrackingCompleted(int Id, double Value)

Parameters

Id int
Value double

OnNumberboxChanged(int, double)

when value of a number box is changed by user

public void OnNumberboxChanged(int Id, double Value)

Parameters

Id int
Value double

new value

OnOptionCheck(int)

fires when radio button is checked

public void OnOptionCheck(int Id)

Parameters

Id int

id of the clicked on radio button in the property manager page

OnPopupMenuItem(int)

Determines which item was selected when the user selects a pop-up menu item.

public void OnPopupMenuItem(int Id)

Parameters

Id int

OnPopupMenuItemUpdate(int, ref int)

When Windows attempts to select or deselected and enable or disable the pop-up menu item, SOLIDWORKS calls this method to get the state of the menu item from the add-in.

public void OnPopupMenuItemUpdate(int Id, ref int retval)

Parameters

Id int

Unique user-defined ID for a pop-up menu item

retval int

State of the specified unique user-defined pop-up menu item: 0 - Not selected(i.e., not checked) and disabled(i.e., grayed out) 1 - Not selected and enabled 2 - Selected(i.e., checked) and disabled 3 - Selected and enabled

OnPreview()

fires when users previews results

public bool OnPreview()

Returns

bool

OnPreviousPage()

fires when users selects on previous page button in pmp

public bool OnPreviousPage()

Returns

bool

OnRedo()

fires when user re does something

public void OnRedo()

OnSelectionboxCalloutCreated(int)

when selection box call out is created this method is called

public void OnSelectionboxCalloutCreated(int Id)

Parameters

Id int

id of the selectionbox

OnSelectionboxCalloutDestroyed(int)

when selection box callout is destroyed this method will get called

public void OnSelectionboxCalloutDestroyed(int Id)

Parameters

Id int

OnSelectionboxFocusChanged(int)

when focus of a selection box is changed this method will fire

public void OnSelectionboxFocusChanged(int Id)

Parameters

Id int

OnSelectionboxListChanged(int, int)

when selection box list is changed this method will fire

public void OnSelectionboxListChanged(int Id, int Count)

Parameters

Id int
Count int

OnSliderPositionChanged(int, double)

fires when the position of a slider is changing

public void OnSliderPositionChanged(int Id, double Value)

Parameters

Id int
Value double

OnSliderTrackingCompleted(int, double)

fires when the user finishes changes on a slider

public void OnSliderTrackingCompleted(int Id, double Value)

Parameters

Id int
Value double

OnSubmitSelection(int, object, int, ref string)

Called when a selection is made, which allows the add-in to accept or reject the selection.

public bool OnSubmitSelection(int Id, object Selection, int SelType, ref string ItemText)

Parameters

Id int

ID of the active selection box, where this selection is being made

Selection object

Object being selected

SelType int

Entity type of the selection as defined inSolidWorks.Interop.swconst.swSelectType_e

ItemText string

ItemText is returned to SOLIDWORKS and stored on the selected object and can be used by your PropertyManager page selection list boxes for the life of that selection.

Returns

bool

Remarks

This method is called by SOLIDWORKS when an add-in has a PropertyManager page displayed and a selection is made that passes the selection filter criteria set up for a selection list box. The add-in can then: Take the Dispatch pointer and the selection type. QueryInterface the Dispatch pointer to get the specific interface. Use methods or properties of that interface to determine if the selection should be allowed or not.If the selection is: accepted, return true, and processing continues normally. - or - rejected, return false, and SOLIDWORKS does not accept the selection, just as if the selection did not pass the selection filter criteria of the selection list box.
The add-in should not release the Dispatch pointer. SOLIDWORKS will release the Dispatch pointer upon return from this method. The method is called during the process of SOLIDWORKS selection.It is neither a pre-notification nor post-notification.The add-in should not be taking any action that might affect the model or the selection list.The add-in should only be querying information and then returning true/VARIANT_TRUE or false/VARIANT_FALSE.

OnTabClicked(int)

fires when uses clicks on a tab in pmp

public bool OnTabClicked(int Id)

Parameters

Id int

Returns

bool

OnTextboxChanged(int, string)

fires when user changes the text in a text box or a numberbox

public void OnTextboxChanged(int Id, string Text)

Parameters

Id int
Text string

OnUndo()

fires when user presses undo in a pmp

public void OnUndo()

OnWhatsNew()

fires when users press on whats new button in pmp

public void OnWhatsNew()

OnWindowFromHandleControlCreated(int, bool)

fired after a window winForm handler control is displayed in the property manager page

public int OnWindowFromHandleControlCreated(int Id, bool Status)

Parameters

Id int
Status bool

Returns

int