window クラス : Activated(class,string) メソッド
説明
ハンドラを"Activated"イベントに割り当てます。
構文
instance.Activated(class handleInstance, string signature)
引数
| クラス | 名前 | 説明 |
| class | handleInstance | ハンドラをメンバとして持つインスタンス。 |
| string | signature | ハンドラのシグネチャ。 |
返り値
| クラス | 説明 |
| switch | ハンドラの実行を制御するスイッチ。 |
サンプルコード
次のクラス定義があるとします。
| 1: | class handle |
| 2: | open method void AHandler(dictionary dic) |
| 3: | switch sw = dic.Switch; |
| 4: | endmethod |
| 5: | endclass |
ハンドラの割り当ては次のとおりです。
| 1: | window w = new window(); |
| 2: | handle h = new handle(); |
| 3: | switch sw = w.Activated(h,"AHandler(dictionary)"); |
注意
"Activated"イベントはウインドウがアクティブになった時に発生します。
"Activated"イベントのハンドラは、dictionaryクラスの引数を一つ持つopenメソッドでなければなりません。
つまり、ハンドラのメソッド名が "handlerName"の場合、ハンドラの定義は次のようになります。
open method void handlerName(dictionary dic)
...
endmethod
この場合、第2引数で指定されるハンドラのシグネチャは "handlerName(dictionary)"です。
イベント発生時にハンドラに渡される dictionary は以下の key と value のペアを持ちます。
| key | value(クラス) | value(説明) |
| Sender | window | イベントの発生元。 |
| Switch | switch | ハンドラの割り当てで返される switch と同じインスタンス。 |
ハンドラは専用のスレッドで実行されます。
参照リンク
無し。


