Subject | Re: [IBO] unable to fix charset and font for TIB_ComboBox |
---|---|
Author | Michael Fung |
Post date | 2004-08-19T04:16:01Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
The style property is set to csDropDownList. It works except the
chinese text is not displayed correctly, the data returned to the
database is correct. And of course all required fonts and charset
support is installed on the machine, TIB_Edit, TIB_Memo and TIB_Grid
all can display chinese okay after I set the charset and font. It is
only the TIB_ComboBox not working.
Rgds,
Michael
> >tried to set the font settings to chinese at run time but stillsame as
> >doesn't help.
> >
> >Any suggestion please? I ma using IBO4.3Aa
>
> This is a fraught issue, Michael! There are several issues here...
>
> First, the Charset property of the connection object has to be the
> the default character set of the database. And this Charsetapplies only
> to data that are stored as, or extracted as, strings (VARCHAR orCHAR). So
> Delphi converts the Fb/IB number types and displays them as Arabicnumbers.
> But this Charset property is not the one concerned in your problem.course, it
>
> The other Charset property is that of the Font attribute of the
> control. It is unrelated to the database Charset (although, of
> is important that this Charset enables codepage-correct strings tobe
> written to the database). It needs to be one of the font constantsdefined
> in Delphi's TFontCharset type, or a user-defined constant suppliedby the
> vendor of your font - and, of course, this font must be the same asthe one
> that is currently used on the client machine. You can inspectthe "known"
> charset constants in the Delphi help for TFontCharset.to-string
>
> It gets more complicated (perhaps impossibly so) in data-bound
> controls. Although number types are displayed by way of a number-
> conversion, numerals won't be converted to anything but a string ofone or
> more alphanumeric characters, in the range 0-9, and the locale-specific
> separators. The behaviour is enscapsulated in the 'AsSomeType'methods and
> makes a lot of use of variants.fonts)
>
> Some character sets (not talking about database charsets here, but
> "know" about the mapping of arabic alphanumerics to font-specificsymbols,
> others don't. I don't know of any routine available in English-language
> editions of Delphi that supports it. If you are using a Chinese-language
> version of Delphi, you might find some kind of language-specificextended
> support among the various Format routines, that already providesthe
> capability to intercept OnGetText and/or OnSetText, and displaywriting
> alphanumerics using the locale symbols.
>
> If not, you might be able to achieve what you want, somehow, by
> your own mapping routine, or by Googling for a component or routinethat
> someone else has already done.tried
>
> fwiw, as a guess, I would have tried exactly the strategy that you
> with the TIB_ComboBox. But did you realise that ItemValues isignored if
> the TIB_ComboBox.Style property is csDropDown?Dear Helen,
>
> Helen
The style property is set to csDropDownList. It works except the
chinese text is not displayed correctly, the data returned to the
database is correct. And of course all required fonts and charset
support is installed on the machine, TIB_Edit, TIB_Memo and TIB_Grid
all can display chinese okay after I set the charset and font. It is
only the TIB_ComboBox not working.
Rgds,
Michael