以下のプログラムを実行し、生成されたListBoxをダブルクリックすると、
NullDereferenceException例外が発生します。
これはバグでしょうか?それともそういう仕様なのでしょうか?
{curl 7.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}
{value
{ListBox}
}
(01-19-2012, 04:45 PM)alphard Wrote: [ -> ]My result in IE8 is a VBox containing Fill - but no error - running RTE 8
(01-19-2012, 04:45 PM)alphard Wrote: [ -> ]Can you provide more runtime info? Did you try CTRL-Right-Click instead of a simple click? What result should we expect for an empty list box in an empty frame? For example, what do expect would be the size of that empty list box? I get a default for a default empty document
(01-19-2012, 04:45 PM)alphard Wrote: [ -> ]以下のプログラムを実行し、生成されたListBoxをダブルクリックすると、
NullDereferenceException例外が発生します。
これはバグでしょうか?それともそういう仕様なのでしょうか?
{curl 7.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}
{value
{ListBox}
}
これは7.0.xのバグでした。
8.0に直っています。
直っていない7.0の回避策として、try/catchで無視すればいいです。
たとえば:
Code:
{curl 7.0 applet}
{define-class public MySkinnedListBoxFeel {inherits SkinnedListBoxFeel}
{method protected open {handle-listbox-pointer-event e:PointerEvent}:void
{try
{super.handle-listbox-pointer-event e}
catch e:NullDereferenceException do
}
}
}
{value
let lb:ListBox =
{ListBox
height = 0.7in,
"red", "green", "blue"
}
set (lb.ui-object asa SkinnableListBoxUI).control-feel =
{MySkinnedListBoxFeel}
lb
}
This variant:
{VBox
height = 200px,
{text Line 1},
{hrule},
{ListBox},
{hrule},
{text Line 2}
}
also gave no error - CTRL-Right-Click shows {Fill} again for the empty ListBox under IE8
Thank you for the reply. tuntime is as follows.
Curl® RTE
build:7.0.5
support API version: 7.0.5, 5.0.4, 4.0.3, 3.0.8
debug API version: 7.0, 5.0
Windows7(32bit)
IE8.0.7601.17514
----------------------------
{curl 7.0 applet}
{curl-file-attributes character-encoding = "utf8"}
{ListBox}
----------------------------
CTRL-Right-Click -> OK
CTRL-Right-DblClick -> OK
Right-Click -> OK
Right-DblClick -> OK
CTRL-Left-Click -> OK
CTRL-Left-DblClick -> NG (NullDereferenceException)
Left-Click -> OK
Left-DblClick -> NG (NullDereferenceException)
----------------------------
{curl 5.0 applet}
{curl-file-attributes character-encoding = "utf8"}
{ListBox}
----------------------------
CTRL-Right-Click -> OK
CTRL-Right-DblClick -> OK
Right-Click -> OK
Right-DblClick -> OK
CTRL-Left-Click -> OK
CTRL-Left-DblClick -> OK
Left-Click -> OK
Left-DblClick -> OK
Do you think that it is a bug?
Curl Engineer様
ご回答ありがとうございます。
やはりバグでしたか。それがわかっただけで御の字です!
回避のコードまでありがとうございます!助かりました。
すみません。前回解決したと思っていたのですが・・・
概観をCurl Ver5のままにしたい為、{install-standard-look-and-feel}
をつけて実行してみると、「StandartListBoxUIからSkinnableListBoxUIへキャストすることはできません。」というエラーが発生します。
これを回避することはできないのでしょうか?
Code:
{curl 7.0 applet}
{install-standard-look-and-feel} || ←ここを追加
{define-class public MySkinnedListBoxFeel {inherits SkinnedListBoxFeel}
{method protected open {handle-listbox-pointer-event e:PointerEvent}:void
{try
{super.handle-listbox-pointer-event e}
catch e:NullDereferenceException do
}
}
}
{value
let lb:ListBox =
{ListBox
height = 0.7in,
"red", "green", "blue"
}
set (lb.ui-object asa SkinnableListBoxUI).control-feel =
{MySkinnedListBoxFeel}
lb
}
(lb.ui-object asa SkinnableListBoxUI) を書いているが、 {install-standard-look-and-feel} の影響で lb.ui-object は StandardListBoxUI になっているはずです。
「Standard」を使えば、直接設定しない限りにFeelとSkinとかが使えません。
StandardUIならFeelじゃなくて、そのUIクラスを継承すべきです。
StandardListBoxUI には同じ handle-listbox-pointer-event がありますので、必要であればそれを継承すればいいはずです。
ちなみに、 ui-object を直接変えるよりは、 register-ui-proc で登録出来ます。
回答ありがとうございます。難しいですねー。
この回答でロジックわかる人教えてください。
(01-23-2012, 02:59 PM)c-s Wrote: [ -> ](lb.ui-object asa SkinnableListBoxUI) を書いているが、 {install-standard-look-and-feel} の影響で lb.ui-object は StandardListBoxUI になっているはずです。
「Standard」を使えば、直接設定しない限りにFeelとSkinとかが使えません。
StandardUIならFeelじゃなくて、そのUIクラスを継承すべきです。
StandardListBoxUI には同じ handle-listbox-pointer-event がありますので、必要であればそれを継承すればいいはずです。
ちなみに、 ui-object を直接変えるよりは、 register-ui-proc で登録出来ます。
c-sさんが言ってる事はこーゆーことだと思います。
↓
{curl 7.0 applet}
{install-standard-look-and-feel}
{define-class public MyStandardListBoxUI {inherits StandardListBoxUI}
{method protected open {handle-listbox-pointer-event e
ointerEvent}:void
{try
{super.handle-listbox-pointer-event e}
catch e:NullDereferenceException do
}
}
}
{value
let lb:ListBox =
{ListBox
height = 0.7in,
"red", "green", "blue"
}
set lb.ui-object = {MyStandardListBoxUI}
lb
}