当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: 在web开发中做界面一般都是有美工做的,但是如果要做成类似windows一样的界面,就比较麻烦,前些日子我在网上找到一个免费的js,它类似与一个做控件的工具,有button,menu,toolbar等常用的控件,可以帮助web开发者画界面。
 

 

 ·在托盘图标中添加气球提示    »显示摘要«
    摘要: 很多朋友都见到过能在托盘图标上出现气球提示的软件,不说软件,就是在“磁盘空间不足”时windows给出的提示就属于气球提示,那么怎样在自己的程序中添加这样的气球提示呢? 其实并不难,关键就在添加托盘图标时所使用的notifyicondata结构,源代码如下: 窗体模块: option explicit private declare function shell_notifyicon lib &......
    摘要:象c和c++这样的语言提供了很多手段用于创建和使用一个接受不定数目参数的函数,最典型的例子就是printf()函数: int printf(char *format, …); //省略号表示参数数目不定 使用这个函数十分的简单: printf("hello, world\n"); printf("the sum of %d and %d is %d\n", ......


在web开发中做界面的工具(js)

在web开发中做界面一般都是有美工做的,但是如果要做成类似windows一样的界面,就比较麻烦,前些日子我在网上找到一个免费的js,它类似与一个做控件的工具,有button,menu,toolbar等常用的控件,可以帮助web开发者画界面.它的使用很简单,如加一个按钮,<div class=tbbutton img class=tbicon  src="bgcolor.gif" width=23> </div>,只要指定class就可以了,最后引用这个js就可以了

    【程序编程相关:DES加密算法的一种简单实现

下面的界面是用js做出来: 【推荐阅读:ETW

// copyright 1999 microsoft corporation. all rights reserved. // author: steve isaac, microsoft corporation//// dhtml toolbar package//// this file (along with the companion toolbars.css file) implements full featured// toolbars completely in dhtml.//// see tutorial.htm in the doc directory for full info on how to use this package.//////=================================================================================================// 【扩展信息:Avalon基本概念(3)-Avalon

代码如下:toolbar.js

// public style classes// --------------------// tbtoolbar:    toolbar// tbbutton:     toolbar button// tbicon:       toolbar or menu icon// tbseparator:  toolbar or menu separator// tbmenu:       pulldown menu// tbmenuitem:   menu item// tbsubmenu:    submenu// tbgeneral:    arbitrary html element in a toolbar.// tbcontentelement: identifies an html element as the page body. one and only one //               element on the page must have this class. the element must also have //               its id set to "tbcontentelement".//// public attributes// -----------------// tbtype: special type of element. possible values are://   elements: toggle//             radio//             <not specified> - simple button////   toolbars: nomouseover//             <not specified> - mouseover supported//// tbstate: state of the element. possible values are://   elements: gray (disabled)//             checked//             unchecked//             //   toolbars: dockedtop//             dockedbottom//             hidden//// tbonmenushow: event handler that is called immediately prior to showing a menu or //   submenu. hosts use this to set the state of menu items. this attribute can either//   be set on individual menus and submenus, or on a toolbar in which case it is//   fired for every menu and submenu within that toolbar. the menu that is about//   to be shown is given in tbeventsrcelement (see below).//// public functions// ----------------// tbsetstate(element, newstate)//   sets the state of an element.//     element: element to set. this is an object.//     newstate: state to set. this is a string, same values as tbstate.//// tbrebuildtoolbar(toolbar, rebuildmenus)//   use this routine to change the contents of a toolbar on the fly. make all changes//   (adding, removing and modifying toolbar elements), then call this routine once.//  this routine can also be used to add an entirely new toolbar.//     toolbar: toolbar to rebuild. this is an object.//     rebuildmenus: should the menus in this toolbar also be rebuilt? only set this//       to true if there have been changes; its an expensive operation.//// tbrebuildmenu(menu, rebuildsubmenus)//   use this routine to change the contents of a menu or a submenu on the fly. make all changes//   (adding, removing and modifying menu items), then call this routine once.//     menu: menu to rebuild. this is an object.//     rebuildsubmenus: should the submenus also be rebuilt? only set this//       to true if there have been changes; its expensive.//// public globals// --------------// tbeventsrcelement: contains the element that an event was fired on. the toolbar// package doesn´t support the event object; this object performs a similar function.var tbeventsrcelement;

//// public error return values// --------------------------tb_sts_ok = "ok" // success returntb_e_invalid_class = "invalid class value" // an element has an unrecognized class attribute (probably a misspelling)tb_e_invalid_type = "invalid tbtype value"tb_e_invalid_state = "invalid tbstate value"tb_e_no_id = "element does not have an id"

////=================================================================================================// // private attributes// ------------------// tbtoolbarwidth: width of the toolbar (in px)// tbuseronclick: temporary storage of an element´s original onclick handler//// private constants. these can be used along with toolbar.css to change the look of the toolbar package.// -----------------tb_disabled_opacity_filter = "alpha(opacity=25)"tb_handle_width = 10tb_handle = ´<div class=tbhandlediv style="left: 3"> </div>´ +            ´<div class=tbhandlediv style="left: 6"> </div>´

tb_toolbar_padding = 4tb_separator_padding = 5tb_client_area_gap = 0

//// private globals// ---------------var tbinitialized = false; // set to true when the package has initialized.var tbtoolbars = new array();  // array of all toolbars.var tbcontentelementobject = null; // content element.var tbcontentelementtop = 0;  // y pixel coordinate of the top of the content element.var tbcontentelementbottom = 0; // y pixel coordinate of the bottom of the content element.var tblastheight = 0; // previous client window height (before resize in process).var tblastwidth = 0; // previous client window width. var tbraisedelement = null; // current toolbar button that is being shown raised.var tbonclickinprocess; // executing user´s onclick event.var tbmouseoutwhileinonclick;  // an onmouseout event occurred while executing the user´s onclick event.

//// functions//

// public function for changing an element´s state. function tbsetstate(element, newstate) {

  newstate = newstate.tolowercase();

  switch (element.classname) {    case "tbtoolbar" :      if ((newstate != "dockedtop") && (newstate != "dockedbottom") && (newstate != "hidden")) {        return tb_e_invalid_state;          }      element.tbstate = newstate;      if (newstate == "hidden") {        element.style.visibility = "hidden";      } else {        element.style.visibility = "visible";      }      tblayouttoolbars();      tblayoutbodyelement();          break;        case "tbbutton" :    case "tbbuttondown" :    case "tbbuttonmouseoverup" :    case "tbbuttonmouseoverdown" :    case "tbmenuitem" :      if ((newstate != "gray") && (newstate != "checked") && (newstate != "unchecked")) {        return tb_e_invalid_state;      }              currentstate = element.tbstate;      if (currentstate == "") {        currentstate = "checked";      }            if (newstate == currentstate) {        return;      }


...   下一页
 ·intel hex文件格式    »显示摘要«
    摘要: 本文由athlonxpx86(桃源村)翻译中的内容为译者加入的内容 问题: 什么是intel hex格式? 回答: intel hex文件是记录文本行的ascii文本文件,下面是intel hex文件格式,在intel hex文件中,每一行是一个hex记录由十六进制数组成的机器码或者静态数据,intel hex文件经常被用于将程序或数据传输存储到rom.eprom,大多数编程器和模拟器使用int......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE