spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column49


Using JavaScript in HomeSite 4.0, Part II

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Manipulating Toolbars, Part II

AddAppToolbutton(toolbarName, executablePath, commandLineArg, toolTip)Boolean

Adds a button to an existing toolbar (toolbarName). When clicking the button, the given executable (executeablePath) will run. The commandLine argument specify the command line to call the application with. The toolTip argument specifies a short tip that shows up when the mouse is over the button. The following line of code adds an Internet Explorer button to the linkbot toolbar:


app.AddAppToolbutton("linkbot", "C:\\Program Files\\Internet
Explorer\\IEXPLORE.EXE", "U:\\Yehuda\\column49", "Internet Explorer")

Watch for the new button on the linkbot toolbar. The tooltip shows "Internet Explorer", and when invoked, the Internet Explorer sets its location to the given folder U:\Yehuda\Column49. The command line in this particular case includes just the default location. If an empty string is passed instead, the Internet Explorer starts at the default home page. Returns a true value when successful, a false value otherwise. Does not duplicate existing buttons with the same executable path and the same command line.

AddTagToolbutton(toolbarName, tagStart, tagEnd, toolTip, caption, imageFile)Boolean

Adds a button to a given toolbar (toolbarName) for adding a pair of tags to the current active file. The tag pair includes an opening string (tagStart) and a closing string (tagEnd). The button displays a tip message when passing over it with the mouse (toolTip), and has the appearance of the the specified two-letter caption (caption) overlayed on top of the image specified by imageFile. Here is an example:


app.AddTagToolbutton("linkbot", "", "<\/Yehuda>", "Yehuda Tag", "YS",
"C:\\WINDOWS\\Waves.bmp");

You can see that the linkbot toolbar has a new button. Clicking it inserts the specified tag pair into the active document. This method returns a true value if successful, a false value otherwise. A false value is returned if the specified toolbar is not found. A true value is returned if the button already exists (the button is not duplicated).

AddScriptToolbutton(toolbarName, scriptFile, toolTip, caption, imageFile)Boolean

Adds a button to a given toolbar (toolbarName) for running a given JavaScript script (scriptFile). The button displays a tip message when passing over it with the mouse (toolTip), and has the appearance of the the specified two-letter caption (caption) overlaid on top of the image specified by imageFile. For example, the following JavaScript line:


app.AddScriptToolbutton("linkbot", "U:\\Yehuda\\column49\\toolbar.js",
 "Yehuda Tag", "YS", "C:\\WINDOWS\\Waves.bmp");

creates a new button on the linkbot toolbar. The button's appearance consists of a caption ("YS") overlaid on top of an image ("C:\\WINDOWS\\Waves.bmp"). It also displays a tooltip ("Yehuda Tag") when the mouse is over the button. When clicking the button, the script "U:\\Yehuda\\column49\\toolbar.js" is run. Here is the script:

var app = Application;
function Main() {
  app.MessageBox("Hello There", "test", 0);
  app = null;
}

A message box pops up when clicking the button. This is just an example script. It can be as complicated as JavaScript can be. The method returns a true value when successful, a false value otherwise. A false value is returned when the given toolbar is not found. A true value is returned if the button already exists (the button is not duplicated).

AddVTMToolbutton(toolbarName, scriptFile, toolTip, caption, imageFile)Boolean

Adds a VTML button. We don't cover VTML in this column.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Fixing MySQL Replication · Firewall Guide: First Steps to Securing the Enterprise · VoxOx Tames the Tumultuous Communications Tangle


Created: September 27, 1999
Revised: September 27, 1999

URL: http://www.webreference.com/js/column49/toolbars.html