{"id":1081,"date":"2012-02-09T20:24:00","date_gmt":"2012-02-10T01:24:00","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=1081"},"modified":"2021-03-11T10:59:56","modified_gmt":"2021-03-11T15:59:56","slug":"powerbuilder-more-datawindow-mouseover-effects","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-more-datawindow-mouseover-effects\/","title":{"rendered":"PowerBuilder &#8211; More Datawindow Mouseover Effects"},"content":{"rendered":"<p>So I download the latest Chrome browser beta the other day (v17) and I notice a neat effect on the tabs prior to applying my custom settings. A gradient centered on my mouse pointer passed across the tab as I moved it. It was very subtile but noticiable if you were paying attention. Naturally I wanted to reproduce the effect in Powerbuilder (I used v12.5 but you could do the same thing in 10 or 11).<\/p>\n<p>The settings on the datawindow column are as follows:<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/02\/columnbackground.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1082 size-full\" title=\"columnbackground\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/columnbackground.png\" alt=\"\" width=\"286\" height=\"516\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/columnbackground.png 286w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/columnbackground-166x300.png 166w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/columnbackground-83x150.png 83w\" sizes=\"(max-width: 286px) 100vw, 286px\" \/><\/a><\/p>\n<p>The Scale is set to 20 and the Spread to 25. The expression for the Mode is<\/p>\n<pre name=\"code\" class=\"VB\">if (highlight =   describe(&quot;menu_option1.name&quot;),4,0)<\/pre>\n<p>Where the name of the column is &#8216;menu_option1&#8217;.<\/p>\n<p>The expression for the Focus is<\/p>\n<pre name=\"code\" class=\"VB\"> percent<\/pre>\n<p>Both these expressions refer to hidden columns on the datawindow (&#8220;highlight&#8221; and &#8220;percent&#8221;) which have their values set in code on the datawindow object itself. To do this you need to define a userevent with the Event ID &#8216;pbm_dwnmousemove&#8217;; I call mine &#8216;mousemove&#8217;. In the event is the following code:<\/p>\n<pre name=\"code\" class=\"VB\">int li_pct\nCHOOSE CASE Pos(dwo.Name,&#039;menu_option&#039;)\n  CASE IS &gt; 0\n    \/\/ expression on visible property looks at this value\n    this.setitem(row,&#039;highlight&#039;,dwo.Name) \n    \/\/controls the focus of the gradient background\n    li_pct = ROUND((pixelstounits( xpos, XPixelsToUnits!) - &amp; \n    integer(describe(dwo.Name + &#039;.x&#039;))) \/ &amp;\n    integer(describe(dwo.Name + &#039;.Width&#039;)) * 100 , 0)\n    this.setitem(row,&#039;percent&#039;, li_pct)\n  CASE ELSE\nEND CHOOSE<\/pre>\n<p>Here are some screenshots showing the effect.<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/02\/mouseover1.png\"><img loading=\"lazy\" class=\"alignleft wp-image-1094 size-full\" title=\"mouseover1\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover1.png\" alt=\"\" width=\"161\" height=\"50\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover1.png 161w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover1-150x46.png 150w\" sizes=\"(max-width: 161px) 100vw, 161px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/02\/mouseover2.png\"><img loading=\"lazy\" class=\"alignleft wp-image-1095 size-full\" title=\"mouseover2\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover2.png\" alt=\"\" width=\"158\" height=\"44\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover2.png 158w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover2-150x41.png 150w\" sizes=\"(max-width: 158px) 100vw, 158px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/02\/mouseover3.png\"><img loading=\"lazy\" class=\"alignleft wp-image-1096 size-full\" title=\"mouseover3\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover3.png\" alt=\"\" width=\"173\" height=\"53\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover3.png 173w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/02\/mouseover3-150x45.png 150w\" sizes=\"(max-width: 173px) 100vw, 173px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I download the latest Chrome browser beta the other day (v17) and I notice a neat effect on the tabs prior to applying my custom settings. A gradient centered on my mouse pointer passed across the tab as I moved it. It was very subtile but noticiable if you were paying attention. Naturally I&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[21,12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1081"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=1081"}],"version-history":[{"count":10,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1081\/revisions"}],"predecessor-version":[{"id":2012,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1081\/revisions\/2012"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=1081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=1081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}