Jump to content

Marquee_W3C UDF + User Friendly, Code Creating, Example Program


TechCoder
 Share

Recommended Posts

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

Link to comment
Share on other sites

nice UDF

but

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

mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor 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 * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

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 * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

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 *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"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: 2023-04-24

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

  • 4 months later...

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
Link to comment
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
 Share

×
×
  • Create New...