Your SlideShare is downloading. ×
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
download - Windows 7 and Vista Sidebar Gadgets
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

download - Windows 7 and Vista Sidebar Gadgets

5,402

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
5,402
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
28
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Creating Vista® Gadgets: Using HTML, CSS and JavaScript Associate Publisher Greg Wiegand with Examples in RSS, AJAX, ActiveX (COM) and Silverlight™ Copyright © 2008 by Sams Publishing All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, Acquisitions Editor or transmitted by any means, electronic, mechanical, photocopying, recording, or other- Loretta Yates wise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has Development Editor been taken in the preparation of this book, the publisher and author assume no responsi- bility for errors or omissions. Nor is any liability assumed for damages resulting from the Todd Brakke use of the information contained herein. This material may be distributed only subject to the terms and conditions set forth in Managing Editor the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). Patrick Kanouse ISBN-13: 978-0-672-32968-5 ISBN-10: 0-672-32968-9 Project Editor Library of Congress Cataloging-in-Publication Data Jennifer Gallant Lal, Rajesh. Creating Vista gadgets : using html, css and javascript with examples Copy Editor in rss, ajax, activex (com) and silverlight / Rajesh Lal. Margo Catts p. cm. ISBN 978-0-672-32968-5 (pbk.) Indexer 1. Microsoft Windows (Computer file) 2. Operating systems (Computers) 3. User interfaces (Computer systems) I. Title. Ken Johnson QA76.76.O63L3546 2008 005.4'46--dc22 Proofreader 2008016280 Printed in the United States of America Mike Henry First Printing April 2008 Technical Editor Trademarks Marc Clifton All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity Publishing Coordinator of any trademark or service mark. Cindy Teeters Warning and Disclaimer Book Designer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an “as is” basis. Anne Jones The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book. Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact U.S. Corporate and Government Sales 1-800-382-3419 corpsales@pearsontechgroup.com For sales outside of the U.S., please contact International Sales international@pearson.com This Book Is Safari Enabled The Safari® Enabled icon on the cover of your favorite technology book means the book is available through Safari Bookshelf. When you buy this book, you get free access to the online edition for 45 days. Safari Bookshelf is an electronic reference library that lets you easily search thousands of technical books, find code samples, download chapters, and access technical information whenever and wherever you need it. To gain 45-day Safari Enabled access to this book: • Go to http://www.informit.com/onlineedition • Complete the brief registration form • Enter the coupon code UWC5-ZPGE-RMIN-P5EG-MSHE If you have difficulty registering on Safari Bookshelf or accessing the online edition, please email customer-service@safaribooksonline.com.
  • 2. W ith the broadest ever worldwide release of a PC operat- ing system, in 2007 Windows Vista opened the door to an Introduction era of gadget development. Gadgets, which reside on the Windows Vista Sidebar, are small, lightweight, and can be very useful applications. The Sidebar is a brand new plat- form for innovation and it gives users a unique way to interact with information. This book is for people who want to create feature-rich and professional-looking Vista Sidebar gadgets. It’s a guide for designers, developers, and anyone else who has a basic knowledge of HTML, CSS, and JavaScript and wants to leverage this new and innovative platform. It’s for anyone who wants to create a gadget for his company, or for a programmer with a great idea to implement on a Sidebar gadget platform, or even for a hobbyist programmer, who wants to try his hand on a gadget platform. This book is intended to give you ideas for what you can do with this new platform and how you can do it. What’s in the Book This book starts with a brief background on gadgets, and then gives a broad and clear view of the architecture of gadget development. Gadget design considerations are an important part of this book and they go side by side with almost all the chapters that deal with gadget development. Once you’ve read up on the concept and scope of gadget development, the book helps you create a gadget called MyBlog. During this process the text elaborates on the architecture, design constraints, and implementation details for the gadget and then details some standard prac- tices applicable to all gadget development. The last section deals with more advanced gadget examples that utilize .NET, XML, XHTML, CSS, Ajax, and Microsoft Silverlight. This book is divided into three broad sections. Section 1: The Foundation The four chapters in this first section give a thorough back- ground of Sidebar gadgets. The section explains the types of gadgets, the architecture, and the technology behind the
  • 3. 2 Create Killer Vista Sidebar Gadgets Using HTML, CSS, and Ajax gadget development. The “Approach to Design” chapter helps you know the difference between a merely good-looking gadget and a one that is professional, rich, and worth the space it takes up on the user’s desktop. The last chapter discusses the revenue model of the gadget: what you need to know to sell your gadgets. Section 2: Developing a Gadget This section walks you through the standard development process of a gadget. It details the creation of the basic MyBlog Gadget, which makes use of an RSS/Atom feed. It also goes through best practices with the user interface, design guidelines, and common assumptions. The later chapters improve on the basic gadget based on standard practices and also deal with deploying and distributing a gadget. Section 3: Advanced Samples The section deals with advanced samples. You will be able to create advanced gadgets such as a Site Statistics Gadget, a Radio Gadget, and a YouTube Video Gadget. All the samples follow standard patterns, making it easier to switch between the features and functionality you want, when you want. You will also learn how to use ActiveX COM for creating a utility gadget with a sample .Net Most Recent Used (MRU) Gadget. The final chapter shows you how to create a gadget with Microsoft Silverlight. You will also see how, in just a few minutes, to create a Sidebar gadget with Microsoft Popfly. If you are a relatively new gadget developer, I would suggest you to start with the first section. If you have basic background knowledge of gadgets and you just want to start with the step-by-step practical approach to gadget development, you can directly start with the second section, “Developing a Gadget.” The third section, “Advanced Samples,” is for people who have developed a gadget and want to go beyond the basics of gadget development. Each chapter in the third section is actually an advanced sample dealing with a particular type of gadget in a scenario of its own. Special Features and Notations This book is meant to be a definite, precise, and concrete guide for gadget development. By pruning redundant information and filtering and highlighting the information that is more crucial, we have tried to make it as comprehensive as possible. This book includes various features and conventions that help you get the most out of the book. HTML, CSS, and JavaScript code blocks will be shown as follows: <HTML> Code in HTML, CSS, and JavaScript </HTML> Sample single code lines will look like this: Statement one; Statement two;
  • 4. Introduction 3 Other comments will also show up in the code with two backslashes // Comment one // Comment two The book also uses the following boxes for important information: NOTE A Note includes extra information to broaden your understanding of a topic. TIP A Tip provides alternative, shortcuts, or insider information of the topic being discussed. CAUTION A Caution warns you of potential traps and pitfalls. Supporting Website The book has a supporting website where you can download all the codes and gadgets. The website also has blogs I have written on Sidebar gadgets and some of my personal views on gadget development. You are invited to check that site and contact me person- ally. You will also find errata and most updated information there. Visit www.innovatewithgadgets.com
  • 5. Index A About screen (Settings page, Recent Project Gadgets), 222 accessibility techniques enter key as mouse clicks, 135-137 Flyouts, 137-138 HTML, 73 keyboard access, 72-73 putting focus on gadgets after loading, 135 Settings pages, 137-138 tab controls, adding, 135 theme colors, 73 accessing information (gadget design), 51 Active Desktop feature (Windows XP), 9 ActiveX COM, 38, 214 initializing inside gadgets, 215 Windows Registry, reading settings via, 229-234 ad gadgets benefits of, 82 case study, 81 Added Features check box (Settings page), Site Statistics gadgets, 199 AddFeed function, feed gadgets, 147-148 AddItem function, feed gadgets, 146 addShadow() method, 46, 304-306 Adobe AIR widgets, 25 aesthetics, user interface design, 53
  • 6. 322 Ajax Ajax Internet connections, 131 buildMyContent function, Site Statistics memory, 133-134 gadgets, 205-210 session management, 133-134 getData function, 200 Atom feed gadgets, 91 getHTMLAjax function, 200-201 data storage, 92 getTextAjax function, 190, 200-203 feed example, 103 parseData function, 190, 203-204 audio (streaming), playing on Radio parseHTML function, 200 Gadget, 240 parseHTMLAjax function, 201-202 automatic updates, 289 ShowFlyout function, 204-205 checking for, 290 Site Statistics gadget user notifications, 292-293 API, 188-190 version checks via inserted code, 291-292 displaying portions of web pages in, version information, posting online, 290-291 190-194 AveDesk widgets, 25 XMLHTTPRequest object, 188, 192 alpha transparencies, gadget design, 71 Always On Top property, 17 animation, Silverlight World Clock Gadget, B 273-274 background images API (Application Programming Interfaces) as wallpaper, 34 Site Statistics gadgets, 187 gadget design, 68-69 data retrieval, 200-204 background.png files, 35 graphs, 204-210 behaviors (gadget design) parsing data, 190 configuring gadgets, 60-61 pie charts, 204-210 displaying gadget statuses, 61-62 pulling text data, 188-189 error messages, 61-62 Windows Registry, MRU Project Gadgets, 230-231 refreshing gadgets, 61 Apollo widgets. See Adobe AIR widgets Service Not Available information, 62-63 Apple, Dashboard widgets, 23 warnings, 61-62 application gadgets, 13, 58 blogs. See MyBlog gadget Assert function, debugging gadgets, 164 body on load functions, feed gadgets, 104 assumptions BuildContent function, 124-125 feed gadgets BuildMyBlog function, feed gadgets, 111 caching data, 133 buildMyContent function, Site Statistics gadgets, 205-210 updates, 132 BuildVideoObject function, YouTube Video functionality, JavaScript errors, 130-131 Gadgets, 251
  • 7. configuration functions 323 buttons themes, 268-269 gadget design, 69 usability, 270 icons associated with button types, 163 developing type values list, 163 animation, 273-274 buttons parameter (MsgBox function), 165 existing framework integration, 271-272 handleLoad function, 277 logic, 275-280 mouse click events, 279-280 C multiple locales, 278-279 CAB files SetClock function, 277-278 creating, 175 setting time, 276-277 deploying gadgets via, 174 SilverlightClock.XAML files, 272-273 buying certificates, 176 features of, 264-265 signing via certificates, 178 JavaScript, 265-266 Windows Installer, 180 XAML, 267-268, 272-276 caching feed gadget data, 133 code security, JavaScript, 313 case studies collection objects, MRU Project Gadgets, ad gadgets, 81 231 free information gadgets, 86 color (themes), accessibility techniques, 73 gadget design information, 51-53 Comic-Strip gadget, 319 gadgets as side products, 83 common assumptions pull models (gadget revenue models), 77 feed gadgets push models (gadget revenue models), 79 caching data, 133 utility gadgets, 85 updates, 132 CDF (Channel Definition Format), 10 functionality, JavaScript errors, 130-131 ChangeFeed() function, feed gadgets, Internet connections, 131 144-146 memory, 133-134 checkForUpdate() function, 291 session management, 133-134 click events (mouse), Silverlight World common images, display/presentation Clock Gadget, 279-280 (design patterns), 128 Clock Gadget for Time, 14 communities (online), gadgets, 21 Clock Gadgets, 261 comparing gadgets, 26 designing Comparison Gadgets (Websites), 280 images, 268-269 configuration functions, 122 layouts, 269-270 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 8. 324 configuring configuring DOM, 166-167 gadget behaviors, 60-61 JavaScript, 161, 166-167 gadget window, feed gadgets, 156-157 Systems Debugger Select window, 169 Settings page, feed gadgets, 155 VBScript, 164-166, 169 controls, gadget design, 69 WScript, 161-163 converting gadgets, 20 deploying gadgets Counter Widget feature (Sitemeter.com CAB files, 174 website), Site Statistic gadget develop- buying certificates, 176 ment, 184 signing via certificates, 178 country codes (localization), 302 Windows Installer, 180 CPU Meter Gadget, 14 comparison chart, 180 CSS (Cascading Style Sheets), 32 installation process, 172 display presentation (design patterns), 129-130 installation target folders, 171 feed gadgets, data presentation in, 108 packaging, 172-173 flyout.css files, 33 design gadget.css files, 33 accessibility settings.css files, 33 adding tab controls, 135 undocked.css files, 33 enter key as mouse clicks, 135-137 Currency gadget, 64, 68 Flyouts, 137-138 customizable design patterns, 116 HTML, 73 customizing keyboard access, 72-73 gadgets, 18 putting focus on gadgets after loading, 135 Windows Sidebar, 8 Settings pages, 137-138 theme colors, 73 behaviors D configuring gadgets, 60-61 displaying gadget statuses, 61-62 Dashboard widgets (Apple), 23 error messages, 61-62 data applications, gadget development, 9 refreshing gadgets, 61 data storage, feed gadgets, 92 Service Not Available information, 62-63 debugger statements, 169 warnings, 61-62 debugging gadgets, 160 customizable patterns, 116 debugger statements, 169 directory structures, 118-119 Disable Script Debugging option (Internet Explorer), 168
  • 9. Disable Script Debugging option 325 display/presentation, 127 user interfaces common images, 128 aesthetics, 53 standard images, 128 docked page dimensions, 64 Stylesheets, 129-130 flyout page dimensions, 65 extensible patterns, 117 guidelines for, 66 file structures, 119 relevant information, 54 image grouping, 118 settings page dimensions, 65 information, 50 simplicity, 53 case study, 51-53 standard page dimensions, 64 easy access of, 51() undocked page dimensions, 65 live data, 51 unobtrusiveness of, 56 relevant to individual users, 51 visuals, 55 showing enough for further action, 51 visual themes showing only revelant information, 54 background images, 68-69 localization, 118 buttons, 69 maintainable patterns, 116 controls, 69 modular file structures, 118 drag images, 68 PNG files, 71-72 icons, 67 quality, ensuring, 50 titles, 67 reusable functionality, 120 Desktop (Google), 23 flyout window, 124-125 desktop gadgets gadget window, 122-124 Adobe AIR widgets, 25 Settings page functions, 125-126 AveDesk widgets, 25 screen space, justifying, 49 Dashboard widgets (Apple), 23 standard file/folder layouts, 118-120 Desktop (Google), 23 styles, 70 DesktopX widgets, 24 text, 70 KlipFolio widgets, 25 transparent images, 71 Konfabulator (Yahoo widgets), 22 usage patterns Opera widgets, 26 application gadgets, 58 Samurize widgets, 24 fun gadgets, 59 DesktopX widgets, 24 information gadgets, 57 directories utility gadgets, 58-59 feed gadget structures, 95 what gadgets aren’t meant for, 60 structures of, 118-119 Disable Script Debugging option (Internet Explorer), 168 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 10. 326 display/presentation display/presentation (design patterns), 127 event.closeAction property, 123 images, 128 extensible design patterns, 117 Stylesheets, 129-130 displaying HMTL in flyouts, 193-194 features, adding to gadgets, 140 web pages, Site Statistics gadgets, feed gadgets, 91-92, 139 190-194 adding features to, 140 docked gadgets advanced framework of, 141 feed gadgets, 154-155 caching data, 133 page dimensions, 64 commonly used fields list, 99-100 YouTube Video Gadget, 258-259 core functionality, 104-107 Docked Views, 16 data presentation, 107 DOM (Document Object Model) CSS, 108 debugging gadgets, 166-167 DOM, 109-111 feed gadgets, data presentation in, 109-111 data section, 103 Site Statistic gadgets data storage, 92 displaying portions of web pages in, deploying, 114 190-194 framework of, 98 parsing data, 190 directory structure, 95 DOM Level 1 (Document Object Model Level 1), 36 image files, 96 drag images, gadget design, 68 required files, 94-96 dragicon.png files, 30, 34-35 Gadget.xml manifest files, 98-99 JavaScript functions in, 112-113 Main Gadget window, 104-107 Mini Me option, 154 E-F gadget window configuration, 156-157 easy access of information (gadget Settings page configuration, 155 design), 51 mouse hover functionality, 152-154 effects, 302. See also graphic design multiple feeds, 142-148 enter key as mouse clicks (accessibility multiple pages, managing, 150-152 techniques), 135-137 removing feeds from, 148-149 enterprise-level applications, gadgets in, Settings page, 100-101 313 unobtrusive traversing, 152-154 Enumerate Registry, MRU Project Gadgets, 231-232 updates to, 132 error messages, gadget behaviors, 61-62 updating feeds, 148-150 event.Action.commit property, 123 zip files, 113-114
  • 11. Gadget Setup function 327 feed tracking, 294 G FeedBurner feed tracking tool, 294 feedchanged function, feed gadgets, 102 Gadget Object Model, 35, 38-39 feedchanged variable, 123 gadget development, 9 FeedURL, feed gadgets, 101 Sidebar Events API, 41 File System API System.Contact API, 45 System.Environment, 43 System.debug API, 45 System.Network, 43 System.Diagnostic.EventLog API, 45 System.Shell, 42-43 System.Environment API, 43-44 files System.Gadget API, 40 standard gadget layouts, 118-120 System.Gadget.Settings API, 40-42 structures of, 119 System.Machine API, 44 Flash Media Player, embedding in YouTube System.MessageStore API, 45 Video Gadgets, 250-251 System.Network API, 43 floating state, feed gadgets, 154-155 System.Shell API, 42-43 Floating Views, 16 Gadget Picker window, 30 flyout page dimensions (user interface gadget revenue models, 75 design), 65 ad gadgets flyout windows, 18, 124-125, 130 benefits of, 82 flyout-related functions, 124 case study, 81 Flyout.css, 129 free information gadgets, 85 flyout.css files, 33 benefits of, 87 flyout.html files, 30, 32 case study, 86 flyouts gadgets as side products, 82 accessibility techniques, 137-138 benefits of, 84 displaying HTML in, 193-194 case study, 83 folders, standard gadget layouts, 118-120 pull models, 76 free information gadgets, 85 ad gadgets, 81 benefits of, 87 benefits of, 85 case study, 86 case study, 77 fun gadgets, 14-15, 59 utility gadgets, 84-85 functionality push models, 78 JavaScript errors, 130-131 case study, 79 resuable functionality, 120 gadgets as side products, 82-84 flyout window, 124-125 utility gadgets, 84-85 gadget window, 122-124 Gadget Setup function, 122 Settings page functions, 125-126 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 12. 328 gadget window gadget window, 129 utility gadgets, 14 configuration functions, 122 web resources, online community website, feed gadgets, configuring for Mini Me gad- 21 gets, 156-157 GadgetUndocked.css, 129 flyout-related functions, 124 gBackground method, 45 gadget specific functions, 124 getData function, 200 settings-related functions, 123 getElementById function, feed gadgets, 109 standard functions in, 122 GetFeed() function, 105, 124, 132 YouTube Video Gadget, 259-260 getHTMLAjax function, 200-201 Gadget.css, 129 getTextAjax function, 190, 200-203 gadget.css files, 33 GIF (Graphics Interchange Format) files, gadget.xml files, 30-32 71-72 Gadget.xml manifest files, MyBlog gadget, gImage method, 45 98-99 gimage protocol, 304 gadgets globalization application gadgets, 13 internationalization, 299 classifying, 12 localization, 299 comparison chart, 26 country codes, 302 competing versions of, 22 gadget example, 300-302 converting, 20 globalUpdateGadgetXML variable, 291 core functionality of, 34 globalUpdateURL variable, 291 customizing, 18 Google Desktop, 23 defining, 7 graphic design, 302 development of, 8-9 gimage protocol, 304 development platforms, 21 GraphicDemo.gadget, 304-306 fun gadgets, 14-15 g:background protocol, 303-306 history of, 9-10 g:image protocol, 303 information gadgets, 12 g:text protocol, 303 limitations of, 15-16 shadow effects, 309-311 malware, 37 transparent PNG files, 307 meeting points between different gadgets, GraphicDemo.gadget, 304-306 20 graphs, Site Statistics gadgets, 204-210 multiple versions of, 8, 22 g:background protocol, 303 purposes of, 7 GraphicDemo.gadget, 304-306 spyware, 37 removeElements method, 306 support for, 87-88 removeObjects method, 306
  • 13. images 329 g:image protocol, 303 Sidebar gadgets, 37 g:text protocol, 303 web pages applications versus, 37 displaying in Site Statistics gadgets, 192 H handleLoad function, Silverlight World Clock Gadget, 277 I Hello World XAML files, Silvelight World icon.png files, 30, 34-35 Clock Gadget, 268 icons HideArrows function, feed gadgets, 153 gadget design, 67 HideFlyout function, 124 user interface design, 55 hosting web gadgets, 19 images. See also graphic design hover functionality (mouse), feed gadgets, 152-154 addShadow method, 46 href properties, changing onclick events to, background images 136 as wallpaper, 34 HTML (Hypertext Markup Language) gadget design, 68-69 accessibility techniques, 73 background.png files, 35 applications versus web pages, 37 display/presentation (design patterns), 128 extracting for display in flyouts, 193-194 drag images, gadget design, 68 feed gadget files, 94-95 dragicon.png files, 30, 34-35 flyout.html files, 30-32 feed gadgets, 96 getHTMLAjax function, 200-201 gBackground method, 45 main.html files, 30, 32 GIF files, gadget design, 71-72 MSHTML (Microsoft HTML) component, gImage method, 45 36-37 grouping, gadget design patterns, 118 parseHTML function, 200 icon.png files, 30, 34-35 parseHTMLAjax function, Site Statistics info.gif files, 35 gadgets, 201-202 loading.gif files, 35 reading, XHR (XMLHttpRequest) object, 295, 297 logo.png files, 30, 34-35 retrieving via XMLHTTPRequest objects, MRU Project Gadgets, 220 192 PNG files, gadget design, 71 Settings page, feed gadgets, 100-101 Silverlight World Clock Gadget, 268-269 settings.html files, 30-32 Site Statistic gadgets, 195-196 transparent images, gadget design, 71 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 14. 330 images user interface design, 55 J-K-L wallpaper, 34 info.gif files, 35 JavaScript, 34 information gadgets, 57 ActiveX COM objects, initializing inside gadgets, 215 Site Statistics gadget debugging gadgets, 161, 166-167 Added Features check box, 199 errors, gadgets API, 187-190, 204-210 design, 62 Counter Widget feature (Sitemeter.com website), 184 functionality, 130-131 data retrieval, 200-204 feed gadgets, functions in, 112-113 design considerations, 195-197 JSON, 105 developing, 198-204 main.Js files, 30 displaying portions of web pages in, Settings page, feed gadgets, 101 190-194 Silverlight World Clock Gadget creation, goals of, 183 265-266 images, 195-196 Site Statistic gadgets, parsing data, 190 integration into existing frameworks, 199 Sitemeter.com website, Count Widget fea- ture, 184 layouts, 196-197 JavaScript Compression, 313 Mini Me version, 199 JavaScript Obfuscator, 313 site summary pages (Sitemeter.com website), 185 JSON (JavaScript Object Notation), 105, 295-297 themes, 195-196 usability, 197 Weather Gadget, 12 keyboards, accessibility techniques, 72-73 Initialize function, 124 KlipFolio widgets, 25 Innovate.Gadget project template (reusable frameworks), 315 Konfabulator (Yahoo widgets), 22 Installer (Windows), deploying gadgets via CAB files, 180 installing gadgets for deployment, 172 Layer style (Photoshop), 309 internationlization, 299 layouts Internet files/folders, 118-120 connections, common assumptions of, 131 Radio Gadgets, 241 radio stations, 238-239 Silverlight World Clock Gadget, 269-270 Internet Explorer, Disable Script Debugging Site Statistic gadgets, 196-197 option, 168 YouTube Video Gadget, 252-253 live data, gadget design, 51
  • 15. Microsoft Silverlight World Clock Gadget 331 Live Gadgets, 19 embedding Flash Media Player in, LoadFeed function, feed gadgets, 146 250-251 loading gadgets, putting focus on (accessi- video feeds, 249-250 bility techniques), 135 media player functionality, Radio Gadgets, loading.gif files, 35 243-244 LoadSettings function, 101, 125 PlayRadio function, 247 LoadXML function, 133 state changes in, 245-247 localization, 299 memory, common assumptions, 133-134 country codes, 302 Message function, debugging gadgets, 164 gadget design patterns, 118 MessageDialog function, debugging gad- gets, 164 gadget example, 300-302 MessageJS function, debugging gadgets, logic, Silverlight World Clock Gadget, 162 275-280 Microsoft Feed Manager, reading online logo.png files, 30, 34-35 data via, 298-299 Microsoft Outlook Gadget, 13 Microsoft Popfly, creating via Sidebar gad- gets M mashup gadgets, 281-283 Main Gadget window, feed gadgets, 104-107 Website Comparison Gadgets, 280 main.html files, 30-32 Microsoft Silverlight applications main.Js files, 30 features of, 262 maintainable design patterns, 116 origin of, 263 malware, gadgets as, 37 running, 262 mashup gadgets, creating, 281-283 Sidebar implementation, 264 media gadgets Microsoft Silverlight World Clock Gadget, 261, 266 Radio Gadget designing designing, 240-242 images, 268-269 developing, 243-248 layouts, 269-270 features of, 239-240 themes, 268-269 Internet radio stations, 238-239 usability, 270 requirements for, 239 developing, 271 Windows Media Player, 244-245 animation, 273-274 YouTube Video Gadget existing framework integration, 271-272 BuildVideoObject function, 251 handleLoad function, 277 designing, 251-253 logic, 275-280 developing, 255-260 mouse click events, 279-280 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 16. 332 Microsoft Silverlight World Clock Gadget multiple locales, 278-279 goals of, 212 SetClock function, 277-278 images of, 220 setting time, 276-277 layout of, 220 SilverlightClock.XAML files, 272-273 themes of, 219 features of, 264-265 usability of, 221 JavaScript, 265-266 Windows Power Shell, 216 XAML, 267-268, 272-276 WMI, 216-218, 226-229 Minesweeper Gadget, 59 MsgBox function Mini Me option, feed gadgets, 154 buttons parameter, 165 gadget window configuration, 156-157 debugging gadgets, 166 Settings page configuration, 155 prompt parameter, 165 Mini Me versions, Site Statistics gadgets, return values of, 166 199 title parameter, 166 mini web applications, gadget develop- MSHTML (Microsoft HTML) component, ment, 9 36-37 modular file structures, 118 Multiple Views, 16 mouse MyBlog Gadget, 92, 139 click events adding features to, 140 enter key as (accessibility techniques), advanced framework of, 141 135-137 commonly used fields list, 99-100 Silverlight World Clock Gadget, 279-280 core functionality, 104-107 hover functionality, feed gadgets, 152-154 data presentation, 107 MRU (Most Recent Used) lists, 13 CSS, 108 MRU (Most Recent Used) Project Gadgets, 211 DOM, 109-111 ActiveX COM, 214-215 data section, 103 initializing inside gadgets, 215 deploying, 114 reading Windows Registry settings, framework of, 98 229-234 directory structure, 95 developing image files, 96 collection objects, 231 required files, 94-96 Enumerate Registry, 231-232 Gadget.xml manifest files, 98-99 framework integration, 222-225 JavaScript functions in, 112-113 listing Windows Registry items, 225-229 Main Gadget window, 104-107 reading Windows Registry, 229-235 Mini Me option, 154 RegRead function, 232-233 gadget window configuration, 156-157 Windows Registry API, 230-231 Settings page configuration, 155
  • 17. parseRSS function 333 mouse hover functionality, 152-154 O multiple feeds, 142-148 multiple pages, managing, 150-152 On Load function, 122 removing feeds from, 148-149 onclick events, changing to href properties, 136 Settings page, 100-101 OnDock function, 122 unobtrusive traversing, 152-154 onfocus events, 137 updating feeds, 148-150 onfocusout events, 137 zip files, 113-114 onkeydown events, 136 onkeypress events, 136 onkeyup events, 136 N online data, reading Microsoft Feed Manager, 298-299 NET MRU Project Gadgets, 211 Windows RSS platform, 298-299 ActiveX COM, 214-215 XHR (XMLHttpRequest) object, 295-297 initializing inside gadgets, 215 XML DOM, 297-298 reading Windows Registry settings, 229-234 online gadget communities, 21 developing OnMouseHover function, feed gadgets, 152 collection objects, 231 OnUndock function, 122 Enumerate Registry, 231-232 Opacity property, 17 framework integration, 222-225 Opera widgets, 26 listing Windows Registry items, 225-229 Outlook Gadget (Microsoft), 13 reading Windows Registry, 234-235 reading Windows Registry settings, 229-234 RegRead function, 232-233 P Windows Registry API, 230-231 packaging gadgets for deployment, 172 goals of, 212 parseData function, 190, 203-204 images of, 220 ParseFeed function, 124 layout of, 220 debugging gadgets, 162 themes of, 219 feed gadgets, 150-151 usability of, 221 parseHTML function, 200 Windows Power Shell, 216 parseHTMLAjax function, Site Statistics WMI, 216-218, 226-229 gadgets, 201-202 notifications, gadget updates, 292-293 parseRSS function, feed gadgets, 109 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 18. 334 Photoshop Photoshop Q-R Layer style, 309 shadow effects, 309-311 Question function, debugging gadgets, 164 transparent PNG files, 307 Picture Slideshow Gadget, 56 pie charts, Site Statistics gadgets, 204-210 Radio Gadget PlayRadio function, Radio Gadgets, 247 designing PNG (Portable Network Graphic) files layouts, 241 gadget design, 71 themes, 240 transparent files, 307 usability, 242 Popfly, Sidebar gadget creation via developing mashup gadgets, 281-283 existing framework integration, 243 Website Comparison Gadgets, 280 media player functionality, 243-247 popup function volume functions, 247-248 debugging gadgets, 161 features of, 239-240 syntax of, 162-163 Internet radio stations, 238-239 porting mashup gadgets, 283 requirements for, 239 power supply information, detecting, 44 Windows Media Player, advanced optional parameters list, 244-245 PowerStatus method (System.Machine API), 44 reading online data presentation/display (design patterns), 127 Microsoft Feed Manager, 298-299 images, 128 Windows RSS platform, 298-299 Stylesheets, 129-130 XHR (XMLHttpRequest) object, 295-297 prompt parameter (MsgBox function), 165 XML DOM, 297-298 pull models (gadget revenue models), 76 RealPlayer, Internet radio stations, 239 ad gadgets, 81 Recent Documents Gadget, 13 case study, 77 Recent Project Gadgets, 222 utility gadgets, 84-85 Recent ProjectX Gadgets, 221 push models (gadget revenue models), 78 Refresh function, feed gadgets, 146 case study, 79 refreshing gadget behaviors, 61 gadgets as side products, 82 RegRead function, MRU Project Gadgets, 232-233 benefits of, 84 relevant information, gadget design, 51, 54 case study, 83 removeElements method, g:background protocol, 306 RemoveFeed function, feed gadgets, 148-149
  • 19. Settings page 335 removeObjects method, g:background pro- RSS (Really Simple Syndication) feed gad- tocol, 306 gets, 61, 91 removing feeds from feed gadgets, 148-149 data storage, 92 Reset() function, feed gadgets, 144 feed example, 103 Resize() function, 123 RSS Reader gadget, 55, 57 reusable functionality, 120 RSS/Atom, reading, 295, 296-299 flyout window, 124-125 gadget window configuration functions, 122 S flyout-related functions, 124 gadget specific functions, 124 Samurize widgets, 24 settings-related functions, 123 SaveSettings function, 125-126 standard functions in, 122 SaveXML function, 133-134 Settings page, functions of, 125-126 scripting, disabling via Disable Script reusble frameworks, 315 Debugging option (Internet Explorer), 168 revenue models, 75 security, 312 ad gadgets code, 313 benefits of, 82 malware, gadgets as, 37 case study, 81 spyware, gadgets as, 37 free information gadgets, 85 User Account Control, 312 benefits of, 87 Windows Live Gallery, 312 case study, 86 SendPlayStateChangeEvents event, Radio Gadget media player functionality, 245 gadgets as side products, 82 Service Not Available information (gadget benefits of, 84 behaviors), 62-63 case study, 83 session management, common assump- pull models, 76 tions, 133-134 ad gadgets, 81 SetClock function, Silverlight World Clock Gadget, 277-278 benefits of, 85 SetGlobalText function, 301 case study, 77 SetInterval function, feed gadgets, 132 utility gadgets, 84-85 Settings Closed function, 123 push models, 78 Settings page case study, 79 accessibility techniques, 137-138 gadgets as side products, 82-84 dimensions (user interface design), 65 utility gadgets, 84-85 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 20. 336 Settings page feed gadgets, 100-101 Sidebar gadgets, 19-20 adding multiple feeds, 142, 146-148 accessibility techniques configuring for Mini Me gadgets, 155 HTML access, 73 removing feeds from, 148-149 keyboard access, 72-73 updating feeds, 148-150 theme colors, 73 functions of, 125-126 addShadow method, 46 Recent Project Gadgets, 222 as HTML application, 37 Site Statistics gadgets, 199 future of, 46 settings window, 129 gBackground method, 45 settings-related functions, 123 gImage method, 45 settings.css files, 33, 129 Popfly, creating via settings.html files, 30-32 mashup gadgets, 281-283 SettingsClosing function, 126 Website Comparison Gadgets, 280 Setup function, 104, 123 widget boxes, 20 Setup Size function, 122 Silverlight applications shadow effects, creating in Photoshop, features of, 262 309-311 origin of, 263 shadows in images, addShadow method, 46 running, 262 sharing gadgets, 320 Sidebar implementation, 264 ShellOpen function, reading Windows Silverlight World Clock Gadget, 261 Registry, 234-235 designing shortcut keys, sidebar gadget access, 72 images, 268-269 ShowArrows function, feed gadgets, 153 layouts, 269-270 ShowFlyout function, 124 themes, 268-269 feed gadgets, 110 usability, 270 Site Statistics gadgets, 204-205 developing, 271 side products, gadgets as, 82 animation, 273-274 benefits of, 84 existing framework integration, 271-272 case study, 83 handleLoad function, 277 Sidebar (Windows) logic, 275-280 customizing, 8 mouse click events, 279-280 gadgets, functions of, 10-11 multiple locales, 278-279 Silverlight application implementation, 264 SetClock function, 277-278 Sidebar Events API (Gadget Object Model), 41 setting time, 276-277 SilverlightClock.XAML files, 272-273
  • 21. SystemSetup() function 337 features of, 264-265 spyware, gadgets as, 37 JavaScript, 265-266 standard file/folder layouts, 118-120 XAML, 267-268, 272-276 standard images, display/presentation simplicity, user interface design, 53 (design patterns), 128 Site Statistics gadget, 183 standardizing widgets, 47 API, 187 startUpPage function, feed gadgets, 111 graphs based on, 204- 210 statistics parsing data, 190 feed tracking, 294 pie charts based on, 204-210 user tracking, 294 pulling text data, 188-189 statuses, displaying (gadget behaviors), 61-62 designing Stop function, debugging gadgets, 169 images, 195-196 storing data, feed gadgets, 92 layouts, 196-197 streaming audio, playing on Radio Gadget, themes, 195-196 240 usability, 197 styles, gadget design, 70 developing, 198 Stylesheets, display/presentation (design data retrieval, 200-204 patterns), 129-130 integration into existing frameworks, 199 support for gadgets, 87-88 goals of, 183 System Debugger Select window, debug- ging gadgets, 169 Mini Me version, 199 System.Contact API, 45 Sitemeter.com website System.debug API, 45 Counter Widget feature, 184 System.Diagnostic.EventLog API, 45 site summary pages, 185 System.Environment API, 43-44 web pages, displaying portions of, 190-194 System.Gadget API (Gadget Object Model), site summary pages (Sitemeter.com web- 40 site), Site Statistic gadget development, 185 System.Gadget.onSettingsClosed property, 123 Sitemeter.com website, Site Statistics gad- get development System.Gadget.Settings API (Gadget Object Model), 40-42 API, 187-190 System.Machine API, 44 Counter Widget feature, 184 System.MessageStore API, 45 site summary pages, 185 System.Network API, 43 SLQ Server, accessing, 313 System.Shell API, 42-43 Soapbox Video Gadget, gadget design case study, 51-53 SystemSetup() function, 123 sound information, detecting, 44 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 22. 338 tab controls T UpdateFeed function, feed gadgets, 148-150 updates tab controls, accessibility techniques, 135 automatic updates, 289 text. See also graphic design checking for, 290 gadget design, 70 posting version information online, reading, XHR (XMLHttpRequest) object, 290-291 295-297 user notifications, 292-293 TextBoxFeedURL, feed gadgets, 102 version checks via inserted code, themes 291-292 color, 73 feed gadgets, 132 Radio Gadgets, 240 feeds in feed gadgets, 148-150 Silverlight World Clock Gadget, 268-269 URLFeedsCurrentID variable, feed gadgets, 145 Site Statistic gadgets, 195-196 usability, designing for Site Statistic time gadgets, 197 information, detecting, 44 usage patterns (gadget design) Silverlight World Clock Gadget, setting in, application gadgets, 58 276-277 fun gadgets, 59 title parameter (MsgBox function), 166 information gadgets, 57 titles, gadget design, 67 utility gadgets, 58-59 tracking users, 294 User Account Control, security, 312 transparent images, gadget design, 71 user interfaces, designing transparent PNG files, 307 aesthetics, 53 traversing feed gadgets, 152-154 docked page dimensions, 64 Trick-of-Mind gadget, 319 flyout page dimensions, 65 guidelines for, 66 relevant information, 54 U settings page dimensions, 65 simplicity, 53 undocked gadgets standard page dimensions, 64 feed gadgets, 154-155 undocked page dimensions, 65 page dimensions, 65 unobtrusiveness of, 56 YouTube Video Gadget, 258-259 visuals, 55 undocked.css files, 33 user notifications, gadget updates, 292-293 unobtrusive traversing, feed gadgets, 152-154 user tracking, 294 updateAvailable variable, 291
  • 23. visual themes 339 utility gadgets, 58-59, 84 version information, posting online, benefits of, 85 290-291 case study, 85 Video Gadgets, 15, 249 Clock Gadget for Time, 14 BuildVideoObject function, 251 CPU Meter Gadget, 14 designing MRU Project Gadgets, 211 layouts, 252-253 ActiveX COM, 214-215 themes, 251 reading Windows Registry settings, usability, 253 229-234 developing collection objects, 231 docked/undocked functionality, 258-259 Enumerate Registry, 231-232 existing framework integration, 255-256 framework integration, 222-225 gadget windows, 259-260 goals of, 212 Flash Media Player, embedding in, 250-251 images of, 220 video feeds, 249-250 layout of, 220 Visual Studio, MRU Project Gadgets, listing Windows Registry items, 225-229 211-213 reading Windows Registry, 234-235 framework integration, 222-225 reading Windows Registry settings, goals of, 212 229-234 images of, 220 RegRead function, 232-233 layout of, 220 themes of, 219 themes of, 219 usability of, 221 usability of, 221 Windows Power Shell, 216 Windows Registry Windows Registry API, 230-231 listing items, 225-229 WMI, 216-218 reading, 234-235 listing Windows Registry MRU items, reading settings, 229-234 226-229 visual themes (gadget design) background images, 68-69 buttons, 69 V controls, 69 drag images, 68 VBScript, debugging gadgets, 164-166, 169 icons, 67 verisign certificates, buying, 176 titles, 67 version checks via inserted code, 291-292 How can we make this index more useful? Email us at indexes@samspublishing.com
  • 24. 340 visuals visuals (gadget design) Windows Media Player, advanced optional GIF files, 71-72 parameters list, 244-245 PNG files, 71 Windows Power Shell, 216 transparent images, 71 Windows Registry user interface design, 55 accessing volume functions, Radio Gadgets, 247-248 ActiveX COM, 214-215 Windows Power Shell, 216 WMI, 216-218 listing MRU items from, 225-229 W reading W3C (World Wide Web Consortium), widget settings via ActiveX COM, 229-234 standardization, 47 ShellOpen function, 234-235 wallpaper, 34 Visual Studio MRU, viewing, 213 warnings, gadget behaviors, 61-62 Windows Registry API, MRU Project Weather Gadget, 12, 19, 61 Gadgets, 230-231 web gadgets, 19, 22 Windows RSS platform, reading online data via, 298-299 web pages Windows Sidebar displaying, Site Statistics gadgets, 190-194 customizing, 8 HTML pages, applications versus, 37 gadgets, functions of, 10-11 Site Statistics gadgets, data retrieval, 200-204 Windows XP, Active Desktop feature, 9 web resources, sharing gadgets, 320 WMI (Windows Management Instrumentation), 216-218, 226-229 Website Comparison Gadgets, 280 World Clock Gadgets, 261 widget boxes, 20 designing Widget-Box gadget, 317 images, 268-269 widgets, standardizing, 47 layouts, 269-270 Windows Cabinet (CAB) files themes, 268-269 creating, 175 usability, 270 deploying gadgets, 174 developing, 271 buying certificates, 176 animation, 273-274 signing via certificates, 178 existing framework integration, 271-272 Windows Installer, 180 handleLoad function, 277 Windows Installer, deploying gadgets via CAB files, 180 logic, 275-280 Windows Live Gallery, security, 312 mouse click events, 279-280 multiple locales, 278-279 SetClock function, 277-278
  • 25. zip files 341 setting time, 276-277 Y-Z SilverlightClock.XAML files, 272-273 features of, 264-265 Yahoo widgets, Konfabulator, 22 JavaScript, 265-266 YouTube Video Gadget, 249 XAML, 267-268, 272-276 BuildVideoObject function, 251 WPF/E (Windows Presentation designing Foundation/Everywhere). See Silverlight layouts, 252-253 applications, 263 themes, 251 WScript, debugging gadgets, 161-163 usability, 253 developing docked/undocked functionality, 258-259 X existing framework integration, 255-256 gadget windows, 259-260 XAML (eXtensible Application Markup Flash Media Player, embedding in, 250-251 Language) video feeds, 249-250 Hello World files, 268 Silverlight World Clock Gadget, 267-268, 272-276 XHR (XMLHttpRequest) object, reading zip files online data via, 295-297 deploying gadgets, 173 XHTML (Extensible Hypertext Markup feed gadgets, 113-114 Language), reading, 295 XML (Exentensible Markup Language) feed gadget files, 94-95 gadget.xml files, 30-32 Gadget.xml manifest files, MyBlog gadget, 98-99 reading XHR (XMLHttpRequest) object, 295-297 XML DOM, 297-298 XML DOM (Document Object Model), read- ing online data via, 297-298 XMLHTTPRequest object, 105-107, 298 XMLHTTPRequest objects methods of, 188 properties of, 188 pulling text data, 188 retreiving HTML, 192 How can we make this index more useful? Email us at indexes@samspublishing.com

×