API version 1

- ‐

RW

*

value

オブジェクトの値です。

subTypeに指定したデータ型の値を保持します。

このプロパティの値はオブジェクトの動作には影響を与えません。

選択肢の選択状態はselectedプロパティ、選択肢として表示する文字はtitleプロパティで指定できます。



使用例 CRSダウンロード

Form ListItem_use {
   X = 0;
   Y = 0;
   Width = 765;
   Height = 494;

   ListBox ListBox1 {
           x = 78;
           y = 78;
           width = 120;
           height = 63;

           ListItem ListItem1[3] {
                   for (var i = 0; i < 3; i++) {
                           this[i].title = "item[" + str(i) + "]";;
                           this[i].value = i;
                   }
           }
   }

   Button Button1 {
           x = 87;
           y = 10;
           width = 96;
           height = 39;
           Title = "Clear";
           TabIndex = 2;
           Function OnTouch( e ) {
                   try {
                           ^.T.clear();
                   } catch (e) {
                           messageBox("Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode));
                   }
           }
   }
   EditBox T {
           x = 39;
           y = 178;
           width = 558;
           height = 149;
           Border = BORDER_FLATSUNKEN;
           SkipTabFocus = TRUE;

           Number idx = 0;
           Reference tmp_ref;
           Function add(ev) {
                   idx++;
                   var s = "";
                   var ma = _enumProps(ev);
                   var tmp;
                   tmp_ref = ev;
                   for (var n in ma) {
                           if (s.length) {
                                   if (ma[n].name!="from") s += ", ";
                           }

                           var name = ma[n].name;
                           var type = ma[n].type;
                           if (ma[n].name!="from"){
                                   s += ma[n].name;
                           }
                           if(type == "string" || type == "integer" || type == "number" || type == "bool" || type == "date" || type == "fixed"|| type == "" ) {
                                   s += "=" + str(eval("tmp_ref.value." + name + ";"));
                           }
                   }
                   Value = String.format("%1 %2.%3(%4)\n", str(idx), ev.from.name, ev.eventName, s) + Value;

           }
   }
   Function show(ev) {
           T.add(ev);
   }

   Array arrevent;
   Function OnShow(ev) {
           show(arrevent[0]);
   }
   Function PostShowEvent(ev) {
           arrevent[0] = ev;
           PostEvent(new Event("Show"));
   }
   Function OnTouch(ev) {
           show(ev);
   }
   Function OnRClicked(ev) {
           show(ev);
   }
   Function OnDoubleClicked(ev) {
           show(ev);
   }

   ListBox ListBox4 {
           x = 218;
           y = 82;
           Width = 100;
           Height = 60;
           this.SelectionMode = MODE_MULTI;

           ListItem obj1[3] {
                   try {
                           for (var i = 0; i < 3; i++) {
                                   this[i].title = "item[" + str(i) + "]";
                                   this[i].value = i;
                           }
                           this[0].Selected = true;
                           this[1].Selected = true;
                   } catch (e) {
                           ^.messageBox("Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode));
                   }
           }
   }
}