Unicode malfunction according to modal / nomodal format

Unicode malfunction according to modal / nomodal format

Postby kkwan » Sat Apr 21, 2018 3:07 pm

For Unicode and UTF8 use
In the modal / nomodal dialog, tGet and mget control malfunction.
It works fine regardless of richiedit.

In other words
Activate Dialog == No abnormality
Activate Dialog NoModal == malfunction

In the future, most of the source coding will be in the MDI window
Dialog Child / NoModal type, so UTF8 input is required.

The current project execution is stopped.
Please help.

msc2017 use FWH 18.02
kkwan
 
Posts: 10
Joined: Tue Apr 17, 2018 11:39 am

Re: Unicode malfunction according to modal / nomodal format

Postby Antonio Linares » Mon Apr 23, 2018 2:44 am

We are checking it, please wait one day or two, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode malfunction according to modal / nomodal format

Postby Antonio Linares » Mon Apr 23, 2018 10:43 am

We are testing this example:

unimdi.prg
Code: Select all  Expand view
#include "fivewin.ch"

static aStr[ 5 ]

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

function Main()

   local oWnd, oBar, oFont

   FW_SetUnicode( .T. )
   SetGetColorFocus()

   AEval( aStr, { |u,i| aStr[ i ] := Space( 25 ) } )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-18

   DEFINE WINDOW oWnd MDI TITLE "UNICODE GETS"

   DEFINE BUTTONBAR oBar SIZE 80,60 2007
   DEFINE BUTTON OF oBar PROMPT "MDI" + CRLF +  "Child"      CENTER ACTION ChildWindow()
   DEFINE BUTTON OF oBar PROMPT "Modal" + CRLF + "Dialog" CENTER ACTION NewDialog( .T. )
   DEFINE BUTTON OF oBar PROMPT "Nonmodal" + CRLF + "Dialog" CENTER ACTION NewDialog()

   oWnd:SetFont( oFont )

   ACTIVATE WINDOW oWnd
   RELEASE FONT oFont

return nil

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

static function ChildWindow()

   local oWnd

   DEFINE WINDOW oWnd MDICHILD OF WndMain() COLOR CLR_BLACK, CLR_WHITE

   CreateGets( oWnd )
   oWnd:bGotFocus := { || oWnd:Update() }

   ACTIVATE WINDOW oWnd


return nil

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

static function NewDialog( lModal )

   local oDlg

   DEFAULT lModal := .f.

   DEFINE DIALOG oDlg SIZE 460, 260 PIXEL TRUEPIXEL FONT WndMain():oFont
   CreateGets( oDlg )
   oDlg:bGotFocus := { || oDlg:Update() }

   if lModal
      ACTIVATE DIALOG oDlg CENTERED
   else
      ACTIVATE DIALOG oDlg CENTERED NOMODAL
   endif

return nil

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

