Greek support in FW
Greek support in FW
Is it posible to make FW understand Greek for the case changing string functions (e.g. UPPER(), LOWER(), @! and so on)? With DOS apps I just linked in NTXGR437.OBJ and they worked fine. When I link that OBJ or NTXGR851.OBJ well lets say the GETs are not a pritty picture when you type Greek text.
Is there an equivalent file for FW.
Thanks
Is there an equivalent file for FW.
Thanks
Code: Select all
--------------------------
font.prg ///// nCharSet := 161 greece
--------------------------
DEFAULT cFaceName := "SYSTEM_FONT", nEscapement := 0, nOrientation := 0, nWeight := 0,;
nHeight := 14, lItalic := .f., lFromUser := .f., lUnderLine := .f.,;
lStrikeOut := .f., nCharSet := 161 , nOutPrecision := 0,;
nClipPrecision := 0, nQuality := 0, lBold := .f., nWidth := 0,;
nPitchFamily := 0, ::nCount := 0, ::lDestroy := .t., ::aFonts := {}
The problem is no showing Greek text but using the PICTURE clauses of a GET, the UPPER() and LOWER() functions. For example try this
Link that with the stanord FW4Clipper libs and run it. Then relink it with stha same libs and NTXGR437.OBJ and see what happens.
Code: Select all
DEFINE oMainFont NAME “Arial Greek” SIZE 0,-12
cText1 := SPACE(60)
DEFINE DIALOG oFindDlg;
FROM 4,10 TO 15,65;
FONT oMainFont;
TITLE OemToAnsi("Υπερ-Αναζητηση");
OF oBrwsWin COLOR CLR_BLACK, CLR_HGRAY
@ 1.3, 1 GET cText1 PICTURE "@!" OF oFindDlg SIZE 200,10
@2 , 25 BUTTON OemToAnsi("Ενταξει") SIZE 60,16 OF oFindDlg
@3.2, 25 BUTTON OemToAnsi("Aκυρο") SIZE 60,16 OF oFindDlg ACTION oFindDlg:End()
ATIVATE DIALOG oFindDlg CENTER
ΤΟ UPPER(), LOWER(), ΤΟ ΤΣΕΚΑΡΗΣ ΣΤΙΣ ΙΔΙΟΤΗΤΕΣ
ΤΟΥ ΠΕΔΙΟΥ ΤΗΣ ΦΟΡΜΑΣ ΑΝ ΚΑΝΕΙΣ ΤΟ DLL ME TO WorkShop
ΔΙΑΦΟΡΕΤΙΚΑ ΔΙΛΩΝΕΙΣ ΣΤΟ RC ΑΡΧΕΙΟ ES_UPPERCASE
PROMHTH DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 15, 405, 278
STYLE WS_CHILD | WS_VISIBLE | WS_DLGFRAME | WS_THICKFRAME | WS_MINIMIZEBOX
FONT 8, "Arial"
{
EDITTEXT 110, 108, 22, 47, 10
EDITTEXT 111, 108, 43, 139, 10, ES_UPPERCASE | WS_BORDER | WS_TABSTOP
EDITTEXT 112, 108, 61, 139, 10
ΦΙΛΙΚΑ ΓΙΑΝΝΗΣ
ΤΟΥ ΠΕΔΙΟΥ ΤΗΣ ΦΟΡΜΑΣ ΑΝ ΚΑΝΕΙΣ ΤΟ DLL ME TO WorkShop
ΔΙΑΦΟΡΕΤΙΚΑ ΔΙΛΩΝΕΙΣ ΣΤΟ RC ΑΡΧΕΙΟ ES_UPPERCASE
PROMHTH DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 15, 405, 278
STYLE WS_CHILD | WS_VISIBLE | WS_DLGFRAME | WS_THICKFRAME | WS_MINIMIZEBOX
FONT 8, "Arial"
{
EDITTEXT 110, 108, 22, 47, 10
EDITTEXT 111, 108, 43, 139, 10, ES_UPPERCASE | WS_BORDER | WS_TABSTOP
EDITTEXT 112, 108, 61, 139, 10
ΦΙΛΙΚΑ ΓΙΑΝΝΗΣ
Well try this and tell me how to make it work
How can I make FW4Clipper understand greek text. Is there a NTXGR437.OBJ file for FW (national clipper system)
Code: Select all
cText1 := "Κατι" // from a get statement with a "@!" picture clause that doesn't work
cSearch := UPPER(cText)+cYear+cEmploee // Upper doesn't work eather
SEEK cSearch
IF FOUND()
// do something
ELSE
MSGAlert("Nothing was found", "Search") // In FW4Clipper this comes up all the time unless you type caps.
ENDIF
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- E. Bartzokas
- Posts: 114
- Joined: Tue Feb 14, 2006 8:13 am
- Location: Corinth, Greece
Conversion of greek characters to Upper Case
I have made my own function to do this job called GR_UPPER(cString)
which does the conversion, including accented characters (e.g. our
greek language "i" and "I".
It does not cooperate with the PICTURE clause (I never tried that)
but it works fine before saving GET's.
If you are intersted I can send by private email to anyone interested.
Please notice that it's still in 16 bit (OBJ is compiled with C 6.00)
Perhaps someone could re-compile this in xHarbour so we could use
it with xHarbour too.
Regards to all
Evans
which does the conversion, including accented characters (e.g. our
greek language "i" and "I".
It does not cooperate with the PICTURE clause (I never tried that)
but it works fine before saving GET's.
If you are intersted I can send by private email to anyone interested.
Please notice that it's still in 16 bit (OBJ is compiled with C 6.00)
Perhaps someone could re-compile this in xHarbour so we could use
it with xHarbour too.
Regards to all
Evans
- E. Bartzokas
- Posts: 114
- Joined: Tue Feb 14, 2006 8:13 am
- Location: Corinth, Greece
Re: Conversion of greek characters to Upper Case
I have made a modification in both TGET.PRG for FW and FWH.
Now greek users can use this clause
REDEFINE GET oget VAR cGet Picture "@g" ID 1001 OF oDlg
etc.
The old picture "@!", still works, but only for upper case english characters,
in the "@g" picture, it converts both english and greek characters to upper
case.
I hereby paste the code changed in TGET.PRG (it works for both 16 bit and 32 bit)
You'd need to include TGET.PRG in your programs, but have to modify
the METHOD KeyChar( nKey, nFlags ) CLASS TGet as follows:
1. The code from if bKeyAction..... and below remains unchanged
2. If someone wants the code exactly as it should be, I can submit my own TGET.PRG's (16 bit and 32 bits)
I believe that this is a better solution than the function GR_UPPER() above.
Kind regards to all
Evans
Now greek users can use this clause
REDEFINE GET oget VAR cGet Picture "@g" ID 1001 OF oDlg
etc.
The old picture "@!", still works, but only for upper case english characters,
in the "@g" picture, it converts both english and greek characters to upper
case.
I hereby paste the code changed in TGET.PRG (it works for both 16 bit and 32 bit)
You'd need to include TGET.PRG in your programs, but have to modify
the METHOD KeyChar( nKey, nFlags ) CLASS TGet as follows:
Code: Select all
METHOD KeyChar( nKey, nFlags ) CLASS TGet
local nHi, nLo
local lAccept
local bKeyAction := SetKey( nKey )
local nDefButton
local n, xKey // added this local variable 11/sep/2006 V.
if ! Empty( ::cPicture ) .and. '@!' $ ::cPicture
xKey := Chr(nKey)
if xKey $ "abcdefghijklmnopqrstuvwxyz" // added this if - endif 11/sep/2006 V.
xKey := Upper( xKey )
nKey := Asc(xKey)
endif xKey $ "abcdefghijklmnopqrstuvwxyz" // added this if - endif 11/sep/2006 V.
endif
if ! Empty( ::cPicture ) .and. Upper('@g') $ Upper(::cPicture)
* Translate to upper case - English characters first!
xKey := Chr(nKey)
if xKey $ "abcdefghijklmnopqrstuvwxyz" // added this if - endif 11/sep/2006 V.
xKey := Upper( xKey )
nKey := Asc(xKey)
endif xKey $ "abcdefghijklmnopqrstuvwxyz" // added this if - endif 11/sep/2006 V.
* Translate to upper case - Greek characters now!
xKey := Chr(nKey)
if xKey $ "αάβγδεέζηήθιίϊκλμνξοόπρσςτυύϋφχψωώ" // added this if - endif 11/sep/2006 V.
n := At(xKey, "αάβγδεέζηήθιίϊκλμνξοόπρσςτυύϋφχψωώ")
xKey := Subs("ΑΆΒΓΔΕΈΖΗΉΘΙΊΪΚΛΜΝΞΟΌΠΡΣΣΤΥΎΫΦΧΨΩΏ", n, 1)
nKey := Asc(xKey)
endif xKey $ "αάβγδεέζηήθιίϊκλμνξοόπρσςτυύϋφχψωώ" // added this if - endif 11/sep/2006 V.
endif
if bKeyAction != nil .and. lAnd( nFlags, 16777216 ) // function Key
Eval( bKeyAction, ProcName( 4 ), ProcLine( 4 ), Self )
return 0 // Already processed, API do nothing
endif
2. If someone wants the code exactly as it should be, I can submit my own TGET.PRG's (16 bit and 32 bits)
I believe that this is a better solution than the function GR_UPPER() above.
Kind regards to all
Evans
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: