對WebUI技術感興趣的說 (轉)
Not(Not pleased by external gains, Not saddened by personnal losses.)
:to:notking@.com">notking@hotmail.com
你想知道的UI可以做到哪種境界?
你想不想試試用指令碼開發Web(就像開發的程式那樣)?
如果你的回答是肯定的,那麼我告訴你一個好東西:Bindows!:namespace prefix = o ns = "urn:schemas--com::office" />
什麼是Bindows:
Bindows™ is a Graphical User Interface Toolkit for writing rich client s web applications with the look, feel and behavior of modern Windows™ applications. Bindows applications are lightweight applications with zero footprint which means no installation required.
To view Bindows™ in action view one of the /bindows/documentation/samples/">samples or try out the .
獲取Bindows:
看看用Bindows開發出來的東西:
http://www.i-see.net/bindows/documentation/samples/
如何使用Bindows?
As is often common, we start of with the classic Hello World example. This example application shows how to create and add a text label.
The application code
var label = new BiLabel("Hello World");
label.setPadding(5);
application.getWindow().add(label);
The first thing we do is to create a new label with the text "Hello World". Then we set the padding to 5 (default is 0). Finally we get the BiApplicationWindow object and adds the label to that.
The Application Description File
All applications in Bindows™ are defined by an XML file. This XML file is often referred to as the Application Description File or ADF for short. The ADF can be seen as the entry point to the application. There is a naming convention for the application class name and the XML file name. If the application class name is HelloWorld then the XML file name must be HelloWorld.xml (or HelloWorld.extension).
Creating the Application Class
Once the file HelloWorld.xml is loaded the static method HelloWorld.main is called. Therefore we create a class with a static method called main. The main method just creates a new instance of the HelloWorld application.
// define constructor
function HelloWorld() {
var label = new BiLabel("Hello World");
label.setPadding(5);
application.getWindow().add(label);
}
// define static main method
HelloWorld.main = function () {
new HelloWorld();
};
Creating the XML
The above script code needs to be located inside a script block in the Application Description File.
The XML above contains two sections, the window element, which describes how large the window should be and the resources element which contains the application code inside a script element.
Launching the Application
We have now defined everything that is needed for a simple application but there is one more thing to do and that is to tell the web browser how to launch the application. This can be done in basically two different ways.
Using the Launcher Script
The easiest way to do this is most likely to use the bilauncher.file provided in the html/js/ directory. This file provides a function called biExec which executes the application. First include the js file:
Then you can call the biExec function like this:
biExec('../../html', 'HelloWorld.xml');
The first argument points to the directory of the Bindows™ toolkit (relative URI) and the second argument is the relative URI to the Application Description File.
To create a link that calls this use the following:
Troubleshooting
The location and the relative paths are important. If you get an error message saying that "Object expected" then make sure that the bilauncher.js file is found from the current page.
If you get an error message saying "File not found" then the path to the ADF is not correct. The path to the ADF is relative to the current page. You can also use an absolute URL for this.
If a new window is opened but saying "The page cannot be displayed" the path to the Bindows system root is incorrect. The path to the Bindows system root is relative to the current page. You can also use an absolute path if you find these more convenient.
The paths given in the examples on this page are set up so that if you the Bindows you'll be able to run the samples given in the samples/helloworld/ directory inside the zfile.
Create a new HTML file
When you are using the launcher described above the browser will navigate to html/bimain.html and then load the ADF. You can also create a new HTML page and start your ADF from that. The main reason to do it this way is that allows you to have an HTML page as the entry point to the application. To do this you can copy the content of bimain.html and modify it accordingly:
<!-- Back Compat -->
The first argument to application.start is the URI to the Bindows™ toolkit root directory and the second is the URI to the ADF.
Troubleshooting
Once again the paths are important. If you get an error saying "appliction is undefined" then the application.js file was not correctly included. Make sure that the path from the current page to the application.js file is correct. The path to the js file is relative to the HTML file. You can also use an absolute path if you find these more convenient.
If you get several errors saying "Error loading file" and then the file names make sure that the first argument to application.start is the relative path to the Bindows system directory. You can also use an absolute path if you find these more convenient.
If you get an error saying "Error loading ADF" then the ADF XML file could not be found using the path relative the current page. Make sure that the path to the XML is correct (giving the location of the current page, or use an absolute URL).
如果你也和我一樣對此激動不已,那我再告訴你一個網址:,愛好技術的朋友別告訴我你不知道它!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752019/viewspace-962360/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Bazaarvoice:一半的消費者對增強購物體驗的技術感興趣
- 大家對 Laravel 的原始碼和架構感興趣麼?Laravel原始碼架構
- 其他感興趣的程式碼庫
- 邦芒簡歷:HR對哪些工作經驗感興趣?
- matlab感興趣區域處理Matlab
- 邦芒簡歷:據說,HR感興趣的簡歷都長這樣……
- 聽說大家很感興趣瑋子的學習心得,採訪來了
- Interpret:56%的NFT和加密遊戲玩家對賺取NFT感興趣加密遊戲
- 得物技術多興趣召回模型實踐模型
- Wirecard:近七成消費者對自助結賬感興趣
- Common Sense Media:70%美國兒童對體驗VR感興趣VR
- 谷歌:報告指出只有16%的手遊玩家對NFT遊戲感興趣谷歌遊戲
- Bizrate:只有28%的消費者對使用智慧音響購物感興趣
- Ipsos MORI:只有15%的歐洲玩家對Google Stadia或Project xCloud感興趣GoProjectCloud
- GDC:近30%的遊戲工作室對NFT和加密貨幣感興趣遊戲加密
- Ocean Outdoor:一半年輕人對戶外廣告直播內容感興趣
- 一旦感興趣,早晚都要入坑的Linux系統!Linux
- SellCell:2021年僅18.3%的Android使用者對轉用iPhone有興趣AndroidiPhone
- 2022年全球主要國家對世界盃非常感興趣程度(附原資料表)
- YouGov:調查稱美國近半消費者對摺疊屏手機感興趣Go
- 抖音興趣電商,豈止於興趣
- 推薦5款小眾軟體,感興趣自行下載
- 牛牛的最大興趣組
- Xbox未來還會收購遊戲工作室,對亞洲地區非常感興趣遊戲
- 為你的舊智慧手機再續命10年,你感興趣嗎?
- 2020後浪生存圖鑑:00後對遊戲最感興趣,近7成在下沉市場 遊戲
- 比起VR高階裝置市場,三星或對移動VR平臺更感興趣VR
- 您是否對大資料感興趣?對程式語言了不瞭解?這不零基礎可以學了大資料
- 2022年全球對北京冬季奧運會最感興趣國家TOP10(附原資料表)
- 哈薩克居民對加密貨幣興趣猛增15倍加密
- 2022年全球對北京冬奧會雪橇專案最感興趣國家TOP10(附原資料表)
- 如何提升員工對六西格瑪綠帶培訓的興趣?
- Piper Sandler:調查顯示50%的青少年對元宇宙不感興趣元宇宙
- 技術的極簡主義的再次復興
- Strategy Analytics:消費者對汽車高科技不感興趣
- 葡萄酒市場委員會:調查顯示40%消費者對葡萄和葡萄酒釀造感興趣
- 2022年全球對北京冬奧會短道速滑專案最感興趣國家TOP10(附原資料表)
- 2022年全球對北京冬奧會高山滑雪專案最感興趣國家TOP10(附原資料表)
- 2022年全球對北京冬奧會雪車專案最感興趣國家TOP10(附原資料表)