├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md └── TcHmiNumericInputExtended ├── TcHmiNumericInputExtended.sln ├── TcHmiNumericInputExtended ├── .eslintrc.json ├── .gitignore ├── Images │ └── logo.png ├── LICENSE.txt ├── Manifest.json ├── TcHmiNumericInputExtended.hmiextproj ├── TcHmiNumericInputExtended.nuspec ├── TcHmiNumericInputExtendedControl │ ├── Description.json │ ├── Icons │ │ ├── 16x16.png │ │ ├── 24x24.png │ │ ├── 32x32.png │ │ └── 64x64.png │ ├── Schema │ │ └── Types.Schema.json │ ├── Style.css │ ├── TcHmiNumericInputExtendedControl.d.ts │ ├── TcHmiNumericInputExtendedControl.js │ ├── TcHmiNumericInputExtendedControl.js.map │ ├── TcHmiNumericInputExtendedControl.ts │ ├── Template.html │ └── Themes │ │ ├── Base-Dark │ │ └── Style.css │ │ └── Base │ │ └── Style.css ├── packages.config ├── packages.xsd ├── tsconfig.json └── tsconfig.tpl.json └── json-schema.org └── draft-04 └── schema /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 hijaaack 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer 2 | This is a personal guide not a peer reviewed journal or a sponsored publication. We make 3 | no representations as to accuracy, completeness, correctness, suitability, or validity of any 4 | information and will not be liable for any errors, omissions, or delays in this information or any 5 | losses injuries, or damages arising from its display or use. All information is provided on an as 6 | is basis. It is the reader’s responsibility to verify their own facts. 7 | 8 | The views and opinions expressed in this guide are those of the authors and do not 9 | necessarily reflect the official policy or position of any other agency, organization, employer or 10 | company. Assumptions made in the analysis are not reflective of the position of any entity 11 | other than the author(s) and, since we are critically thinking human beings, these views are 12 | always subject to change, revision, and rethinking at any time. Please do not hold us to them 13 | in perpetuity. 14 | 15 | ## JB.TcHmiNumericInputExtended for TwinCAT HMI 16 | 17 | This control inherits the standard TcHmiNumericInput control. 18 | I have extended it with unit text and the event .onEnterPressed for the control. 19 | 20 | Unit: 21 | 22 | ![enter image description here](https://user-images.githubusercontent.com/75740551/151819325-f0f5a0c2-296c-4cdd-9faf-956346b56765.png) 23 | 24 | ![enter image description here](https://user-images.githubusercontent.com/75740551/151829083-cee081e8-0e87-4f6f-ac5c-0bfe7524e532.png) 25 | 26 | Event: 27 | 28 | ![enter image description here](https://user-images.githubusercontent.com/75740551/101651374-492c7b00-3a3d-11eb-836c-ea8cd9bda0d7.png) 29 | 30 | ## Installation 31 | Easiest way to install this package is inside your TwinCAT HMI Project. 32 | **Right click** References and click "Manage NuGet Packages.." then browse for the file and install it! 33 | 34 | ![enter image description here](https://user-images.githubusercontent.com/75740551/101645035-32cef100-3a36-11eb-88f4-eeaccd3366d6.png) 35 | 36 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.33529.622 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{3B740506-4966-4147-AB1F-357FE08946EA}") = "TcHmiNumericInputExtended", "TcHmiNumericInputExtended\TcHmiNumericInputExtended.hmiextproj", "{9441053F-EC4A-41E7-8FB3-CEAD755C6888}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|TwinCAT HMI = Debug|TwinCAT HMI 11 | Release|TwinCAT HMI = Release|TwinCAT HMI 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9441053F-EC4A-41E7-8FB3-CEAD755C6888}.Debug|TwinCAT HMI.ActiveCfg = Debug|TwinCAT HMI 15 | {9441053F-EC4A-41E7-8FB3-CEAD755C6888}.Debug|TwinCAT HMI.Build.0 = Debug|TwinCAT HMI 16 | {9441053F-EC4A-41E7-8FB3-CEAD755C6888}.Release|TwinCAT HMI.ActiveCfg = Release|TwinCAT HMI 17 | {9441053F-EC4A-41E7-8FB3-CEAD755C6888}.Release|TwinCAT HMI.Build.0 = Release|TwinCAT HMI 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {A4D687C6-E769-46C4-B6AF-3CC4C3DB66B7} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/eslintrc", 3 | "env": { 4 | "browser": true, 5 | "es6": true, 6 | "jquery": true 7 | }, 8 | "parserOptions": { 9 | "ecmaVersion": 6, 10 | "sourceType": "script" 11 | }, 12 | "rules": { 13 | "no-dupe-args": "error", 14 | "no-dupe-else-if": "error", 15 | "no-duplicate-case": "warn", 16 | "no-redeclare": "error", 17 | "no-unexpected-multiline": "error", 18 | "use-isnan": "error" 19 | }, 20 | "overrides": [ 21 | { 22 | "files": [ "*.ts", "*.tsx" ], 23 | "rules": { 24 | 25 | } 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/.gitignore: -------------------------------------------------------------------------------- 1 | .hmiframework 2 | .hmipkgs 3 | obj -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/Images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hijaaack/JB.TcHmiNumericInputExtended/257d5feead4d6b8852f6d8630b8f423e7b529a41/TcHmiNumericInputExtended/TcHmiNumericInputExtended/Images/logo.png -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 hijaack 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/Manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": ".hmiframework/Schema/Manifest.Schema.json", 3 | "apiVersion": 1, 4 | "modules": [ 5 | { 6 | "type": "Package", 7 | "nugetId": "Beckhoff.TwinCAT.HMI.Framework" 8 | }, 9 | { 10 | "type": "Package", 11 | "nugetId": "Beckhoff.TwinCAT.HMI.Controls" 12 | }, 13 | { 14 | "type": "Control", 15 | "basePath": "TcHmiNumericInputExtendedControl/", 16 | "descriptionFile": "Description.json", 17 | "toolboxCategory": "TcHmiNumericInputExtended:1632" 18 | } 19 | ], 20 | "provideMetadata": { 21 | "toolbox": { 22 | "TcHmiNumericInputExtended": { 23 | "1632": "JB: Controls", 24 | "200": "TcHmiNumericInputExtended" 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtended.hmiextproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Debug 7 | TwinCAT HMI 8 | 15.0 9 | TwinCAT HMI 10 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 11 | [1.12,] 12 | native,Version=v1.12.0,Profile=tchmi 13 | native1.12-tchmi 14 | {3B740506-4966-4147-AB1F-357FE08946EA} 15 | 9441053f-ec4a-41e7-8fb3-cead755c6888 16 | TcHmiNumericInputExtended 17 | TcHmiNumericInputExtended 18 | 1.12.750.1 19 | 1.12.760.37 20 | $(registry:HKEY_CURRENT_USER\Software\Beckhoff\TwinCAT3\3.1@InstallDir)\..\Functions\TE2000-HMI-Engineering 21 | $(registry:HKEY_LOCAL_MACHINE\Software\Beckhoff\TwinCAT3\3.1@InstallDir)\..\Functions\TE2000-HMI-Engineering 22 | $(registry:HKEY_LOCAL_MACHINE\Software\Wow6432Node\Beckhoff\TwinCAT3\3.1@InstallDir)\..\Functions\TE2000-HMI-Engineering 23 | 24 | 25 | 26 | 27 | TwinCAT HMI 28 | true 29 | full 30 | false 31 | bin\Debug\ 32 | DEBUG;TRACE 33 | prompt 34 | 4 35 | TcHmiNumericInputExtended 36 | False 37 | 38 | 39 | TwinCAT HMI 40 | true 41 | bin\Release\ 42 | TRACE 43 | prompt 44 | 4 45 | TcHmiNumericInputExtended 46 | 47 | 48 | {CC169D49-EEDD-4BAF-8151-63DF12EDD7B4} 49 | 50 | 51 | $(TcHmiDirectory)\MSBuild\Beckhoff.TwinCAT.HMI.tasks 52 | $(TcHmiDirectory)\MSBuild\Beckhoff.TwinCAT.HMI.targets 53 | 54 | 55 | 56 | 57 | 58 | 59 | Content 60 | 61 | 62 | Content 63 | 64 | 65 | Content 66 | 67 | 68 | Content 69 | 70 | 71 | Content 72 | 73 | 74 | Content 75 | 76 | 77 | Content 78 | 79 | 80 | Content 81 | true 82 | 83 | 84 | Content 85 | true 86 | tsconfig.tpl.json 87 | 88 | 89 | 90 | 91 | false 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Content 102 | false 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | PreBuildEvent; 130 | CoreBuild; 131 | PostBuildEvent 132 | 133 | 134 | BaseClean 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtended.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JB.TcHmiNumericInputExtended 5 | 1.0.2 6 | Extended TcHmiNumericInput control with .onEnterPressed event. 7 | Jack Borelius 8 | TcHmiNumericInputExtended 9 | Jack Borelius 10 | https://github.com/hijaaack/JB.TcHmiNumericInputExtended 11 | false 12 | Updated control for 760.37. 13 | Copyright 2023 14 | TwinCAT HMI 15 | LICENSE.txt 16 | images/logo.png 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Description.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../.hmiframework/Schema/ControlDescription.Schema.json", 3 | "apiVersion": 1, 4 | "name": "TcHmiNumericInputExtended", 5 | "namespace": "TcHmi.Controls.TcHmiNumericInputExtended", 6 | "displayName": "TcHmiNumericInputExtended", 7 | "version": { 8 | "full": "1.0.2.0", 9 | "major": 1, 10 | "minor": 0, 11 | "revision": 2, 12 | "build": 0 13 | }, 14 | "visible": true, 15 | "themeable": "Standard", 16 | "base": "TcHmi.Controls.Beckhoff.TcHmiNumericInput", 17 | "description": "Extended TcHmiNumericInput control.", 18 | "properties": { 19 | "containerControl": false, 20 | "geometry": { 21 | "width": 150, 22 | "height": 25 23 | } 24 | }, 25 | "template": "Template.html", 26 | "icons": [ 27 | { 28 | "name": "Icons/16x16.png", 29 | "width": 16, 30 | "height": 16 31 | }, 32 | { 33 | "name": "Icons/24x24.png", 34 | "width": 24, 35 | "height": 24 36 | }, 37 | { 38 | "name": "Icons/32x32.png", 39 | "width": 32, 40 | "height": 32 41 | }, 42 | { 43 | "name": "Icons/64x64.png", 44 | "width": 64, 45 | "height": 64 46 | } 47 | ], 48 | "dependencyFiles": [ 49 | { 50 | "name": "TcHmiNumericInputExtendedControl.js", 51 | "type": "JavaScript", 52 | "description": "Contains all the main logic." 53 | }, 54 | { 55 | "name": "Style.css", 56 | "type": "Stylesheet", 57 | "description": "Theme independent style" 58 | } 59 | ], 60 | "themes": { 61 | "Base": { 62 | "resources": [ 63 | { 64 | "name": "Themes/Base/Style.css", 65 | "type": "Stylesheet", 66 | "description": "Theme dependent style" 67 | } 68 | ] 69 | }, 70 | "Base-Dark": { 71 | "resources": [ 72 | { 73 | "name": "Themes/Base-Dark/Style.css", 74 | "type": "Stylesheet", 75 | "description": "Theme dependent style" 76 | } 77 | ] 78 | } 79 | }, 80 | "attributes": [ 81 | { 82 | "name": "data-tchmi-numericinputextended-unit", 83 | "displayName": "UnitText", 84 | "propertyName": "UnitText", 85 | "propertySetterName": "setUnitText", 86 | "propertyGetterName": "getUnitText", 87 | "visible": true, 88 | "type": "tchmi:general#/definitions/String", 89 | "category": "Common", 90 | "description": "Unit text.", 91 | "requiredOnCompile": false, 92 | "readOnly": false, 93 | "bindable": true, 94 | "heritable": false, 95 | "defaultValue": "", 96 | "defaultValueInternal": "" 97 | }, 98 | { 99 | "name": "data-tchmi-numericinputextended-unit-fontsize", 100 | "displayName": "UnitTextFontSize", 101 | "propertyName": "UnitTextFontSize", 102 | "propertySetterName": "setUnitTextFontSize", 103 | "propertyGetterName": "getUnitTextFontSize", 104 | "visible": true, 105 | "type": "tchmi:general#/definitions/Number", 106 | "category": "Common", 107 | "description": "Unit Text Font Size", 108 | "requiredOnCompile": false, 109 | "readOnly": false, 110 | "bindable": true, 111 | "heritable": false, 112 | "defaultValue": 12, 113 | "defaultValueInternal": 12 114 | } 115 | ], 116 | "attributeCategories": [ 117 | ], 118 | "functions": [], 119 | "events": [ 120 | { 121 | "name": ".onEnterPressed", 122 | "displayName": ".onEnterPressed", 123 | "visible": true, 124 | "displayPriority": 30, 125 | "category": "Control", 126 | "description": "This event is fired if the enter key was pressed.", 127 | "heritable": true 128 | } 129 | ], 130 | "dataTypes": [ 131 | { 132 | "schema": "Schema/Types.Schema.json" 133 | } 134 | ] 135 | } -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hijaaack/JB.TcHmiNumericInputExtended/257d5feead4d6b8852f6d8630b8f423e7b529a41/TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/16x16.png -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hijaaack/JB.TcHmiNumericInputExtended/257d5feead4d6b8852f6d8630b8f423e7b529a41/TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/24x24.png -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hijaaack/JB.TcHmiNumericInputExtended/257d5feead4d6b8852f6d8630b8f423e7b529a41/TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/32x32.png -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hijaaack/JB.TcHmiNumericInputExtended/257d5feead4d6b8852f6d8630b8f423e7b529a41/TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Icons/64x64.png -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Schema/Types.Schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema", 3 | "definitions": { 4 | "TcHmi.Controls.TcHmiNumericInputExtended.TcHmiNumericInputExtendedControl": { 5 | "type": "object", 6 | "frameworkInstanceOf": "TcHmi.Controls.System.TcHmiControl", 7 | "frameworkControlType": "TcHmiNumericInputExtendedControl", 8 | "frameworkControlNamespace": "TcHmi.Controls.TcHmiNumericInputExtended" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Style.css: -------------------------------------------------------------------------------- 1 | /** Styles for all themes */ 2 | 3 | /* Style for the main element */ 4 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput { 5 | /* Prevent overflow if the border radius is huge */ 6 | overflow: hidden; 7 | } 8 | 9 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template { 10 | position: relative; 11 | top: 0px; 12 | left: 0px; 13 | width: 100%; 14 | height: 100%; 15 | border-radius: inherit; 16 | display: -ms-flexbox; 17 | display: -webkit-flex; 18 | display: flex; 19 | justify-content: center; 20 | align-items: center; 21 | } 22 | 23 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input { 24 | font-family: inherit; 25 | font-size: inherit; 26 | font-style: inherit; 27 | font-weight: inherit; 28 | text-align: left; 29 | white-space: pre; 30 | overflow: hidden; 31 | position: relative; 32 | padding: 2px; 33 | top: 0; 34 | left: 0; 35 | width: 100%; 36 | height: 100%; 37 | border: none; 38 | outline: none; 39 | resize: none; 40 | cursor: text; 41 | border-radius: inherit; 42 | } 43 | 44 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-unitbox { 45 | position: absolute; 46 | background: none; 47 | border: none; 48 | align-self: center; 49 | padding: 2px; 50 | margin-right: 1px; 51 | right: 5px; 52 | font-weight: bold; 53 | font-size: 12pt; 54 | } 55 | 56 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-unitbox::before { 57 | content: attr(data-label); 58 | } 59 | 60 | 61 | /* The main use for this control is interaction. So mark when this is not allowed. */ 62 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput.TcHmi_Controls_System_TcHmiControl-operate-disallowed::after { 63 | content: ''; 64 | position: absolute; 65 | top: 0px; 66 | left: 0px; 67 | width: 100%; 68 | height: 100%; 69 | background-color: rgba(255, 255, 255, 0.5); 70 | z-index: 100; 71 | cursor: not-allowed; 72 | } 73 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/TcHmiNumericInputExtendedControl.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | declare module TcHmi { 4 | module Controls { 5 | module TcHmiNumericInputExtended { 6 | class TcHmiNumericInputExtendedControl extends TcHmi.Controls.Beckhoff.TcHmiNumericInput { 7 | protected __unitText: string | null; 8 | protected __unitTextFontSize: number | null; 9 | protected __elementUnitText: JQuery; 10 | /** 11 | * Constructor of the control 12 | * @param {JQuery} element Element from HTML (internal, do not use) 13 | * @param {JQuery} pcElement precompiled Element (internal, do not use) 14 | * @param {TcHmi.Controls.ControlAttributeList} attrs Attributes defined in HTML in a special format (internal, do not use) 15 | * @returns {void} 16 | */ 17 | constructor(element: JQuery, pcElement: JQuery, attrs: TcHmi.Controls.ControlAttributeList); 18 | /** 19 | * If raised, the control object exists in control cache and constructor of each inheritation level was called. 20 | * Call attribute processor functions here to initialize default values! 21 | */ 22 | __previnit(): void; 23 | /** 24 | * Is called during control initialize phase after attribute setter have been called based on it's default or initial html dom values. 25 | * @returns {void} 26 | */ 27 | __init(): void; 28 | /** 29 | * Is called by tachcontrol() after the control instance gets part of the current DOM. 30 | * Is only allowed to be called from the framework itself! 31 | */ 32 | __attach(): void; 33 | /** 34 | * Is called by tachcontrol() after the control instance is no longer part of the current DOM. 35 | * Is only allowed to be called from the framework itself! 36 | */ 37 | __detach(): void; 38 | /** 39 | * Destroy the current control instance. 40 | * Will be called automatically if system destroys control! 41 | */ 42 | destroy(): void; 43 | getUnitTextFontSize(): number | null; 44 | setUnitTextFontSize(valueNew: number | null): void; 45 | getUnitText(): string | null; 46 | setUnitText(valueNew: string | null): void; 47 | /** 48 | * Processes the Key down handler. 49 | * @function 50 | */ 51 | protected __keyDownHandler(e: any, $this: this): void; 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/TcHmiNumericInputExtendedControl.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated 10/18/2021 11:21:42 AM 3 | * Copyright (C) 2021 4 | */ 5 | //References 6 | /// 7 | /// 8 | var TcHmi; 9 | (function (TcHmi) { 10 | let Controls; 11 | (function (Controls) { 12 | let TcHmiNumericInputExtended; 13 | (function (TcHmiNumericInputExtended) { 14 | class TcHmiNumericInputExtendedControl extends TcHmi.Controls.Beckhoff.TcHmiNumericInput { 15 | /** 16 | * Constructor of the control 17 | * @param {JQuery} element Element from HTML (internal, do not use) 18 | * @param {JQuery} pcElement precompiled Element (internal, do not use) 19 | * @param {TcHmi.Controls.ControlAttributeList} attrs Attributes defined in HTML in a special format (internal, do not use) 20 | * @returns {void} 21 | */ 22 | constructor(element, pcElement, attrs) { 23 | /** Call base class constructor */ 24 | super(element, pcElement, attrs); 25 | } 26 | /** 27 | * If raised, the control object exists in control cache and constructor of each inheritation level was called. 28 | * Call attribute processor functions here to initialize default values! 29 | */ 30 | __previnit() { 31 | // Call __previnit of base class 32 | super.__previnit(); 33 | this.__elementUnitText = this.__element.find('.TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-unitbox'); 34 | } 35 | /** 36 | * Is called during control initialize phase after attribute setter have been called based on it's default or initial html dom values. 37 | * @returns {void} 38 | */ 39 | __init() { 40 | super.__init(); 41 | } 42 | /** 43 | * Is called by tachcontrol() after the control instance gets part of the current DOM. 44 | * Is only allowed to be called from the framework itself! 45 | */ 46 | __attach() { 47 | super.__attach(); 48 | /** 49 | * Initialize everything which is only available while the control is part of the active dom. 50 | */ 51 | //reference to this for other scopes 52 | var $this = this; 53 | //add event listener for keydown 54 | $(this.__elementInput).keydown(function (e) { 55 | $this.__keyDownHandler(e, $this); 56 | }); 57 | } 58 | /** 59 | * Is called by tachcontrol() after the control instance is no longer part of the current DOM. 60 | * Is only allowed to be called from the framework itself! 61 | */ 62 | __detach() { 63 | super.__detach(); 64 | /** 65 | * Disable everything which is not needed while the control is not part of the active dom. 66 | * No need to listen to events for example! 67 | */ 68 | } 69 | /** 70 | * Destroy the current control instance. 71 | * Will be called automatically if system destroys control! 72 | */ 73 | destroy() { 74 | /** 75 | * While __keepAlive is set to true control must not be destroyed. 76 | */ 77 | if (this.__keepAlive) { 78 | return; 79 | } 80 | super.destroy(); 81 | /** 82 | * Free resources like child controls etc. 83 | */ 84 | } 85 | getUnitTextFontSize() { 86 | return this.__unitTextFontSize; 87 | } 88 | setUnitTextFontSize(valueNew) { 89 | //convert the new value 90 | let convertedValue = TcHmi.ValueConverter.toNumber(valueNew); 91 | //if converted value is null, get internal default 92 | if (convertedValue === null) { 93 | convertedValue = this.getAttributeDefaultValueInternal("UnitTextFontSize"); 94 | } 95 | if (tchmi_equal(this.__unitTextFontSize, convertedValue)) 96 | return; 97 | //save the new value 98 | this.__unitTextFontSize = convertedValue; 99 | //Inform the system that the function has a changed result 100 | TcHmi.EventProvider.raise(this.__id + ".onFunctionResultChanged", ["getUnitTextFontSize"]); 101 | // @ts-ignore 102 | $(this.__elementUnitText).css("font-size", this.__unitTextFontSize + "pt"); 103 | } 104 | getUnitText() { 105 | return this.__unitText; 106 | } 107 | setUnitText(valueNew) { 108 | //convert the new value 109 | let convertedValue = TcHmi.ValueConverter.toString(valueNew); 110 | //if converted value is null, get internal default 111 | if (convertedValue === null) { 112 | convertedValue = this.getAttributeDefaultValueInternal("UnitText"); 113 | } 114 | if (tchmi_equal(this.__unitText, convertedValue)) 115 | return; 116 | //save the new value 117 | this.__unitText = convertedValue; 118 | //Inform the system that the function has a changed result 119 | TcHmi.EventProvider.raise(this.__id + ".onFunctionResultChanged", ["getUnitText"]); 120 | //@ts-ignore 121 | $(this.__elementUnitText).attr("data-label", this.__unitText); 122 | } 123 | /** 124 | * Processes the Key down handler. 125 | * @function 126 | */ 127 | __keyDownHandler(e, $this) { 128 | //check if the pressed key was the enter key 129 | if (e.which === 13) { 130 | //raise event 131 | TcHmi.EventProvider.raise($this.getId() + '.onEnterPressed'); 132 | $(this.__elementInput).blur(); 133 | } 134 | } 135 | } 136 | TcHmiNumericInputExtended.TcHmiNumericInputExtendedControl = TcHmiNumericInputExtendedControl; 137 | })(TcHmiNumericInputExtended = Controls.TcHmiNumericInputExtended || (Controls.TcHmiNumericInputExtended = {})); 138 | })(Controls = TcHmi.Controls || (TcHmi.Controls = {})); 139 | })(TcHmi || (TcHmi = {})); 140 | /** 141 | * Register Control 142 | */ 143 | TcHmi.Controls.registerEx('TcHmiNumericInputExtended', 'TcHmi.Controls.TcHmiNumericInputExtended', TcHmi.Controls.TcHmiNumericInputExtended.TcHmiNumericInputExtendedControl); 144 | //# sourceMappingURL=TcHmiNumericInputExtendedControl.js.map -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/TcHmiNumericInputExtendedControl.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"TcHmiNumericInputExtendedControl.js","sourceRoot":"","sources":["TcHmiNumericInputExtendedControl.ts"],"names":[],"mappings":"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"} -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/TcHmiNumericInputExtendedControl.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated 10/18/2021 11:21:42 AM 3 | * Copyright (C) 2021 4 | */ 5 | 6 | //References 7 | /// 8 | /// 9 | 10 | module TcHmi { 11 | export module Controls { 12 | export module TcHmiNumericInputExtended { 13 | export class TcHmiNumericInputExtendedControl extends TcHmi.Controls.Beckhoff.TcHmiNumericInput { 14 | 15 | /* 16 | Attribute philosophy 17 | -------------------- 18 | - Local variables are not set while definition in class, so they have the value 'undefined'. 19 | - On compile the Framework sets the value from HTML or from theme (possibly 'null') via normal setters. 20 | - The "changed detection" in the setter will result in processing the value only once while compile. 21 | - Attention: If we have a Server Binding on an Attribute the setter will be called once with null to initialize and later with the correct value. 22 | */ 23 | 24 | protected __unitText: string | null; 25 | protected __unitTextFontSize: number | null; 26 | protected __elementUnitText!: JQuery; 27 | 28 | /** 29 | * Constructor of the control 30 | * @param {JQuery} element Element from HTML (internal, do not use) 31 | * @param {JQuery} pcElement precompiled Element (internal, do not use) 32 | * @param {TcHmi.Controls.ControlAttributeList} attrs Attributes defined in HTML in a special format (internal, do not use) 33 | * @returns {void} 34 | */ 35 | constructor(element: JQuery, pcElement: JQuery, attrs: TcHmi.Controls.ControlAttributeList) { 36 | /** Call base class constructor */ 37 | super(element, pcElement, attrs); 38 | } 39 | 40 | /** 41 | * If raised, the control object exists in control cache and constructor of each inheritation level was called. 42 | * Call attribute processor functions here to initialize default values! 43 | */ 44 | public __previnit() { 45 | // Call __previnit of base class 46 | super.__previnit(); 47 | 48 | this.__elementUnitText = this.__element.find('.TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-unitbox'); 49 | } 50 | /** 51 | * Is called during control initialize phase after attribute setter have been called based on it's default or initial html dom values. 52 | * @returns {void} 53 | */ 54 | public __init() { 55 | super.__init(); 56 | } 57 | 58 | /** 59 | * Is called by tachcontrol() after the control instance gets part of the current DOM. 60 | * Is only allowed to be called from the framework itself! 61 | */ 62 | public __attach() { 63 | super.__attach(); 64 | 65 | /** 66 | * Initialize everything which is only available while the control is part of the active dom. 67 | */ 68 | //reference to this for other scopes 69 | var $this = this; 70 | 71 | //add event listener for keydown 72 | $(this.__elementInput).keydown(function (e) { 73 | $this.__keyDownHandler(e, $this); 74 | }); 75 | } 76 | 77 | /** 78 | * Is called by tachcontrol() after the control instance is no longer part of the current DOM. 79 | * Is only allowed to be called from the framework itself! 80 | */ 81 | public __detach() { 82 | super.__detach(); 83 | 84 | /** 85 | * Disable everything which is not needed while the control is not part of the active dom. 86 | * No need to listen to events for example! 87 | */ 88 | } 89 | 90 | /** 91 | * Destroy the current control instance. 92 | * Will be called automatically if system destroys control! 93 | */ 94 | public destroy() { 95 | /** 96 | * While __keepAlive is set to true control must not be destroyed. 97 | */ 98 | if (this.__keepAlive) { 99 | return; 100 | } 101 | 102 | super.destroy(); 103 | 104 | /** 105 | * Free resources like child controls etc. 106 | */ 107 | } 108 | 109 | getUnitTextFontSize(): number | null { 110 | return this.__unitTextFontSize; 111 | } 112 | 113 | public setUnitTextFontSize(valueNew: number | null) { 114 | //convert the new value 115 | let convertedValue = TcHmi.ValueConverter.toNumber(valueNew); 116 | 117 | //if converted value is null, get internal default 118 | if (convertedValue === null) { 119 | convertedValue = this.getAttributeDefaultValueInternal("UnitTextFontSize"); 120 | } 121 | 122 | if (tchmi_equal(this.__unitTextFontSize, convertedValue)) 123 | return; 124 | 125 | //save the new value 126 | this.__unitTextFontSize = convertedValue; 127 | 128 | //Inform the system that the function has a changed result 129 | TcHmi.EventProvider.raise(this.__id + ".onFunctionResultChanged", ["getUnitTextFontSize"]); 130 | 131 | // @ts-ignore 132 | $(this.__elementUnitText).css("font-size", this.__unitTextFontSize + "pt"); 133 | } 134 | 135 | 136 | getUnitText(): string | null { 137 | return this.__unitText; 138 | } 139 | 140 | public setUnitText(valueNew: string | null) { 141 | //convert the new value 142 | let convertedValue = TcHmi.ValueConverter.toString(valueNew); 143 | 144 | //if converted value is null, get internal default 145 | if (convertedValue === null) { 146 | convertedValue = this.getAttributeDefaultValueInternal("UnitText"); 147 | } 148 | 149 | if (tchmi_equal(this.__unitText, convertedValue)) 150 | return; 151 | 152 | //save the new value 153 | this.__unitText = convertedValue; 154 | 155 | //Inform the system that the function has a changed result 156 | TcHmi.EventProvider.raise(this.__id + ".onFunctionResultChanged", ["getUnitText"]); 157 | 158 | //@ts-ignore 159 | $(this.__elementUnitText).attr("data-label", this.__unitText); 160 | } 161 | 162 | 163 | /** 164 | * Processes the Key down handler. 165 | * @function 166 | */ 167 | protected __keyDownHandler(e: any, $this: this): void { 168 | //check if the pressed key was the enter key 169 | if (e.which === 13) { 170 | //raise event 171 | TcHmi.EventProvider.raise($this.getId() + '.onEnterPressed'); 172 | $(this.__elementInput).blur(); 173 | } 174 | } 175 | } 176 | } 177 | } 178 | } 179 | /** 180 | * Register Control 181 | */ 182 | TcHmi.Controls.registerEx('TcHmiNumericInputExtended', 'TcHmi.Controls.TcHmiNumericInputExtended', TcHmi.Controls.TcHmiNumericInputExtended.TcHmiNumericInputExtendedControl); 183 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Template.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 |
7 |
-------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Themes/Base-Dark/Style.css: -------------------------------------------------------------------------------- 1 | /** Styles for the theme: Base-Dark */ 2 | 3 | /* Style for the main element */ 4 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput { 5 | --tchmi-background: #2A3845; 6 | --tchmi-color: #FFFFFF; 7 | background-color: var(--tchmi-background); 8 | } 9 | 10 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input { 11 | box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.02), inset 0px 0px 3px 2px rgba(0,0,0,0.3); 12 | color: var(--tchmi-color); 13 | } 14 | 15 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input.tchmi-focus { 16 | background: rgba(76, 99, 116, 0.05); 17 | opacity: 1; 18 | } 19 | 20 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input:invalid { 21 | box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.02), inset 0px 0px 3px 2px rgba(0,0,0,0.3), inset 0px 0px 7px 3px rgba(255, 0, 0, 0.3); 22 | } 23 | 24 | 25 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-unitbox { 26 | color: var(--tchmi-color); 27 | } -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/TcHmiNumericInputExtendedControl/Themes/Base/Style.css: -------------------------------------------------------------------------------- 1 | /** Styles for the theme: Base */ 2 | 3 | /* Style for the main element */ 4 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput { 5 | --tchmi-background: #FFFFFF; 6 | --tchmi-color: #4c6374; 7 | background-color: var(--tchmi-background); 8 | } 9 | 10 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input { 11 | box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.02), inset 0px 0px 3px 2px rgba(0,0,0,0.3); 12 | color: var(--tchmi-color); 13 | } 14 | 15 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input.tchmi-focus { 16 | background: rgba(76, 99, 116, 0.05); 17 | opacity: 1; 18 | } 19 | 20 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-input:invalid { 21 | box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.02), inset 0px 0px 3px 2px rgba(0,0,0,0.3), inset 0px 0px 7px 3px rgba(255, 0, 0, 0.3); 22 | } 23 | 24 | 25 | .TcHmi_Controls_Beckhoff_TcHmiNumericInput-template-unitbox { 26 | color: var(--tchmi-color); 27 | } -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/packages.xsd: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "compileOnSave": true, 4 | "compilerOptions": { 5 | "module": "none", 6 | "target": "ES2020", 7 | "skipLibCheck": true, 8 | "lib": [ "DOM", "DOM.Iterable", "ES2019", "ES2020.BigInt" ], 9 | "types": [], 10 | "declaration": true, 11 | "sourceMap": true, 12 | "noEmitOnError": true, 13 | "suppressImplicitAnyIndexErrors": true, 14 | "noImplicitAny": true, 15 | "noImplicitThis": true, 16 | "strictBindCallApply": true, 17 | "strictNullChecks": true, 18 | "noImplicitReturns": true, 19 | "strictFunctionTypes": false, 20 | "strictPropertyInitialization": false, 21 | "alwaysStrict": false 22 | }, 23 | "include": [ 24 | "../Packages/Beckhoff.TwinCAT.HMI.Framework.12.760.37/runtimes/native1.12-tchmi/TcHmi.d.ts", 25 | "../Packages/Beckhoff.TwinCAT.HMI.Controls.12.760.37/runtimes/native1.12-tchmi/TcHmiNumericInput.d.ts" 26 | ], 27 | "files": [ 28 | "TcHmiNumericInputExtendedControl/TcHmiNumericInputExtendedControl.ts" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/TcHmiNumericInputExtended/tsconfig.tpl.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "compileOnSave": true, 4 | "compilerOptions": { 5 | "module": "none", 6 | "target": "ES2020", 7 | "skipLibCheck": true, 8 | "lib": [ "DOM", "DOM.Iterable", "ES2019", "ES2020.BigInt" ], 9 | "types": [], 10 | "declaration": true, 11 | "sourceMap": true, 12 | "noEmitOnError": true, 13 | "suppressImplicitAnyIndexErrors": true, 14 | "noImplicitAny": true, 15 | "noImplicitThis": true, 16 | "strictBindCallApply": true, 17 | "strictNullChecks": true, 18 | "noImplicitReturns": true, 19 | "strictFunctionTypes": false, 20 | "strictPropertyInitialization": false, 21 | "alwaysStrict": false 22 | }, 23 | "include": [ 24 | "$(Beckhoff.TwinCAT.HMI.Framework).InstallPath/TcHmi.d.ts", 25 | "$(Beckhoff.TwinCAT.HMI.Controls).InstallPath/TcHmiNumericInput.d.ts" 26 | ], 27 | "files": [ 28 | "TcHmiNumericInputExtendedControl/TcHmiNumericInputExtendedControl.ts" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /TcHmiNumericInputExtended/json-schema.org/draft-04/schema: -------------------------------------------------------------------------------- 1 | { 2 | "id": "http://json-schema.org/draft-04/schema#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description": "Core schema meta-schema", 5 | "definitions": { 6 | "schemaArray": { 7 | "type": "array", 8 | "minItems": 1, 9 | "items": { "$ref": "#" } 10 | }, 11 | "positiveInteger": { 12 | "type": "integer", 13 | "minimum": 0 14 | }, 15 | "positiveIntegerDefault0": { 16 | "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] 17 | }, 18 | "simpleTypes": { 19 | "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] 20 | }, 21 | "stringArray": { 22 | "type": "array", 23 | "items": { "type": "string" }, 24 | "minItems": 1, 25 | "uniqueItems": true 26 | } 27 | }, 28 | "type": "object", 29 | "properties": { 30 | "id": { 31 | "type": "string" 32 | }, 33 | "$schema": { 34 | "type": "string" 35 | }, 36 | "title": { 37 | "type": "string" 38 | }, 39 | "description": { 40 | "type": "string" 41 | }, 42 | "default": {}, 43 | "multipleOf": { 44 | "type": "number", 45 | "minimum": 0, 46 | "exclusiveMinimum": true 47 | }, 48 | "maximum": { 49 | "type": "number" 50 | }, 51 | "exclusiveMaximum": { 52 | "type": "boolean", 53 | "default": false 54 | }, 55 | "minimum": { 56 | "type": "number" 57 | }, 58 | "exclusiveMinimum": { 59 | "type": "boolean", 60 | "default": false 61 | }, 62 | "maxLength": { "$ref": "#/definitions/positiveInteger" }, 63 | "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, 64 | "pattern": { 65 | "type": "string", 66 | "format": "regex" 67 | }, 68 | "additionalItems": { 69 | "anyOf": [ 70 | { "type": "boolean" }, 71 | { "$ref": "#" } 72 | ], 73 | "default": {} 74 | }, 75 | "items": { 76 | "anyOf": [ 77 | { "$ref": "#" }, 78 | { "$ref": "#/definitions/schemaArray" } 79 | ], 80 | "default": {} 81 | }, 82 | "maxItems": { "$ref": "#/definitions/positiveInteger" }, 83 | "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, 84 | "uniqueItems": { 85 | "type": "boolean", 86 | "default": false 87 | }, 88 | "maxProperties": { "$ref": "#/definitions/positiveInteger" }, 89 | "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, 90 | "required": { "$ref": "#/definitions/stringArray" }, 91 | "additionalProperties": { 92 | "anyOf": [ 93 | { "type": "boolean" }, 94 | { "$ref": "#" } 95 | ], 96 | "default": {} 97 | }, 98 | "definitions": { 99 | "type": "object", 100 | "additionalProperties": { "$ref": "#" }, 101 | "default": {} 102 | }, 103 | "properties": { 104 | "type": "object", 105 | "additionalProperties": { "$ref": "#" }, 106 | "default": {} 107 | }, 108 | "patternProperties": { 109 | "type": "object", 110 | "additionalProperties": { "$ref": "#" }, 111 | "default": {} 112 | }, 113 | "dependencies": { 114 | "type": "object", 115 | "additionalProperties": { 116 | "anyOf": [ 117 | { "$ref": "#" }, 118 | { "$ref": "#/definitions/stringArray" } 119 | ] 120 | } 121 | }, 122 | "enum": { 123 | "type": "array", 124 | "minItems": 1, 125 | "uniqueItems": true 126 | }, 127 | "type": { 128 | "anyOf": [ 129 | { "$ref": "#/definitions/simpleTypes" }, 130 | { 131 | "type": "array", 132 | "items": { "$ref": "#/definitions/simpleTypes" }, 133 | "minItems": 1, 134 | "uniqueItems": true 135 | } 136 | ] 137 | }, 138 | "format": { "type": "string" }, 139 | "allOf": { "$ref": "#/definitions/schemaArray" }, 140 | "anyOf": { "$ref": "#/definitions/schemaArray" }, 141 | "oneOf": { "$ref": "#/definitions/schemaArray" }, 142 | "not": { "$ref": "#" } 143 | }, 144 | "dependencies": { 145 | "exclusiveMaximum": [ "maximum" ], 146 | "exclusiveMinimum": [ "minimum" ] 147 | }, 148 | "default": {} 149 | } 150 | --------------------------------------------------------------------------------