static function CreateGets( oWnd )

   local nRow := 60

   @ nRow, 30 GET aStr[ 1 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE
   nRow  += 35
   @ nRow, 30 GET aStr[ 2 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE
   nRow  += 35
   @ nRow, 30 GET aStr[ 3 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE
   nRow  += 35
   @ nRow, 30 GET aStr[ 4 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE

return nil

//----------------------------------------------------------------------------//
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode malfunction according to modal / nomodal format

Postby Antonio Linares » Mon Apr 23, 2018 12:04 pm

As a temporary workaround, if you create the GETs this way, then unicode works fine on NONMODAL dialogs:

ACTIVATE DIALOG oDlg CENTERED NOMODAL ;
ON INIT CreateGets( oDlg )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Unicode malfunction according to modal / nomodal format

Postby nageswaragunupudi » Mon Apr 23, 2018 4:09 pm

This is the revised program:
Code: Select all  Expand view
#include "fivewin.ch"

static aStr[ 4 ]

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

function Main()

   local oWnd, oBar, oFont

   FW_SetUnicode( .T. )
   SetGetColorFocus()

   AEval( aStr, { |u,i| aStr[ i ] := Space( 25 ) } )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-18

   DEFINE WINDOW oWnd MDI TITLE "UNICODE GETS"

   DEFINE BUTTONBAR oBar SIZE 80,60 2007
   DEFINE BUTTON OF oBar PROMPT "MDI" + CRLF +  "Child"      CENTER ACTION ChildWindow()
   DEFINE BUTTON OF oBar PROMPT "Nonmodal" + CRLF + "Dialog" CENTER ACTION NewDialog()
   DEFINE BUTTON OF oBar PROMPT "Modal" + CRLF + "Dialog"    CENTER ACTION NewDialog( .t. )

   oWnd:SetFont( oFont )

   ACTIVATE WINDOW oWnd
   RELEASE FONT oFont

return nil

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

static function ChildWindow()

   local oWnd

   DEFINE WINDOW oWnd MDICHILD OF WndMain() TITLE "MDI CHILD WINDOW" COLOR CLR_BLACK, CLR_WHITE
   CreateGets( oWnd )
   oWnd:bGotFocus := { || oWnd:Update() }
   ACTIVATE WINDOW oWnd

return nil

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

static function NewDialog( lModal )

   local oDlg

   DEFAULT lModal := .f.

   DEFINE DIALOG oDlg SIZE 460, 260 PIXEL TRUEPIXEL FONT WndMain():oFont ;
      TITLE If( lModal, "MODAL DIALOG", "NON-MODAL DIALOG" )

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

   if lModal

      CreateGets( oDlg )

      ACTIVATE DIALOG oDlg CENTERED

   else

      ACTIVATE DIALOG oDlg CENTERED NOMODAL ON INIT CreateGets( oDlg )

   endif

return nil

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

static function CreateGets( oWnd )

   local nRow

   nRow     := 60

   @ nRow, 30 GET aStr[ 1 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE
   nRow  += 35
   @ nRow, 30 GET aStr[ 2 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE
   nRow  += 35
   @ nRow, 30 GET aStr[ 3 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE
   nRow  += 35
   @ nRow, 30 GET aStr[ 4 ] SIZE 400,32 PIXEL OF oWnd CHRGROUP CHR_WIDE UPDATE

return nil

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

Unicode Gets on MDICHILD windows, modal and non-modal Dialogs work as expected.
Regards

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

Re: Unicode malfunction according to modal / nomodal format

Postby kkwan » Tue Apr 24, 2018 10:29 am

Thank you for your quick reply.
The solution you provided was effective.
However, if you install various controls besides TGET Control
It will malfunction like before.
It seems to have avoided the bug with time difference.
It can be a useful tip for a very simple screen design.
Let's wait for more bug-resolved products.
Thank you.
kkwan
 
Posts: 10
Joined: Tue Apr 17, 2018 11:39 am

Re: Unicode malfunction according to modal / nomodal format

Postby kkwan » Tue May 08, 2018 12:02 pm

When is Unicode malfunction possible?
kkwan
 
Posts: 10
Joined: Tue Apr 17, 2018 11:39 am

Re: Unicode malfunction according to modal / nomodal format

Postby richard-service » Sun Jul 21, 2019 4:21 am

Hi
My program
Code: Select all  Expand view

REDEFINE GET ::oEX_WHO VAR ::cEX_WHO ID 101 OF ::oDlg UPDATE CHRGROUP CHR_WIDE
ACTIVATE DIALOG ::oDlg CENTER
 

Change to
Code: Select all  Expand view

DEFINE WINDOW go31001Wnd FROM 0, 0 TO 0, 0        
...
DEFINE DIALOG ::oDlg RESOURCE ::cResName FONT oFont BRUSH oBrush TRANSPARENT OF go31001Wnd

REDEFINE GET ::oEX_WHO VAR ::cEX_WHO ID 101 OF ::oDlg UPDATE CHRGROUP CHR_WIDE
ACTIVATE DIALOG ::oDlg NOWAIT

go31001Wnd:bGotFocus := { || go31001Wnd:Update() }
ACTIVATE WINDOW go31001Wnd CENTER      
 


Image

use Only Dialog input Chinese fine.
Change MDI and input Chinese not work. input "新" show "送"

Any solution?
Last edited by richard-service on Sun Jul 21, 2019 4:59 am, edited 1 time in total.
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: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unicode malfunction according to modal / nomodal format

Postby nageswaragunupudi » Sun Jul 21, 2019 4:28 am

Can you please try
Code: Select all  Expand view

DEFINE DIALOG ....
// Define Gets and other controls
ACTIVATE DIALOG oDlg AS MDICHILD
 
Regards

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

Re: Unicode malfunction according to modal / nomodal format

Postby richard-service » Sun Jul 21, 2019 5:06 am

nageswaragunupudi wrote:Can you please try
Code: Select all  Expand view

DEFINE DIALOG ....
// Define Gets and other controls
ACTIVATE DIALOG oDlg AS MDICHILD
 


I change to
Code: Select all  Expand view

ACTIVATE DIALOG ::oDlg AS MDICHILD         ;
              ON INIT  ( oThis:oDlg:Move(0,0) ) ;
              VALID !paOpenWnd[IS_WSE31002]
 


I lose buttonbar ... control and got error, this not I want it.

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: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unicode malfunction according to modal / nomodal format

Postby nageswaragunupudi » Sun Jul 21, 2019 5:26 am

Please reproduce the error.log.
Do you have the problem in mdi-dialog only or in normal dialogs also?
Regards

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

Re: Unicode malfunction according to modal / nomodal format

Postby richard-service » Sun Jul 21, 2019 6:23 am

nageswaragunupudi wrote:Please reproduce the error.log.
Do you have the problem in mdi-dialog only or in normal dialogs also?


Code: Select all  Expand view

ACTIVATE DIALOG ::oDlg NOWAIT              ;
                    ON INIT  ( oThis:oDlg:Move(0,0) ) ;
                    VALID !paOpenWnd[IS_WSE31001]
 

This code, I can working. But TGet input Chinese not work. Look my attach first gif.

Code: Select all  Expand view

ACTIVATE DIALOG ::oDlg AS MDICHILD              ;
                    ON INIT  ( oThis:oDlg:Move(0,0) ) ;
                    VALID !paOpenWnd[IS_WSE31001]
 

This code. I change NOWAIT to AS MDICHILD . Child Window and Dialog not work. Look my attach Second gif.
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: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unicode malfunction according to modal / nomodal format

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

Hi Mr.Rao

Look it.

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: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unicode malfunction according to modal / nomodal format

Postby richard-service » Tue Aug 06, 2019 3:51 am

nageswaragunupudi wrote:Please reproduce the error.log.
Do you have the problem in mdi-dialog only or in normal dialogs also?


Any solution?
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: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 5 guests