Thread Rating:
  • 555 Vote(s) - 2.71 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ListBoxのエラーについて
01-19-2012, 04:45 PM,
#1
Question  ListBoxのエラーについて
以下のプログラムを実行し、生成されたListBoxをダブルクリックすると、
NullDereferenceException例外が発生します。
これはバグでしょうか?それともそういう仕様なのでしょうか?

{curl 7.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}

{value
{ListBox}
}


Attached Files
.png   error.png (Size: 52.59 KB / Downloads: 991)
01-20-2012, 09:05 AM,
#2
RE: 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}
}

Robert Shiplett, Curlr
Fredericton NB

Canada
01-20-2012, 09:36 AM,
#3
RE: 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
}
01-20-2012, 09:37 AM,
#4
RE: ListBoxのエラーについて
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



Robert Shiplett, Curlr
Fredericton NB

Canada
01-20-2012, 09:45 AM,
#5
RE: ListBoxのエラーについて
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?
01-20-2012, 09:51 AM,
#6
RE: ListBoxのエラーについて
Curl Engineer様

ご回答ありがとうございます。
やはりバグでしたか。それがわかっただけで御の字です!
回避のコードまでありがとうございます!助かりました。
01-23-2012, 01:44 PM,
#7
RE: ListBoxのエラーについて
すみません。前回解決したと思っていたのですが・・・
概観を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
}
01-23-2012, 02:59 PM,
#8
RE: ListBoxのエラーについて
(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, 04:16 PM,
#9
RE: ListBoxのエラーについて
回答ありがとうございます。難しいですねー。

この回答でロジックわかる人教えてください。

(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 で登録出来ます。



01-23-2012, 05:17 PM,
#10
RE: ListBoxのエラーについて
c-sさんが言ってる事はこーゆーことだと思います。


{curl 7.0 applet}

{install-standard-look-and-feel}

{define-class public MyStandardListBoxUI {inherits StandardListBoxUI}
{method protected open {handle-listbox-pointer-event eTongueointerEvent}: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
}

Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('394')