{"id":17,"date":"2008-03-01T16:14:29","date_gmt":"2008-03-02T00:14:29","guid":{"rendered":"http:\/\/www.installaware.com\/blog\/?p=17"},"modified":"2008-03-01T16:14:29","modified_gmt":"2008-03-02T00:14:29","slug":"how-to-detect-the-complete-scroll-of-your-license-agreement","status":"publish","type":"post","link":"https:\/\/www.installaware.com\/blog\/?p=17","title":{"rendered":"How to detect the complete scroll of your license agreement"},"content":{"rendered":"<p>Hello everyone, I hope you&#8217;ve all been well!<\/p>\n<p>One extremely useful feature in the latest releases of Install<strong>Aware<\/strong> &#8211; assuming of course that you&#8217;re a <strong>sadistic developer <\/strong>and\/or have a <strong>legal department with torturous inclinations<\/strong> &#8211; is detecting the scroll state of your license agreements. I&#8217;m sure you&#8217;ve seen those pesky setup programs which check whether you&#8217;ve scrolled all the way to the bottom before enabling the Next button. Well, now you can build those pesky setups in Install<strong>Aware<\/strong> also \ud83d\ude42 We&#8217;ve recently added (7.5 and 7 R2) the capability to detect the scroll state of text boxes and richedit boxes &#8211; the two dialog controls which are likely to host your license agreement files in Install<strong>Aware<\/strong>.<\/p>\n<p>Of course, in the good Install<strong>Aware<\/strong> tradition, thanks to our generic implementation, you can even force the scrolling of your readme files, or any other custom files. Joy to the hearts of those who find this a useful feature \ud83d\ude09 When a <strong>Memo <\/strong>or <strong>RichEdit <\/strong>dialog control gets scrolled to the bottom, it now <strong>automatically sets its MaxLength property to 214783647 <\/strong>(that funny number is actually <strong>MAXINT <\/strong>from the Platform SDK). So if you want to check\/enforce such scrolling, you just make use of this property. Let&#8217;s now go through a walkthrough of this:<\/p>\n<p>First, you want to open up your license agreement dialog in the <strong>InstallAware Dialog Editor<\/strong>. One way of doing this is selecting the <strong>Design <\/strong>tab on the Install<strong>Aware<\/strong> IDE, clicking the <strong>Dialogs and UI <\/strong>button in the <strong>Views <\/strong>group, choosing the <strong>Dialogs <\/strong>page which lists all available dialogs in your current setup project, and then double clicking &#8220;<strong>licensecheck<\/strong>&#8221; &#8211; which is the default dialog that is used for showing license agreements. Of course, feel free to open any other dialog that you&#8217;d like to add this behavior to.<\/p>\n<p><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Dialogs.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Dialogs.png\" \/><\/a> &#8211; <a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/LicenseCheck.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/LicenseCheck.png\" \/><\/a><\/p>\n<p>Once the dialog is open, double-click any control on the dialog until you see the <strong>Object Behavior<\/strong> window come up.<\/p>\n<p><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules.png\" \/><\/a><\/p>\n<p>Go to the &#8220;<strong>Object Rules<\/strong>&#8221; tab to add <strong>two new rules<\/strong>, one to disable the <em>Next button <\/em>when scrolling has not occurred, and the other to enable it when scrolling has indeed occurred.<\/p>\n<p><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-New.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-New.png\" \/><\/a><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules.png\" target=\"_blank\"><br \/>\n<\/a><\/p>\n<p>First, the rule that <strong>disables <\/strong>the <em>Next button <\/em>if the scrolling has not yet occured:<\/p>\n<p><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-New-False.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-New-False.png\" \/><\/a><\/p>\n<p>And second, the rule that <strong>enables <\/strong>the <em>Next button <\/em>when the scrolling has occured:<\/p>\n<p><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-New-Add.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-New-Add.png\" \/><\/a><\/p>\n<p>So, your rules should now look something like this:<\/p>\n<p><a href=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-Final.png\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.installaware.com\/blog\/pics\/license\/Object-Rules-Final.png\" \/><\/a><\/p>\n<p>The ordering is important when you have multiple rules. Always make sure that the <strong>disabling rules come first <\/strong>and the <strong>enabling rules come last<\/strong>. While in this example we only have one set of rules, observing the disable first\/enable last rule of thumb becomes necessary when the <em>Next button <\/em>has multiple constraints upon it (for example, both a check-box and the scroll condition). You can always <strong>re-sort rules <\/strong>after having already added them <strong>using the Up\/Down buttons <\/strong>located at the lower left corner of the <strong>Existing Rules <\/strong>listing.<\/p>\n<p>Remember that you can always add more rules to fit your requirements! For instance, you could just as well enable\/disable the proverbial <em>I Agree check-box<\/em>, instead of manipulating the <em>Next button <\/em>directly. Just use the simple logic demonstrated here: check whether the <strong>MaxLength <\/strong>property of the <strong>LicenseText <\/strong>control is equal to <strong>2147483647 <\/strong>yet or not.<\/p>\n<p>Let me know if you have any questions! Until my next post, have a great week! Now, go and make your users suffer \ud83d\ude09<\/p>\n<p>Panagiotis Kefalidis<br \/>\nSoftware Design Team Lead<br \/>\nInstall<span style=\"font-weight: bold\">Aware<\/span> Software Corporation<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone, I hope you&#8217;ve all been well! One extremely useful feature in the latest releases of InstallAware &#8211; assuming of course that you&#8217;re a sadistic developer and\/or have a legal department with torturous inclinations &#8211; is detecting the scroll state of your license agreements. I&#8217;m sure you&#8217;ve seen those pesky setup programs which check &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.installaware.com\/blog\/?p=17\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to detect the complete scroll of your license agreement&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-custom-dialogs","category-news"],"_links":{"self":[{"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":0,"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.installaware.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}