An example code for TwinCAT HMI popup framework extension.
See releases for NuGet package!
- Create something to launch the popup
- Add the CreatePopup function call from the Popups folder to the event
- Add the call for ClosePopup to the button
- Edit the parameters
- See the result
Parameters (TcHmi.Functions.Popups.PopupParameters)
- The object containing all the parameters for the call
Bindings (TcHmi.Functions.Popups.BindingItemList)
- List of all the bindings to a usercontrol popup. Bindings will be dismissed if content file is used.
Bindings.Parameter (String)
- Property name OR Attribute name of the usercontrols parameter.
- Property name is named "Name" if "Details" mode is not active.
- Attribute Name can be seen also when "Details" mode is active.
Bindings.ParameterMode (TcHmi.Functions.Popups.UsercontrolBindingMode)
- The flavor of the Parameter name.
Bindings.Symbol (String)
- The symbol to be bound on the usercontrol.
- Parameter symbols (%pp%) will be resolved before being used for the binding.
ContentFace (Path)
- Usercontrol or Content to be shown in the popup.
Destination (String)
- Where the popup should be added.
- Typically views work best on this but is not limited to views.
Dragging (TcHmi.Functions.Popups.DraggingBehaviour)
- Where the popup be draggable from:
- Nowhere.
- Anywhere.
- From a item whichs ID includes "header" e.g. "Popup_Header", "ValvePopupHEADER", "headersomewherehere".
- Body of the popup usercontrol.
InsertWherePressed (Boolean)
- Should the popup be inserted where the user last pressed
- The package listens all keypresses on the HMI View and save them to a global scope variable ClickPressCoordinates.
- The positioning will be made with Left and Top properties.
Modal (Boolean)
- Should the user be able to interact with things while popup is open.
Positioning (TcHmi.Functions.Popups.PositioningOptions)
- The positioning data for the popup. Is used like in typical controls.
- Take care of left and top when using with InsertWherePressed.
- Bugfix: In TwinCAT HMI 1.12.754.x textboxes inside popups did not work.
- Updated Beckhoff.TwinCAT.HMI.Framework version required to 12.754.4
- Bugfix: Dragging could be stopped by dragging too quickly.
- Bugfix: Dragging on PC based touch devices fixed.
- Dragging the popup outside the area it lives is prohibted.
- Bugfix: Header and body dragging did not work properly with touch.
- Bugfix: Modal popup was not always the topmost popup.
- Bugfix: Header draggable popup threw unnecessary error.
- Bugfix: User was able to only move newest popup.
- Bugfix: Modal background did not disappear when popup was closed.
- Modal popup.
- Definable dragging areas on the popup.
- WidthMode and HeightMode added to positioning.
- Initial release.