{"id":914,"date":"2019-01-22T12:32:05","date_gmt":"2019-01-22T12:32:05","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=914"},"modified":"2022-02-18T15:37:48","modified_gmt":"2022-02-18T15:37:48","slug":"functions-on-pages","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/displays-2\/nextion\/nextion-editor\/functions-on-pages","title":{"rendered":"Functions on pages"},"content":{"rendered":"\n<p>You can add functions to pages by adding touch areas.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Add a new function<\/h5>\n\n\n\n<p>Toolbox &gt; &#8220;Hotspot&#8221; to add a new touch area.  Make it small and put it somewhere not normally touched.<\/p>\n\n\n\n<p>For example, say we have added a touch area called &#8220;m0&#8221;.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Trigger the function from an object<\/h5>\n\n\n\n<p>You can call this from any other object on the page using this code, for instance in a picture object you are using as a button or graphical checkbox &#8220;Touch Release Event&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>co.val=13\t\t\/\/Set a value we want to pass to the m0 event, e.g. to provide the \"id\" of the object that has been touched.  \"co\" needs to be a variable that has been added to the page\nclick m0,1\t\/\/0=trigger 'Touch Release Event', 1=trigger 'Touch Press Event'<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Add the function code<\/h5>\n\n\n\n<p>Uncheck &#8220;send component id&#8221; to stop the object event being sent out of the UART.<\/p>\n\n\n\n<p>You can add code to both the &#8216;Touch Press Event&#8217; and &#8216;Touch Release Event&#8217; and call each separately.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can add functions to pages by adding touch areas. Add a new function Toolbox &gt; &#8220;Hotspot&#8221; to add a new touch area. Make it small and put it somewhere not normally touched. For example, say we have added a touch area called &#8220;m0&#8221;. Trigger the function from an object You can call this from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-914","post","type-post","status-publish","format-standard","hentry","category-nextion-editor"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=914"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/914\/revisions"}],"predecessor-version":[{"id":922,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/914\/revisions\/922"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}