To demonstrate Ext's AIR capabilities, founder Jack Slocum went about updating the Simple Tasks application he initially created during the early AIR beta process.
Making extensive use of the newly updated AIR API, the Ext team enhanced the Ext.air package to handle such functionality as:
Managing native windows, event listeners and automatic state management for the windows.
Use of the new synchronous database access introduced in AIR beta 3.
Native drag and drop and clipboard access.
Playing sounds.
Minimizing AIR applications to the system tray.
Adding an icon to the system tray is now a trivial task as can be seen in this code sample:
JAVASCRIPT:
var win = new Ext.air.NativeWindow({
id: 'mainWindow',
instance: window.nativeWindow,
// System tray config
minimizeToTray: true,
trayIcon: 'ext-air/resources/icons/extlogo16.png',
trayTip: 'Simple Tasks',
trayMenu : [{
text: 'Open Simple Tasks',
handler: function(){
win.activate();
}
}, '-', {
text: 'Exit',
handler: function(){
air.NativeApplication.nativeApplication.exit();
}
}
});
In addition to demonstrating AIR apis, Simple Tasks v2 also includes several advanced samples to demonstrate creating custom Ext components. These samples include:
ListTree - Allows for a hierarchical list of options, similar to a treeview, but within a drop-down listbox
Custom Grid Columns - Allows for grid columns to be represented as buttons or menus.
Switch - Provides a collection of buttons, one of which can be “pressed” at a time. This is used as an alternative for radio buttons.
Sumber :http://ajaxian.com/by/topic/ajax/
0 komentar:
Posting Komentar