{"id":3771,"date":"2025-04-21T09:21:58","date_gmt":"2025-04-21T09:21:58","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3771"},"modified":"2025-06-10T05:47:51","modified_gmt":"2025-06-10T05:47:51","slug":"buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/","title":{"rendered":"# ButtonEvent(ID, Row, Col, Height, Width, &#8220;text&#8221;{, Mode}, ClickHandler) hash function"},"content":{"rendered":"\n<p>Valid for use with hash command:&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\">HMI<\/a> <\/code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\">Name:Value Pairs<\/a>&nbsp;are not supported<\/p>\n\n\n\n<p>Implemented on the following platforms: Android, Windows.<\/p>\n\n\n\n<p><code>Mode <\/code>is optional<\/p>\n\n\n\n<p>Display a button at the specified screen location, with a text label. Raise the specified&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o4952\">Event<\/a>&nbsp;(execute a&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/goto-gosub-and-related-instructions\/gosub-llll\/\">GoSub<\/a><\/code>&nbsp;to the given line label) when the button is clicked.<\/p>\n\n\n\n<p>The parameters are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>ID<\/code><\/td><td>The button number to use. The&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5243\">HMI<\/a>&nbsp;client contains a fixed number of buttons that can be re-used on different screens. You may nominate which of the buttons to use. Initial releases of the&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5380\">SimpleHMI<\/a>&nbsp;for Android and Windows has 100 buttons, numbered 1-100. See the latest HMI documentation for details.If&nbsp;<code>ID<\/code>&nbsp;is omitted, the SimpleHMI client will automatically allocate one, starting at number 100 and working downwards. If you plan to change the button&#8217;s parameters, say to dynamically change its text, you must nominate a specific button. Note that all buttons are de-allocated by&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/hmi-controller-instructions\/hideallbuttons\/\">HideAllButtons<\/a><\/code>.<\/td><\/tr><tr><td><code>Row<\/code><\/td><td>The screen row where the top of the button is to be positioned. This refers to character rows in the prevailing font size. Row numbers are 0 based, so the top row is row 0.<\/td><\/tr><tr><td><code>Col<\/code><\/td><td>The screen column where the left of the button is to be positioned. This refers to character columns in the prevailing font size. Column numbers are 0 based, so the start of each line is 0.<\/td><\/tr><tr><td><code>Height<\/code><\/td><td>The height of the button in multiples of the character height of the current font.<\/td><\/tr><tr><td><code>Width<\/code><\/td><td>The width of the button in multiples of the character width of the current font.<\/td><\/tr><tr><td><code>\"text\"<\/code><\/td><td>The text to be displayed on the button. This must be enclosed in quotation marks. Non-printing characters are not possible<\/td><\/tr><tr><td><code>Mode<\/code><\/td><td>The optional Mode parameter allows you to specify an autorepeat behaviour; so long as the user &#8220;holds down&#8221; the button it will generate regular click events. This is specified by the letter R followed optionally by the number of clicks per second. The default rate if not specified is 5. Example:<code>#HMI ButtonEvent(,5,9,3,20,\"Touch me\",R2,evButton) ;Draw SimpleHMI button, declare its handler<\/code>This will generate 2 clicks per second. If I leave out the &#8216;2&#8217;, I&#8217;ll get 5 clicks per secondThe second click is delayed twice as long as subsequent clicks, but up to a maximum of 1 second. This gives the effect ofClick &#8211; delay &#8211; click &#8211; click &#8211; click &#8230;The repeat rate must not be too fast for the system to handle. System loading is a function of how much work the host must do for each click event, plus the data transmission time of any response sent back to the SimpleHMI client. If you want a fast rate you should test carefully. In particular look out for evidence of clicks continuing to be processed after the button has been released. The system can buffer up a number of messages in serial buffers.<\/td><\/tr><tr><td><code>ClickHandler<\/code><\/td><td>You must place a subroutine at a program line with this label, which handles the click of the button<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Notes:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A given button can be re-used any number of times on different screens.<\/li>\n\n\n\n<li>The click handler will be run automatically when the button is clicked.<\/li>\n\n\n\n<li>The button can only be clicked if it is visible.<\/li>\n\n\n\n<li>A program can contain a maximum of 127 HMI related events<\/li>\n<\/ol>\n\n\n\n<p>In addition to being simple numbers, the row\/column coordinates may also be specified in relative or proportional terms. The following table illustrates the possibilities.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Format (example)<\/th><th>As a row specifier<\/th><th>As a column specifier<\/th><\/tr><tr><td><code>5<\/code><\/td><td>Row number 5 from the top, counting from 0. This can be a fractional number such as 5.5<\/td><td>Column number 5 from the left, counting from 0<\/td><\/tr><tr><td><code>-5<\/code><\/td><td>Row 5 from the bottom, counting from 0. This can be a fractional number such as -5.25<\/td><td>Column 5 from the right, counting from 0<\/td><\/tr><tr><td><code>0<\/code><\/td><td>The top character row<\/td><td>The left-most character column<\/td><\/tr><tr><td><code>-0<\/code><\/td><td>The bottom character row<\/td><td>The right-most character column<\/td><\/tr><tr><td><code>0.25<\/code><\/td><td>One quarter of (0.25 times) the screen height from the top. Fractional number between -1 and +1 are interpreted as a fraction of the screen.<\/td><td>One quarter of the screen width from the left.<\/td><\/tr><tr><td><code>-0.25<\/code><\/td><td>One quarter of the screen height from the bottom.<\/td><td>One quarter of the screen width from the right.<\/td><\/tr><tr><td><code>C<\/code><\/td><td>The top-bottom centre of the screen.<\/td><td>The left-right centre of the screen.<\/td><\/tr><tr><td><code>C+5<\/code><\/td><td>Five character rows down from the centre<\/td><td>Five character widths right from the centre.<\/td><\/tr><tr><td><code>C-5<\/code><\/td><td>Five character rows up from the centre<\/td><td>Five character width left from the centre.<\/td><\/tr><tr><td><code>C+.25<\/code><\/td><td>One quarter character row down from the centre. After a &#8220;C&#8221; all numbers are interpreted as multiples of the character pitch.<\/td><td>One quarter character width right from the centre.<\/td><\/tr><tr><td><code>C-3.25<\/code><\/td><td>Three and a quarter character rows up from the centre. After a &#8220;C&#8221; all numbers are interpreted as multiples of the character pitch.<\/td><td>Three and a quarter character widths left from the centre.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In addition to being simple numbers, the width and height coordinates may also be specified in relative or proportional terms. The following table illustrates the possibilities.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Format (example)<\/th><th>As a height specifier<\/th><th>As a width specifier<\/th><\/tr><tr><td><code>5<\/code><\/td><td>5 character rows in height<\/td><td>5 character rows in width<\/td><\/tr><tr><td><code>0.25<\/code><\/td><td>One quarter of (0.25 times) the screen height. Always calculated as a full number of rows, always rounded down, but forced to be at least 1.<\/td><td>One quarter of (0.25 times) the screen width. Always calculated as a full number of columns, always rounded down, but forced to be at least 1.<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Valid for use with hash command:&nbsp;HMI Name:Value Pairs&nbsp;are not supported Implemented on the following platforms: Android, Windows. Mode is optional Display a button at the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3768,"menu_order":2,"template":"","class_list":["post-3771","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title># ButtonEvent(ID, Row, Col, Height, Width, &quot;text&quot;{, Mode}, ClickHandler) hash function - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"# ButtonEvent(ID, Row, Col, Height, Width, &quot;text&quot;{, Mode}, ClickHandler) hash function - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Valid for use with hash command:&nbsp;HMI Name:Value Pairs&nbsp;are not supported Implemented on the following platforms: Android, Windows. Mode is optional Display a button at the...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T05:47:51+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/\",\"name\":\"# ButtonEvent(ID, Row, Col, Height, Width, \\\"text\\\"{, Mode}, ClickHandler) hash function - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-21T09:21:58+00:00\",\"dateModified\":\"2025-06-10T05:47:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deprecated\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"# HMI Android &#038; Windows\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"# ButtonEvent(ID, Row, Col, Height, Width, &#8220;text&#8221;{, Mode}, ClickHandler) hash function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"# ButtonEvent(ID, Row, Col, Height, Width, \"text\"{, Mode}, ClickHandler) hash function - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"# ButtonEvent(ID, Row, Col, Height, Width, \"text\"{, Mode}, ClickHandler) hash function - SPLat Controls","og_description":"Valid for use with hash command:&nbsp;HMI Name:Value Pairs&nbsp;are not supported Implemented on the following platforms: Android, Windows. Mode is optional Display a button at the...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T05:47:51+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/","name":"# ButtonEvent(ID, Row, Col, Height, Width, \"text\"{, Mode}, ClickHandler) hash function - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-21T09:21:58+00:00","dateModified":"2025-06-10T05:47:51+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Deprecated","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/"},{"@type":"ListItem","position":3,"name":"# HMI Android &#038; Windows","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/"},{"@type":"ListItem","position":4,"name":"# ButtonEvent(ID, Row, Col, Height, Width, &#8220;text&#8221;{, Mode}, ClickHandler) hash function"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3768"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}