{"id":376,"date":"2010-09-20T20:40:00","date_gmt":"2010-09-21T01:40:00","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=376"},"modified":"2021-03-09T11:35:38","modified_gmt":"2021-03-09T16:35:38","slug":"powerbuilder-special-effects-popup","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-special-effects-popup\/","title":{"rendered":"PowerBuilder \u2013 Special Effects Popup"},"content":{"rendered":"<p>A question came up on Tek-tips forum regarding creating a special effects popup window. These are the kind which come up from the bottom right corner of your display to tell you your virus data has been updated or some such important message. Many times these are also semi transparent and even go away after a set time period. This is what I came up with.<\/p>\n<p>This is using PB 11.5.1.<\/p>\n<p>Create a window of type main! with no titlebar. Set the transparency to 10, the OpenAnimation to Bottomroll! and the CloseAnimation to toproll!.<\/p>\n<p>In my window I put a picturebutton with the small Red X bitmap, a static text control, and a datawindow. The datawindow object is a freeform external with a single string data element called &#8216;message_text&#8217;. A single instance variable is declared on the window (Long il_open).<\/p>\n<p>In the Open Event<\/p>\n<pre name=\"code\" class=\"VB\">long ll_ScreenHt, ll_ScreenWid\nlong ll_row\nenvironment le_env\n\n\/\/ Get screen size from environment\nGetEnvironment( le_env )\n\nll_ScreenHt = PixelsToUnits( le_env.ScreenHeight, YPixelsToUnits! )\nll_ScreenWid = PixelsToUnits( le_env.ScreenWidth, XPixelsToUnits! )\n\n\/\/ open in lower right corner\nthis.Move( ( ll_ScreenWid - this.Width ), ( ll_ScreenHt - this.Height ) )\n\nll_row = dw_1.insertrow(0)\ndw_1.setitem(ll_row,&#039;message_text&#039;,&#039;Here is a datawindow row&#039;)\n\nTimer(1)<\/pre>\n<p>In the Timer Event<\/p>\n<pre name=\"code\" class=\"VB\">st_1.text = &#039;Timer Count: &#039; + string(il_open)\n\nil_open ++\n\nIF Mod(il_open, 2) = 0 AND il_open &gt; 4 THEN\n\tTHIS.Transparency = This.Transparency + 10\nEND IF\n\/\/ close the window if no one is paying attention\nIf This.Transparency &gt; 60 THEN\n\tevent post close()\nEND IF<\/pre>\n<p>The Close Event:<\/p>\n<pre name=\"code\" class=\"VB\">Close(THIS)<\/pre>\n<p>And finally in the clicked event of the picture button:<\/p>\n<pre name=\"code\" class=\"VB\">Parent.event post close()<\/pre>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2010\/09\/popup-window-sample1.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-381 size-full\" title=\"popup window sample\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/09\/popup-window-sample1.png\" alt=\"\" width=\"411\" height=\"193\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/09\/popup-window-sample1.png 411w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/09\/popup-window-sample1-300x140.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2010\/09\/popup-window-sample1-150x70.png 150w\" sizes=\"(max-width: 411px) 100vw, 411px\" \/><\/a><\/p>\n\n\n<p>Updated March 2021<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A question came up on Tek-tips forum regarding creating a special effects popup window. These are the kind which come up from the bottom right corner of your display to tell you your virus data has been updated or some such important message. Many times these are also semi transparent and even go away after&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/376"}],"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=376"}],"version-history":[{"count":15,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/376\/revisions"}],"predecessor-version":[{"id":1828,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/376\/revisions\/1828"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}