Jump to content
Sign in to follow this  
TechCoder

Marquee_W3C UDF + User Friendly, Code Creating, Example Program

Recommended Posts

TechCoder
Below you will find both a new Marquee UDF (many W3C/HTML5 features and more) as well as a user-friendly program that both serves as an example script, as well as it will create the code for any particular marquee for you!  Enjoy!
 
~~~~~~~~~~~~~~~~~  BACKGROUND on <marquee> ~~~~~~~~~~~~~~~~~
<marquee> has been classed as "non-standard" and "non-conforming" as an HTML element
  (http://www.w3.org/wiki/HTML/Elements/marquee)  There is no promise that it will continue to be supported in the future, though it is obvious that many people have a need for this feature and it has remained in the major browsers for years.....
 
<marquee> was originally built into Internet Explorer only, now supported in other browsers, though some original features do not work in IE either - it is clearly trying to be phased out, though a 'replacement' of sorts is coming around, using HTML5 components, so I think it will never totally go away.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
For a project I'm working on, I need a way to create a LOT of different marquees.  I thought it simpler to have a program create the code needed, and built the attached 'user interface' program using various references to the feature.
 
THE USER PROGRAM IS BACKWARD COMPATIBLE WITH THE EXISTING UDF FROM Melba23
 
I also needed some features that are not part of the UDF from Melba23 that are direct references to current (HTML5) recommendations from http://www.w3.org/TR/CSS2/, so I modified the current UDF to create the additional functions, which make the UDF more HTML5 compliant (some of the features I built in have no HTML5 component, existing functions were updated only where needed for the first release - perhaps someday the rest can be done, though no immediate plans)
 
 *******************************************************************************************************************************
 
 KNOWN ISSUES and/or LIMITATIONS within the user program
 
- Tip text NOT IMPLEMENTED (from _GUICtrlMarquee_SetDisplay $sTipTxt) - I had no use for it in my project, though it is not difficult to add if you need to
 
- border styles do not correspond to w3.org settings (not the program's fault...)
This article (http://webdesign.about.com/od/beginningcss/a/aa091207.htm) states that IE does not support 'groove', 'ridge', 'inset' or 'outset' styles, yet does support 'dotted', 'dashed' and 'double'.
  Testing has proven this is true for IE (11), however, in testing AutoIt (with the Marquee UDF), which I thought uses IE (?), it appears that just the OPPOSITE of this is true.  Another item for further testing/study.........
 
- 'Align' feature not working 100% on all fonts (not the program's fault! ;)
the initial version of <marquee> (designed for IE and copied to other browsers later) contained an element called 'align', which has long been obsolete in favor of css 'vertical-align', however, it is not a direct replacement  and does not work inside <marquee>.  
 
Several alternatives were tried (including 'line-height' and even 'vspace', which may also soon be phased out) and nothing works 'perfectly' (search the web on font sizing and spacing - you will see this is extremely difficult).
       This program works around these challenges in a 'best effort' way, using calculations and 'top-margin' (or vspace) spacing.
       'Recommended' fonts (http://www.autoitscript.com/autoit3/docs/appendix/fonts.htm) will be set to 'center' or 'bottom' (within a pixel or 2), while other fonts may be off by several pixels (something in the font is different..).
       If you need the other fonts, a bit of testing would give some offset numbers that could result in better display. (this is NOT on my list to do, though maybe someone would want to take that on???)
 
- You can create 'unreadable', 'unusable' and even 'UGLY' marquees (not the program's fault, either!)
While a bit of effort was put into limiting things, there is no cross-checking to make sure your marquee will look 'nice'.  All parameters within the marquee feature have been tested to their max/min limits (and pushed well past the documented limits for speed and delay - you can make a  F A S T  or  S L O W  marquee well outside the published specs!) and set accordingly.
 
Any/all color scheme, font size, etc. can be used (no matter how horrible the outcome...) so have fun and create what you like!
 
 *******************************************************************************************************************************
 
Additional recommendations from w3.org built into Marquee_W3C.au3 UDF
 
1. Border thickness (width) refered as "thin", "medium" and "thick" or <length> (any number - to infinity) 
Marquee_W3C UDF allows any number as an entry, as well as the more 'friendly' named terms
 
2. Border Style is included in Marquee_W3C UDF (not in the current UDF, therefore, none of the settings in the user program do anything if you use the old UDF, so it is set to $GUI_DISABLE.)
 
3. use of PIXELS and EM for formatting text instead of POINTS
     http://www.w3.org/TR/CSS2/syndata.html#value-def-length with named length units (em, ex, cm, in, px, etc.)
  POINTS are used in typsetting, while PIXELS, and EM are more correct methods of sizing fonts on modern monitors (one good article on this topic can be found at http://webdesign.about.com/cs/typemeasurements/a/aa042803a.htm )
 
NOTE: The user program is backward compatible with the UDF from Melba23 that uses POINTS
and auto-sets the parameter with the chosen UDF.
 

 

Marquee_W3C.au3

MarqueeMaker.au3

  • Like 1

Share this post


Link to post
Share on other sites
KLM

Thanks. 

I'll try this.


K L M
------------------
Real Fakenamovich
------------------
K L M
------------------
Real Fakenamovich
------------------

Share this post


Link to post
Share on other sites
mLipok

nice UDF

but

I notice that Frame border style for example "Dotted" do not work.

mLipok


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library
 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-10-15

Share this post


Link to post
Share on other sites
TechCoder

 

border styles do not correspond to w3.org settings (not the program's fault...)

This article (http://webdesign.about.com/od/beginningcss/a/aa091207.htm) states that IE does not support 'groove', 'ridge', 'inset' or 'outset' styles, yet does support 'dotted', 'dashed' and 'double'.
  Testing has proven this is true for IE (11), however, in testing AutoIt (with the Marquee UDF), which I thought uses IE (?), it appears that just the OPPOSITE of this is true.  Another item for further testing/study.........

That's why I put that statement in the top post - seems very odd behaviour and I wasn't sure how it would react.  

I left in all the W3C settings in case someone has an answer - felt it better to have them available than to make a 'perfect' user interface with only working items (then, someone would ask "why did you leave these out?"!)

Would like other feedback on just how AutoIt works internally on the embedded IE - does it really use the IE from the user's computer (which I thought, but testing seems it doesn't) or a broken-down version (for speed, etc.) or what?   Haven't researched it, but certainly the behaviour here is not consistent on the borders.

Share this post


Link to post
Share on other sites
Sven

This is great. Thanks a lot!

Is there a way to update message text and color without having to delete the current marquee control and initializing a new one?

The code creator seems to be missing a couple of quotation marks, e.g.

_GUICtrlMarquee_SetScroll($aMarquee, Number(), scroll, left, Number(6), Number(85), middle)

_GUICtrlMarquee_SetDisplay($aMarquee, thin, 0, 16777215,  Number(30), Times New Roman,  StringLower(Solid), black)

_GUICtrlMarquee_Create($aMarquee, Your TEXT Goes Here, $iLeft, $iTop, 1920, 200)

 

should be more like
 
_GUICtrlMarquee_SetScroll($aMarquee, Number(), 'scroll', 'left', Number(6), Number(85), 'middle')

_GUICtrlMarquee_SetDisplay($aMarquee, 'thin', 0, 16777215,  Number(30), 'Times New Roman',  StringLower('Solid'), 'black')

_GUICtrlMarquee_Create($aMarquee, 'Your TEXT Goes Here', $iLeft, $iTop, 1920, 200)
 
And there probably should be a number in "Number()", too.
Edited by Sven

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • Danp2
      By Danp2
      Introduction
      This UDF will allow you to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.
      Requirements
      JSON UDF https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn
      WinHTTP UDF https://www.autoitscript.com/forum/topic/84133-winhttp-functions/
      WebDriver for desired browser
      Chrome WebDriver https://sites.google.com/a/chromium.org/chromedriver/downloads FireFox WebDriver https://github.com/mozilla/geckodriver/releases Function List
      Core Functions
      _WD_CreateSession($sDesiredCapabilities='{}') _WD_DeleteSession($sSession) _WD_Status() _WD_Timeouts($sSession, $sTimeouts = '') _WD_Navigate($sSession, $sURL) _WD_Action($sSession, $sCommand) _WD_Window($sSession, $sCommand, $sOption = '') _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartElement = "", $lMultiple = False) _WD_ElementAction($sSession, $sElement, $sCommand, $sOption='') _WD_ExecuteScript($sSession, $sScript, $sArguments="[]") _WD_Alert($sSession, $sCommand, $sOption = '') _WD_GetSource($sSession) _WD_Cookies($sSession, $sCommand, $sOption = '') _WD_Option($sOption, $vValue = "") _WD_Startup() _WD_Shutdown() Helper Functions
      _WD_NewTab($sSession, $lSwitch = True) _WD_Attach($sSession, $sString, $sMode = 'title') _WD_LinkClickByText($sSession, $sText, $lPartial = True) _WD_WaitElement($sSession, $sElement, $sStrategy, $sSelector[, $iDelay = 0[, $iTimeout = -1]]) _WD_LastHTTPResult() _WD_GetFrameCount() _WD_IsWindowTop() _WD_FrameEnter($sIndexOrID) _WD_FrameLeave() _WD_HighlightElement($sSession, $sElement[, $iMethod = 1]) _WD_HighlightElements($sSession, $aElements[, $iMethod = 1]) WD_LoadWait($sSession, $iDelay = 0, $iTimeout = -1, $sElement = '') Source Code
      You will always be able to find the latest version in the GitHub Repo 
      Help / Support
      Please post any questions, suggestions or errors in the GH&S thread.
      https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/
    • Dent
      By Dent
      As the title says. I open IE11 and navigate to a page with the following HTML5 file upload container in Capture0.JPG
      I want to click Add Files but I haven't been able to. Here's the code that handles the Add Files button in Capture.JPG
      _IEGetObjectById and then using _IEAction to click it doesn't work. I can't give access to the actual page unfortunately because it's password protected.
      All suggestions welcome.


    • coffeeturtle
      By coffeeturtle
      Just trying to display this news site into a GUI with an embedded IE instance:  https://news.sky.com/
      It looks terrible. Videos won't play.
      Is there a current way around this?
      Thank you in advance.
    • Reizvoller
      By Reizvoller
      Greetings!
      I am having an issue that I can't seem to be able to figure out. I would really appreciate an extra pair of eyes to validate my work so far.
      All this is, so far, is just a bunch of shapes on an HTML page. It is to be a very simple game ( just exploring Javascript through making this ) but right now I am just building the framework/elements.
      The script is this 
      <!DOCTYPE HTML> <html> <head> <style> body { margin: 0px; padding: 0px; } #canvas-container { width: 100%; text-align:center; } canvas { display: inline; } </style> </head> <body onload="startUp()"> <div id="canvas-container"> <canvas id="game" width="300" height="500"></canvas> </div> <script> var canvas = document.getElementById('game'); var ctx = canvas.getContext('2d'); var x = canvas.width; var y = canvas.height; var scoreVal = 0; var itemXRand = Math.floor(Math.random() * x) + 1 ctx.stroke(); function cloud(){ ctx.beginPath(); ctx.moveTo(170, 30); ctx.bezierCurveTo(130, 100, 130, 150, 230, 150); ctx.bezierCurveTo(250, 180, 320, 180, 340, 150); ctx.bezierCurveTo(420, 150, 420, 120, 390, 100); ctx.bezierCurveTo(430, 40, 370, 30, 340, 50); ctx.bezierCurveTo(320, 5, 250, 20, 250, 50); ctx.bezierCurveTo(200, 5, 150, 20, 170, 80); ctx.closePath(); ctx.lineWidth = 5; ctx.fillStyle = '#8ED6FF'; ctx.fill(); ctx.strokeStyle = '#0000ff'; ctx.stroke(); } function workArea(){ ctx.beginPath(); ctx.rect(0, 0, x, y); ctx.fillStyle = "#2ab9ff"; ctx.fill(); ctx.stroke = 1; } function topRect(){ ctx.beginPath(); ctx.rect(0, 0, x, 30); ctx.fillStyle = "#D3D3D3"; ctx.fill(); ctx.stroke = 1; } function scoreKeep(){ ctx.font = "15px Arial"; ctx.fillStyle = "#000000"; ctx.fillText("Score "+scoreVal,5, 25); } function bttmRect(){ ctx.beginPath(); ctx.rect(0, y-30, x, 30); ctx.fillStyle = '#5bc928'; ctx.fill(); ctx.stroke = 1; } function monstRect(){ ctx.beginPath(); ctx.rect(0, y-80, x, 30); ctx.fillStyle = 'red'; ctx.fill(); ctx.stroke = 1; } function itemCirc(){ var centerX = itemXRand var radius = 15; var positionY = 45; ctx.beginPath(); ctx.arc(centerX, positionY, radius, 0, 2 * Math.PI, false); ctx.fillStyle = randomColor(); ctx.fill(); ctx.lineWidth = 1; ctx.strokeStyle = '#003300'; ctx.stroke(); } function startUp(){ workArea(); topRect(); bttmRect(); scoreKeep(); itemCirc(); monstRect(); cloud(); } function randomColor(){ return('#'+Math.floor(Math.random()*16777215).toString(16)); } </script> </body> </html> The issue is that cloud() and monstRect() will not show up when the page loads. If I comment out workArea(), topRect(), and bttmRect() in the function "startUp()" then monstRect() and cloud() show up. I've re-read those little snippets of code for those three areas that I comment out and I can't see where I have gone wrong.
      Any advice or if you can spot my mistake I would really appreciate it.
      Thank you!
      -Reiz
    • UEZ
      By UEZ
      AutoIt SysInfo Clock is a small tool in widget style to show the clock, current CPU usage, CPU speed, memory usage and network activity (tcp, ip and udp). Additionally you can use it as an alarm clock. To stop alarm clock tone press the left LED (mail) or wait 60 seconds.
       
      The current CPU usage code is beta and might be not working for some CPUs!

      Main window:

      Move mouse to area below seconds and press rmb to select different color scheme.

      Alarm Clock window:


      Tray menu:



       
      Credits: see scroller (select About).
       
      Special thanks to trancexx for helping me to read out current CPU speed using the WinAPI stuff, AndyG for troubleshooting performance counter issue, czardas for composing "Für Elise" and Ascend4nt for the support!  
       
       
      Download source code + compiled version: Click Me (previous downloads: 1386)
      (Please don't use any download manager!)
       
      Compiled version only: MediaFire.com or 4Shared.com
       

      Coded on Win7 x64 using Aero  / Win8.1 x64 and AutoIt v3.3.12.0.
       
       
      Br,
      UEZ
       
       
      This project is discontinued!
       
       
      Change log:
      v0.9.5.0 build 2013-06-14: initial release
      v0.9.6.0 build 2013-06-15: added _WinAPI_CreateRoundRectRgn() to fix transparency issue on non Aero desktops, small internal modifications and added check for whether performance counters are enabled
      v0.9.6.5 build 2013-06-15: fixed a bug when "Reset Windows Position" was selected twice and color of scroller will fit to clock color schema
      v0.9.8.0 build 2013-06-20: added little music to About part -> many thanks to czardas for mus++ and arranging "Für Elise", added date to clock, replaced CPU usage code -> thanks Ascend4nt
      v0.9.9.0 build 2013-06-21: added 2 more color schemas (mint and purple), added network traffic LED, compiled exe now included in archive
      v0.9.9.0 build 2013-06-22: forgot to increase a variable in ini section
      v0.9.9.0 build 2013-06-24: found also missing modification in context menue after adding two more color schemas
      v0.9.9.0 build 2013-06-26: Ops, forgot to change also radio item proper check in clock color schema sub menu
      v0.9.9.1 build 2013-06-27: added option to select whether SysInfo Clock should start at windows startup
      v0.9.9.2 build 2013-07-01: added yellow-red mark to the small info indicators and additional info when hovering about the small indicators, small internal changes
      v0.9.9.5 build 2013-07-05: added features: singleton, update check, visit web site, bring GUI to front and fixed some smaller bugs + some internal changes
      v0.9.9.6 build 2013-07-11: added alarm clock feature
      v0.9.9.7 build 2014-06-23: adapted code to run on AutoIt version 3.3.12.0
      v0.9.9.7 build 2014-08-27: some internal "cosmetic" changes -> this project is discontinued!
×