Takanobu Maekawa
Mon, 26 Jun 2006 10:36:24 -0700
Yamada-san, thank you for your easy and consise advice and sample. I can get what you told and my test applet goes well now.
regards.
--maeakwa
> Hi Maekawa-san,
>
> Though my Curl environment is version 3 (not version 4), basic
> strategy to use IME (input method) might be same.
>
> First of all, when a graphical object requires an in-line mode IME,
> the object should be ancestor (child) of InputMethodClient class.
> I,e, in your case, TestView or parent View class should be ancestor of
> InputMethodClient. As Curl built in View is not ancestor of
> InputMethodClient, your own class TestView should be declared as child
> of InputMethodClient such like shown below.
>
> {import * from CURL.GUI.IME}
>
> {define-class public TestView {inherits View, InputMethodClient} ...
>
> also, in constructor, tell Curl that your class TestView is
> responsible for displaying the composition string and visually
> indicating the current composition state. This can be done by
> following setter,
>
> set self.supports-inline-mode? = true
>
> Next, in order to get a Kanji-string from IME, your class TestView has
> to define a set of static handlers like followings,
>
> || Start IME conversion
> {method public open {on-start-composition-event
> e:StartCompositionEvent
> }:void
> {super.on-start-composition-event e}
> || your trap code here
> }
>
> || IME input
> {method public open {on-composition-change-event
> e:CompositionChangeEvent
> }:void
>
> {super.on-composition-change-event e}
>
> {if e.string.size > 0 then
> set self.td.value = e.string
> }
> }
>
> || Finish IME input
> {method public open {on-composition-result-event
> e:CompositionResultEvent
> }:void
> {super.on-composition-result-event e}
> set self.td.value = {format "done (%s)", e.string}
> }
> }
>
> For a complete code (for version 3), see attachment.
>
> Hope this helps to solve your problem.
>
> Best Regards,
> Steven Y.
*******************************************
To unsubscribe from this list, send a mail to:
[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
[EMAIL PROTECTED]