Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Menu Bar

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,40812
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Menu Bar
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Menu Bar - 12/12/2006 4:54:24 AM   
  TNO


Posts: 1036
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
One of my many side projects is to create scripting libraries and components so that one doesn't have to rely on ActiveX as much as they do now for functionality. To steal the term from Brendan Eich "DeCOMtamination" is the goal. Heres the first component I'd like to share that was adapted and updated from an old script I found undocumented in the MSDN archive around the year 2000:

A menu bar for your HTA projects:

Your html page is as simple as this:


      

What I've done is create a custom HTML tag called (obviously) <TNO:jsmenu>.By looking at this code you can see how easy it is to add and take away menu items.  At the top of the document you'll notice three things: First, <HTML xmlns:TNO> which defines the name of my custom Tag. Second,<?IMPORT namespace="TNO" implementation="jsmenu.htc"> which defines what code is going to make that tag work. Third, <script type="text/javascript" src="menufunction.js"></script> which tells the menu what functions to use when I click on a menu item.

The js file is simple menufunction.js:


      

All this does is call the functions I really want to use for each menu item.

And finally the back-end engine that does all the work, The HTML Component file (jsmenu.htc):


      

I'll let the inline comments explain themselves.

To see a live example of this in action, you can see it here:

http://thenewobjective.com/website/development/JavaScript/Components/Menubar/

I've been working on a vbscript equivalent, but haven't had any success yet. Event Listeners are causing me headaches. Perhaps one of you master vbscripters can come up with a translation. If so I would gladly host it for the indefinate future. (All credit due of course).

Stay tuned, in the works:
Context menu for your mouse.
Cross Platform File browser that relies only on WSH and an HTA
A Combo Box (Just like the address bar of the browser)
A Splash Screen (For that professional look)
A Table with a frozen header and left column just like EXCEL

< Message edited by TNO -- 1/17/2008 4:28:46 AM >


_____________________________

Consolidated Script Component: The Acid Test

A universe of complexity...
 
 
Post #: 1
 
 RE: DeCOMtamination: Menu Bar - 12/13/2006 3:57:41 AM   
  ginolard


Posts: 1005
Score: 21
Joined: 8/10/2005
Status: offline
Ahhhhhhh....HTA menus.  Bring back memories of the early ManagePC days.

I used the Milonic menu system which is written in Jscript and is incredibly customisable.  I stumbled across the same problem with event handlers as you though.  Just couldn't get them to work

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to TNO)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Menu Bar Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts