MDI Unicode Problem

Re: MDI Set MenuInfo not work=>Solved

Postby richard-service » Sat Jul 20, 2019 4:41 am

cnavarro wrote:Dialog selection child window "More Windows"

Image
Image


Good job. Thanks a lot.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby richard-service » Tue Jul 23, 2019 9:15 am

Dear Mr.Rao

Unicode malfunction according to modal / nomodal format problem, any solution?
http://forums.fivetechsupport.com/viewtopic.php?f=18&t=35539
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby richard-service » Fri Jul 26, 2019 5:42 pm

Hi All,

I test it again. I think it's FWH bug. Please look it below:

not work=> Child Window+Resource Dialog( ACTIVATE DIALOG ::oDlg NOWAIT )

Image

Work OK=> Child Window+Resource Dialog( ACTIVATE DIALOG ::oDlg NOWAIT ) and I Open another Resource Dialog for New/Edit data

Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby nageswaragunupudi » Fri Aug 09, 2019 12:36 pm

We do not think the problem is with mdi-dialog or nonmodal dialogs. The problem should be due to reasons external to this.

We made this test program using mdi dialogs. We used a table "statesuni" in FWH Demo Server, so that you can test it yourself. Please copy this program to your samples folder and build with buildh.bat.

For testing, do not make any changes to this source and do not also use any external libraries like TMySql.

This is the structure of table "statesuni"
Code: Select all  Expand view  RUN

CREATE TABLE `statesuni` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(2) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `name` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
 


We tested with two Unicode languages we know, i.e., Hindi and Telugu and we did not find any problems.

We request you to test with Chinese Unicode characters and let us have your feedback.

Test program:
Code: Select all  Expand view  RUN

#include "fivewin.ch"

#define AS_MDICHILD  1
#define AS_DIALOG    2

static oCn, oRs

//----------------------------------------------------------------------------//

function Main()

   local oWnd, oBar, oMenu

   FW_SetUnicode( .T. )
   SetGetColorFocus()

   oCn   := FW_DemoDB()
   oRs   := oCn:RowSet( "statesuni" )

   DEFINE WINDOW oWnd MDI TITLE "FWH18.08: DIALOG IN MDICHILD WINDOW"
   DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2007
   DEFINE BUTTON OF oBar PROMPT "MDIDLG"  CENTER ACTION CreateDialog( AS_MDICHILD )
   DEFINE BUTTON OF oBar PROMPT "DIALOG"  CENTER ACTION CreateDialog( AS_DIALOG )
   DEFINE BUTTON OF oBar PROMPT "STRUCT"  CENTER GROUP ACTION ;
      memoedit( oCn:CreateTableSQL( "statesuni" ), "STATESUNI Structure" )


   ACTIVATE WINDOW oWnd

   oRs:Close()
   oCn:Close()

return nil

//----------------------------------------------------------------------------//

static function CreateDialog( nAs )

   local oDlg, oBrw, oFont, oBrush
   local aGrad    := {{1, CLR_WHITE, CLR_HBLUE }}


   DEFINE BRUSH oBrush GRADIENT aGrad
   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20

   DEFINE DIALOG oDlg SIZE 500,500 PIXEL TRUEPIXEL FONT oFont TITLE "MDI-DLG" BRUSH oBrush

   RELEASE FONT oFont
   RELEASE BRUSH oBrush

   @ 80,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS PICTURES  "99" CELL LINES NOBORDER UPDATE

   WITH OBJECT oBrw
      :bChange    := { || oDlg:Update() }
      //
      :CreateFromCode()
   END

   @ 20,60 GET oRs:Name SIZE 400,40 PIXEL OF oDlg UPDATE VALID ;
      (  oRs:Save(), oBrw:RefreshCurrent(), .t. )

   oDlg:bGotFocus := { || oDlg:Update() }

   if nAs == AS_MDICHILD

      ACTIVATE DIALOG oDlg AS MDICHILD

   elseif nAs == AS_DIALOG

      ACTIVATE DIALOG oDlg CENTERED

   endif

return oDlg

//----------------------------------------------------------------------------//
 


Our test results:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MDI Unicode Problem

Postby richard-service » Sun Aug 11, 2019 5:17 pm

nageswaragunupudi wrote:We do not think the problem is with mdi-dialog or nonmodal dialogs. The problem should be due to reasons external to this.

We made this test program using mdi dialogs. We used a table "statesuni" in FWH Demo Server, so that you can test it yourself. Please copy this program to your samples folder and build with buildh.bat.

For testing, do not make any changes to this source and do not also use any external libraries like TMySql.

This is the structure of table "statesuni"
Code: Select all  Expand view  RUN

CREATE TABLE `statesuni` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(2) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
  `name` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
 


We tested with two Unicode languages we know, i.e., Hindi and Telugu and we did not find any problems.

We request you to test with Chinese Unicode characters and let us have your feedback.

Test program:
Code: Select all  Expand view  RUN

#include "fivewin.ch"

#define AS_MDICHILD  1
#define AS_DIALOG    2

static oCn, oRs

//----------------------------------------------------------------------------//

function Main()

   local oWnd, oBar, oMenu

   FW_SetUnicode( .T. )
   SetGetColorFocus()

   oCn   := FW_DemoDB()
   oRs   := oCn:RowSet( "statesuni" )

   DEFINE WINDOW oWnd MDI TITLE "FWH18.08: DIALOG IN MDICHILD WINDOW"
   DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2007
   DEFINE BUTTON OF oBar PROMPT "MDIDLG"  CENTER ACTION CreateDialog( AS_MDICHILD )
   DEFINE BUTTON OF oBar PROMPT "DIALOG"  CENTER ACTION CreateDialog( AS_DIALOG )
   DEFINE BUTTON OF oBar PROMPT "STRUCT"  CENTER GROUP ACTION ;
      memoedit( oCn:CreateTableSQL( "statesuni" ), "STATESUNI Structure" )


   ACTIVATE WINDOW oWnd

   oRs:Close()
   oCn:Close()

return nil

//----------------------------------------------------------------------------//

static function CreateDialog( nAs )

   local oDlg, oBrw, oFont, oBrush
   local aGrad    := {{1, CLR_WHITE, CLR_HBLUE }}


   DEFINE BRUSH oBrush GRADIENT aGrad
   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20

   DEFINE DIALOG oDlg SIZE 500,500 PIXEL TRUEPIXEL FONT oFont TITLE "MDI-DLG" BRUSH oBrush

   RELEASE FONT oFont
   RELEASE BRUSH oBrush

   @ 80,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS PICTURES  "99" CELL LINES NOBORDER UPDATE

   WITH OBJECT oBrw
      :bChange    := { || oDlg:Update() }
      //
      :CreateFromCode()
   END

   @ 20,60 GET oRs:Name SIZE 400,40 PIXEL OF oDlg UPDATE VALID ;
      (  oRs:Save(), oBrw:RefreshCurrent(), .t. )

   oDlg:bGotFocus := { || oDlg:Update() }

   if nAs == AS_MDICHILD

      ACTIVATE DIALOG oDlg AS MDICHILD

   elseif nAs == AS_DIALOG

      ACTIVATE DIALOG oDlg CENTERED

   endif

return oDlg

//----------------------------------------------------------------------------//
 


Our test results:
Image


Mr.Rao

I just test it. input Chinese work fine. So it's next test what...
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby nageswaragunupudi » Mon Aug 12, 2019 12:50 am

Mr.Rao

I just test it. input Chinese work fine. So it's next test what...

Now, you need to figure out what is that difference between our sample and your application that is causing the problem for you.
You are in a better position to find out the reason than me.

Anyway, I can give a few hints:
1) When you use FW_SetUnicode( .t. ), do not also SET Chinese CODEPAGE.
2) FWH supports "utf8" but not "utf8mb4". Please make sure that the fields in your table are created with the character set "utf8" but not "utf8mb4".
3) Implications of using FWH builtin MariaLib Vs TMySQL.

Next steps for testing:
1) Change the table and server in our example to your server and your table and see if you still get the problems, using FWH built-in MariaLib.
2) Please also let us know the structure of your table. Please use
Code: Select all  Expand view  RUN

oCn:CreateTableSQL( <yourtablename> )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MDI Unicode Problem

Postby richard-service » Mon Aug 12, 2019 4:08 am

nageswaragunupudi wrote:
Mr.Rao

I just test it. input Chinese work fine. So it's next test what...

Now, you need to figure out what is that difference between our sample and your application that is causing the problem for you.
You are in a better position to find out the reason than me.

Anyway, I can give a few hints:
1) When you use FW_SetUnicode( .t. ), do not also SET Chinese CODEPAGE.
2) FWH supports "utf8" but not "utf8mb4". Please make sure that the fields in your table are created with the character set "utf8" but not "utf8mb4".
3) Implications of using FWH builtin MariaLib Vs TMySQL.

Next steps for testing:
1) Change the table and server in our example to your server and your table and see if you still get the problems, using FWH built-in MariaLib.
2) Please also let us know the structure of your table. Please use
Code: Select all  Expand view  RUN

oCn:CreateTableSQL( <yourtablename> )
 


Mr.RAO

I use Harbour, so I set these below
Code: Select all  Expand view  RUN

REQUEST HB_Lang_ZH, HB_CODEPAGE_UTF8

HB_LangSelect( "zh" )
HB_SetCodePage( "UTF8" )
HB_CDPSELECT( "UTF8" )

Fw_SetUnicode( .T. )
 
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby nageswaragunupudi » Mon Aug 12, 2019 5:56 am

1) Change the table and server in our example to your server and your table and see if you still get the problems, using FWH built-in MariaLib.

Can you try this and let us know?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MDI Unicode Problem

Postby richard-service » Mon Aug 12, 2019 5:12 pm

nageswaragunupudi wrote:
1) Change the table and server in our example to your server and your table and see if you still get the problems, using FWH built-in MariaLib.

Can you try this and let us know?


Be changed. it's work fine.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby nageswaragunupudi » Mon Aug 12, 2019 6:18 pm

Then what do you think is the difference between your previous sample and the present sample?
Can you please use your TMySql lib instead of Builtin MariaLib of FWH in the same sample we are now testing?
Also please try removing HB_LangSelect(...).
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MDI Unicode Problem

Postby richard-service » Tue Aug 13, 2019 8:11 am

nageswaragunupudi wrote:Then what do you think is the difference between your previous sample and the present sample?
Can you please use your TMySql lib instead of Builtin MariaLib of FWH in the same sample we are now testing?
Also please try removing HB_LangSelect(...).


Mr.Rao

Difference
A.I have to use Set Resource to "xxx.DLL" , so I call Resource Dialog and into MDI Child Window.
B.I use TMySQL.
C.your prg type is big5, my prg type is UTF8
D.your control only TGet and xBrowse, my TGet, Radio, Checkbox, buttonbmp and xbrowse in the resource Dialog.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: MDI Unicode Problem

Postby nageswaragunupudi » Tue Aug 13, 2019 11:47 am

A.I have to use Set Resource to "xxx.DLL" , so I call Resource Dialog and into MDI Child Window.

Please prepare a small RC file and a sample program to reproduce the error

B.I use TMySQL.

Till we resolve the problem, let us work with FWMariaDB only

C.your prg type is big5, my prg type is UTF8

No, our program is pure UTF8. To get reliable results and to avoid any problems, we need to keep the program pure UTF8 amd not to use big5 or Harbour codepage for Chinese. Keep it pure and simple UTF8.

D.your control only TGet and xBrowse, my TGet, Radio, Checkbox, buttonbmp and xbrowse in the resource Dialog.


As I said above, please prepare a sample with RC with all kinds of controls you like.

Then, please send your program and rc file. We will then upload the data to the Demo Server of FWH and we can both test it.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests