{"id":275,"date":"2011-05-03T05:57:04","date_gmt":"2011-05-03T05:57:04","guid":{"rendered":"http:\/\/charlie-roberts.com\/Control\/?p=275"},"modified":"2011-05-03T05:57:04","modified_gmt":"2011-05-03T05:57:04","slug":"new-interface-templates","status":"publish","type":"post","link":"http:\/\/charlie-roberts.com\/Control\/?p=275","title":{"rendered":"New Interface Templates"},"content":{"rendered":"<p>I updated <a href=\"http:\/\/www.charlie-roberts.com\/Control\/interfaces\/template.js\">the interface template file<\/a> today to take advantage of some of the 1.2 coding conventions. For example, buttons can now have label text without requiring a separate label widget defined; just add the &#8220;label&#8221; property to any button widget and pass some text as a value. Also, I added shorthand syntax for defining boundary rectangles:<\/p>\n<p><code><br \/>\n\/**** before (and still valid, but not the most efficient) *****\/<br \/>\n\"x\": 0, \"y\": 0, \"width\": .654, \"height\": .3<\/p>\n<p>\/**** as of 1.2 ****\/<br \/>\n\"bounds\": [0, 0, .654, .3]<br \/>\n<\/code><\/p>\n<p>These two changes (bounds &#038; button labels) cut the code for the interface template (any many other interfaces) in half.<\/p>\n<p>I also added a <a href=\"http:\/\/www.charlie-roberts.com\/Control\/interfaces\/multipage_template.js\">multipage interface template file.<\/a> You can use different pages to define separate screens of widgets; you can move between these pages by pressing the provided buttons in the template (this functionality could also be mapped to a slider). The javascript for switching pages can either target a specific page:<br \/>\n<code><br \/>\ncontrol.changePage(2);<br \/>\n<\/code><br \/>\n or can change pages relatively: <\/p>\n<p><code>control.changePage(\"next\");<br \/>\ncontrol.changePage(\"previous\");<br \/>\n<\/code><\/p>\n<p>The &#8220;info&#8221; button in all the default interfaces included with Control just calls the changePage() method and takes you to a page containing nothing but a label with informational text and a back button.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I updated the interface template file today to take advantage of some of the 1.2 coding conventions. For example, buttons can now have label text without requiring a separate label widget defined; just add the &#8220;label&#8221; property to any button widget and pass some text as a value. Also, I added shorthand syntax for defining [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275"}],"version-history":[{"count":2,"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":277,"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions\/277"}],"wp:attachment":[{"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/charlie-roberts.com\/Control\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}