-
RTL Languages in the Grid
We are trying to enable Hebrew in our objective grids, which works well enough for fonts with a Hebrew code page (grrr! Segoe UI!). However, we are having problems with combo boxes giving "Encountered an improper argument" when we try dropping them down. Are there any gotchas I should know about when trying to use RTL languages? (We'll might want to do Arabic too).
We are building an MBCS MFC app in Win7.
-
This does appear to be something to do with RTL-ness, but I'm not sure if it's my problem or the Grids. It comes from the creation (and re-creation) of the Edit control when editing the cell.
When in "Hebrew Mode" I use ChangeStandardStyle to change the base font, ensuring it uses the Hebrew charset of the default system font. I've now also added a SetUserAttribute to set the GX_IDS_UA_RTLREADING parameter to "1".
The problem stems from CGXEditControl::UpdateEditStyle() where we have:
DWORD dwEditStyle = CalcEditStyle(&rectNP, m_dyHeight);
BOOL bChanged = m_dwEditStyle != dwEditStyle
// Check if the WS_EX_RTLREADING style has changed
|| (((CWnd::GetExStyle() & WS_EX_RTLREADING) != 0) != m_bRTL);
Which always seems to think that WS_EX_RTLREADING has changed. If I ignore this, I don't get the error.
If I'm editing an 'edit' cell, the text stays right-aligned, and editing starts. However, if I'm 'editing' a 'combo' cell, the drop-down contents are not right-aligned, as if they haven't inherited their RTL-ness from the base style.
Do I need to set RTL separately in child controls of the grid?
-
After recompiling I find that the behaviour of my app is mostly OK with changing to (see above):
BOOL bChanged = m_dwEditStyle != dwEditStyle;
I think the Combo drop down problem is because the CreateEx in CGXGridCombo only uses WS_EX_TOOLWINDOW. (i.e., it makes no account of the possibility that I might want an RTL drop down). My users can probably put up with that.
I still don't think this is the right way to fix this though.
-
If you are trying this...
You also need to change the active/inactive fonts for CGXTabWnd and CGXTabBeam, and the font for CGXRecordInfoBeam, to something that supports the appropriate code page (the default, Arial Narrow, doesn't).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules