STree STree1 {
X = 18;
Y = 159;
Width = 198;
Height = 257;
}
Button Button1 {
X = 236;
Y = 104;
Width = 165;
Height = 54;
Title = "Appendメソッド利用してSTreeItemを追加";
Function OnTouch( e ) {
/* ルートアイテム初期化 */
var r_item = ^.STree1.RootItem;
r_item.Delete();
var parent = ^.STree1.rootItem;
var xmlDomImpl = new xmlDomImplementation;
var xmlStr = ^.EditBox1.Value;
var xmlDoc = xmlDomImpl.parse(xmlStr);
var item_def = parent.Append(xmlDoc);
}
}
Button Button2 {
X = 413;
Y = 104;
Width = 165;
Height = 54;
Title = "Insertメソッド利用してSTreeItemを追加";
Function OnTouch( e ) {
/* ルートアイテム初期化 */
var r_item = ^.STree1.RootItem;
r_item.Delete();
var item = ^.STree1.rootItem;
var xmlDomImpl = new xmlDomImplementation;
var xmlStr = ^.EditBox1.Value;
var xmlDoc = xmlDomImpl.parse(xmlStr);
item.Insert(xmlDoc);
}
}
EditBox EditBox1 {
X = 232;
Y = 188;
Width = 400;
Height = 229;
Value ="<?xml version=\"1.0\" encoding=\"shift_jis\"?>\r\n" +
"<xml1>\r\n"+
" <item title=\"料理\" openicon=\"1\" closeicon=\"2\">\r\n" +
" <item title=\"和食コース\"/>\r\n"+
" <item title=\"洋食コース\"/>\r\n"+
" </item>\r\n" +
" <item title=\"飲み物\" openicon=\"1\" closeicon=\"2\">\r\n" +
" <item title=\"アルコール\" openicon=\"3\"" +
" closeicon=\"4\">\r\n"+
" <item title=\"ビール\"/>\r\n" +
" <item title=\"日本酒\"/>\r\n" +
" </item>\r\n" +
" <item title=\"ソフトドリンク\" openicon=\"3\"" +
" closeicon=\"4\">\r\n"+
" <item title=\"緑茶\"/>\r\n" +
" <item title=\"オレンジジュース\"/>\r\n" +
" </item>\r\n" +
" </item>\r\n" +
"</xml1>";
}
|