sugerencia RICHEDIT

sugerencia RICHEDIT

Postby lucasdebeltran » Mon Jan 16, 2012 7:56 pm

Hola,

Por favor, ¿sería posible que el menú contextual de Copy, Cut, Align,etc. apareciera en el idioma del SO?.

Y para el título del Preview, ¿que en lugar de FWH RICHEDIT FILE fuera el título del Diálogo?.

También sería interesante que los mensajes y textos de FWH aparecieran en el idioma del Sistema Operativo o, al menos, que estuvieran en un único .ch para poderlo traducir y no tener que cambiar las clases con cada nueva build de FWH.

Muchas gracias ;).
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: sugerencia RICHEDIT

Postby fespinoza » Wed Jan 18, 2012 2:36 pm

Me sumo a esta propuesta.

Saludos

Fernando Espinoza
Saludos

Fernando Espinoza
User avatar
fespinoza
 
Posts: 188
Joined: Wed Feb 01, 2006 6:59 pm
Location: Ecuador

Re: sugerencia RICHEDIT

Postby lucasdebeltran » Fri Jan 20, 2012 4:19 pm

Pasa también lo mismo con los Memos.

El menú sale en inglés.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: sugerencia RICHEDIT

Postby lucasdebeltran » Mon Jan 23, 2012 8:30 am

Hola,

¿Algún comentario por parte de Fivetech?.

Gracias.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: sugerencia RICHEDIT

Postby Adolfo » Mon Jan 23, 2012 2:48 pm

Lucas.

Puedes Sobre-Escribir los metodos,, Tener un PRG exclusivo con los metodos nuevos y al que debes llamar antes de iniciar la ventana principal


En este caso el metodo RButtonDown( nRow, nCol, nFlags ) de tRichEdit y de mGet

OVERRIDE METHOD RbButtonDown IN CLASS TRichEdit WITH MiRButtonDown

En tu metodo MiRbuttonDown puedes escribir los menues en Español, o tener algo que identifique que lenguaje utilizar y tienes una solución.

Por lo que veo para que Fivetech solucione ese problema, debera tener un .CH con los mensajes en los distintos idiomas y llamarlos de acuerdo a un flag que le indique cual usar.

Espero que te sirva.

Desde Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: sugerencia RICHEDIT

Postby FiveWiDi » Mon Jan 23, 2012 3:31 pm

Adolfo wrote:Lucas.

Puedes Sobre-Escribir los metodos,, Tener un PRG exclusivo con los metodos nuevos y al que debes llamar antes de iniciar la ventana principal


En este caso el metodo RButtonDown( nRow, nCol, nFlags ) de tRichEdit y de mGet

OVERRIDE METHOD RbButtonDown IN CLASS TRichEdit WITH MiRButtonDown

En tu metodo MiRbuttonDown puedes escribir los menues en Español, o tener algo que identifique que lenguaje utilizar y tienes una solución.

Por lo que veo para que Fivetech solucione ese problema, debera tener un .CH con los mensajes en los distintos idiomas y llamarlos de acuerdo a un flag que le indique cual usar.

Espero que te sirva.

Desde Chile
Adolfo


Adolfo,

OVERRIDE METHOD funciona en Harbour?

Creo que no. Si es así, como sería en Harbour?
Un Saludo
Carlos G.

FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
FiveWiDi
 
Posts: 1078
Joined: Mon Oct 10, 2005 2:38 pm

Re: sugerencia RICHEDIT

Postby Adolfo » Mon Jan 23, 2012 7:00 pm

LUCAS...

Tal como te respondio Przemysław Czerpak en abril del 2011, la solucion esta en el \\harbour-3.0.0\doc\xhb-diff.txt

### RUNTIME CLASS MODIFICATION ###
========================================
Harbour and xHarbour use dynamic bindings so it's possible to modify class
definitions at runtime. To avoid possible very serious problems which can
be caused by such class modification Harbour provides LOCKED clause in class
definition. xHarbour does not have such functionality and even documented
command like OVERRIDE CLASS or EXTEND CLASS as official features though
they break inheritance scheme and never worked correctly in the whole
xHarbour history. They are available in Harbour only in xHarbour compatible
library after including xhbcls.ch for porting existing xHarbour code to
Harbour and work exactly like in xHarbour having the same problems so they
are not planned to be part of Harbour core code.

O sea Incluir xhbcls.ch en tu prg, y la libreria xdiff.lib y/o xhb.lib pero con las restricciones y posibles errores que puedes tener.
Luego utilizas el OVERRIDE


Carlos he ahi tambien la respuesta, no existe en HARBOUR pero puede usarse en modo compatibilidad.

Desde Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: sugerencia RICHEDIT

Postby FiveWiDi » Mon Jan 23, 2012 8:28 pm

Adolfo wrote:LUCAS...

Tal como te respondio Przemysław Czerpak en abril del 2011, la solucion esta en el \\harbour-3.0.0\doc\xhb-diff.txt

### RUNTIME CLASS MODIFICATION ###
========================================
Harbour and xHarbour use dynamic bindings so it's possible to modify class
definitions at runtime. To avoid possible very serious problems which can
be caused by such class modification Harbour provides LOCKED clause in class
definition. xHarbour does not have such functionality and even documented
command like OVERRIDE CLASS or EXTEND CLASS as official features though
they break inheritance scheme and never worked correctly in the whole
xHarbour history. They are available in Harbour only in xHarbour compatible
library after including xhbcls.ch for porting existing xHarbour code to
Harbour and work exactly like in xHarbour having the same problems so they
are not planned to be part of Harbour core code.

O sea Incluir xhbcls.ch en tu prg, y la libreria xdiff.lib y/o xhb.lib pero con las restricciones y posibles errores que puedes tener.
Luego utilizas el OVERRIDE


Carlos he ahi tambien la respuesta, no existe en HARBOUR pero puede usarse en modo compatibilidad.

Desde Chile
Adolfo


Adolfo,

En xHarbour de noviembre de 2010 no encuentro estos ficheros; esperaré a actualizarme.

gracias.
Un Saludo
Carlos G.

FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
FiveWiDi
 
Posts: 1078
Joined: Mon Oct 10, 2005 2:38 pm

Re: sugerencia RICHEDIT

Postby lucasdebeltran » Mon Jan 23, 2012 8:31 pm

Adolfo,

Esa solución no es operativa. Primero, si buscas posts con OVERRIDE, verás que Antonio desaconseja su uso.

En segundo lugar, si se hace algún cambio en ese método seguiremos usando el método anterior. Lo cual no vale para nada, porque si queremos estar actualizados tenemos que estar editando cada mes los .prgs y perdiendo tiempo.

Mira el ejemplo de rpreview.prg y uno de sus métodos. No es factible usar el override, pues si hay un cambio seguiré con la versión vieja:

Code: Select all  Expand view
METHOD BuildWindow() CLASS TPreview

   local oIcon, cTitle := "FiveWin Printing Preview", oCursor, oBar, nCol := 325
   local oThis := Self
   local nRow  := 7

   DEFAULT ::oWndMain := WndMain()

   ::hOldRes := GetResources()

   if ! File( ::cResFile )

      #ifdef __CLIPPER__
         ::cResFile := "Preview.dll"
      #else
         if ! IsWin64()
            ::cResFile := "Prev32.dll"
         else
            ::cResFile = "Prev64.dll"
         endif
      #endif

   endif

   if SetResources( ::cResFile ) < 32
      MsgStop( ::cResFile + " not found, imposible to continue",;
               "FiveWin Printing Error" )
      return nil
   endif
   ::hNewRes      := GetResources()

   if ::oDevice != nil
      cTitle = ::oDevice:cDocument
   endif

   if ::oWndMain != nil
      oIcon = ::oWndMain:oIcon
   else
      DEFINE ICON oIcon RESOURCE "Print"
   endif

   DEFINE FONT ::oFont NAME GetSysFont() SIZE 0, -12

   ::CheckStyle()

   if !::oDevice:lPrvModal .and. ::oWndMain != nil .and. ;
      Upper( ::oWndMain:ClassName() ) == "TMDIFRAME"
      DEFINE WINDOW ::oWnd ;
         TITLE cTitle ;
         COLOR CLR_BLACK,CLR_LIGHTGRAY      ;
         ICON  oIcon                        ;
         VSCROLL HSCROLL MDICHILD
   else
      DEFINE WINDOW ::oWnd /*FROM 0, 0 TO 24, 80*/  ;
         TITLE cTitle ;
         COLOR CLR_BLACK,CLR_LIGHTGRAY      ;
         ICON  oIcon                        ;
         VSCROLL HSCROLL MENU ::BuildMenu()
   endif

   ::oWnd:SetFont( ::oFont )

   ::oWnd:oVScroll:SetRange( 0, 0 )
   ::oWnd:oHScroll:SetRange( 0, 0 )

   ::cPageNum = TXT_PAGENUM
   ::BuildButtonBar()
/*
   #ifdef __CLIPPER__
      SET MESSAGE OF ::oWnd TO TXT_PREVIEW CENTERED ;
         NOINSET CLOCK DATE KEYBOARD
   #else
      if l2007
         SET MESSAGE OF ::oWnd TO TXT_PREVIEW CENTERED ;
            NOINSET CLOCK DATE KEYBOARD 2007
      else
         DEFINE STATUSBAR OF ::oWnd PROMPT "  " + TXT_PREVIEW
      endif
   #endif
*/


   if lRebar
      DEFINE STATUSBAR OF ::oWnd PROMPT "  " + TXT_PREVIEW
   else
      SET MESSAGE OF ::oWnd TO TXT_PREVIEW CENTERED ;
         NOINSET CLOCK DATE KEYBOARD
      ::oWnd:oMsgBar:l2007    := ( nStyle == 2007 )
      ::oWnd:oMsgBar:l2010    := ( nStyle == 2010 )
   endif
   ::oMeta1 := TMetaFile():New( 0, 0, 0, 0,;
                                ::oDevice:aMeta[ 1 ],;
                                ::oWnd,;
                                CLR_BLACK,;
                                CLR_WHITE,;
                                ::oDevice:nHorzRes(),;
                                ::oDevice:nVertRes() )

   if ! IsWin64()
      DEFINE CURSOR ::oCursor RESOURCE "LUPA"
   else
      DEFINE CURSOR ::oCursor RESOURCE "search"
   endif

   ::oMeta1:oCursor := ::oCursor
   ::oMeta1:blDblClick := { | nRow, nCol, nKeyFlags | ;
                            ::SetOrg1( nCol, nRow, nKeyFlags ) }

   ::oMeta1:bKeyDown := { | nKey, nFlags | ::CheckKey( nKey, nFlags ) }
   ::oMeta1:bMouseWheel := { | nKeys, nDelta, nXPos, nYPos | ;
                             ::CheckMouseWheel( nKeys, nDelta, nXPos, nYPos ) }

   #ifndef __XPP__ // XBPP bug. Warning: don't change this into #ifdef __CLIPPER__
      ::oMeta2 := TMetaFile():New( 0, 0, 0, 0, "",;
                                   ::oWnd, CLR_BLACK, CLR_WHITE, ::oDevice:nHorzRes(),;
                                   ::oDevice:nVertRes() )
   #else
      ::oMeta2 := TMetaFile():New():_New( 0, 0, 0, 0, "",;
                                          ::oWnd, CLR_BLACK, CLR_WHITE, ::oDevice:nHorzRes(),;
                                          ::oDevice:nVertRes() )
   #endif

   ::oMeta2:oCursor = ::oCursor
   ::oMeta2:blDblClick := { | nRow, nCol, nKeyFlags | ;
                            ::SetOrg2( nCol, nRow, nKeyFlags ) }

   ::oMeta2:hide()

   ::SetFactor()

   oBar     := ::oBar
   if !lRebar
      nCol  := ATail( oBar:aControls ):nRight + 30
      nRow  := Int( oBar:nHeight / 2 ) - 6
   endif

   if nStyle >= 2007
      oBar:bPainted = { || oBar:Say( nRow, nCol, "Factor:",,, ::oFont, .T., .T. ),;
                           If( Len( ::oDevice:aMeta ) > 1,;
                           oBar:Say( nRow, nCol+100, ::cPageNum + LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ;
                           LTrim( Str( Len( ::oDevice:aMeta ) ) ),,, ::oFont, .T., .T. ),;
                           oBar:Say( nRow, nCol+100, ::cPageNum + LTrim( Str( ::nPage, 4, 0 ) ),;
                           ,,, ::oFont, .T., .T. ) ) }

   endif


   if nStyle < 2007
      @ nRow, nCol SAY ::oSay PROMPT "Factor:" ;
         SIZE 45, 15 PIXEL OF ::oBar FONT ::oFont

      ::oSay:lTransparent = .T.
   endif

   @ nRow-4, nCol+40 COMBOBOX ::oFactor VAR ::nZFactor ;
      ITEMS { "1", "2", "3", "4", "5", "6", "7", "8", "9" } ;
      OF ::oBar FONT ::oFont PIXEL SIZE 35,200 ;
      ON CHANGE oThis:SetFactor( oThis:nZFactor )

   if nStyle < 2007
      if Len( ::oDevice:aMeta ) > 1
         @ nRow, nCol+100 SAY ::oPage PROMPT TXT_PAGENUM + LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ;
            LTrim( Str( Len( ::oDevice:aMeta ) ) ) ;
            SIZE 180, 15 PIXEL OF ::oBar FONT ::oFont
      else
         @ nRow, nCol + 100 SAY ::oPage PROMPT TXT_PAGENUM + LTrim( Str( ::nPage, 4, 0 ) ) ;
            SIZE 180, 15 PIXEL OF ::oBar FONT ::oFont
      endif
      ::oPage:lTransparent = .T.
   endif

//   if IsAppThemed() .or. l2007
   if lRebar .or. nStyle >= 2007
      FixSays( ::oBar:hWnd )
   endif

   #ifndef __XPP__
      ::oFactor:Set3dLook( .T. )
   #endif

   SetResources( ::hOldRes )

   ::oWnd:oHScroll:bPos := { | nPos | ::HScroll( GO_POS, .f., nPos ) }
   ::oWnd:oVScroll:bPos := { | nPos | ::VScroll( GO_POS, .f., nPos ) }

return nil
 



Efectivamente, hay dos soluciones: a) que cada .prg de Fivewin detecte el idioma del SO (los principales: inglés, español, portugués, etc) y traduzca los mensajes o b) que es lo más factible, tener un .ch con todos los mensajes y de este modo traducir este .ch y listo.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: sugerencia RICHEDIT

Postby Adolfo » Mon Jan 23, 2012 8:54 pm

FIVEWIDI

OVERRIDE es de xHarbour, asi que no tienes nada que buscar, lo que pasa es que en tu pregunta, solo pones Harbour.

El problema es que como dice Przemysław Czerpak es absolutamente des-aconsejable el uso de Override por posibles problemas de herencia si ese método es llamado desde otras clases, si solo es llamado por la clase madre, y los cambios son menores, no implican nuevas datas o cambios bruscos de flujo del prg.. puede que si.


Lucas.
Tambien estoy de acuerdo en NO UTILIZAR OVERRIDE, por algo no esta en HARBOUR en forma nativa. Pero como querias una respuesta, ahi te deje lo mejor que tenia.

Por lo pronto lo mas directo "desgraciadamente" es modificar la clase.

ANTONIO

Que tan dificil podra ser el crear un CH con todas los mensajes en diferentes idiomas, se me ocurren 3 para partir, Español, Ingles, Portugues, por lo demas cada usuario puede aportar con las versiones en su idioma para hacer a FWH mas INTERNACIONAL aún o algo como lo que hizo Manuel Mercado en su TsBrowse, que soporta 17 idiomas : Español, Ingles, Eslovaco, Ruso, Portugues, Polaco, Malayo, Lituano, Italiano, Griego, Aleman, Gallego, Frances, Holandes y 3 formas de CHINO, solo agregando el PRG con las traducciones requeridas.


Desde Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: sugerencia RICHEDIT

Postby Antonio Linares » Mon Jan 23, 2012 9:27 pm

Adolfo,

Si usamos un CH externo, los PRGs tendrían que recompilarse. Aunque desde luego que ayudaría a organizar bien el soporte de distintos idiomas.

Vamos a estudiarlo y ver en que forma hacerlo, gracias :-)
regards, saludos

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

Re: sugerencia RICHEDIT

Postby lucasdebeltran » Mon Jan 23, 2012 10:12 pm

muchas gracias por escuchar maestro.

al menos, fwh debería soportar inglés y castellano, con un tipo set fwhlanguage to spanish, etc.

o también definir los mensajes de la librería en una función externa con un array, de modo que las funciones de fivewin llamarían a fwlangtext( 100 ) pasando el id, de modo que sólo hay que incluir esta función...
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: sugerencia RICHEDIT

Postby lucasdebeltran » Thu Feb 02, 2012 12:53 pm

up.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: sugerencia RICHEDIT

Postby Antonio Linares » Thu Feb 02, 2012 7:01 pm

Creo que la solución es usar una función FWString( "nombre_literal" ) que así permitiría reeemplazar la función por una propia facilmente sin tener que recompilar todo :-)

Para establecer el lenguaje podriamos usar otra función como FWSetLanguage( "español" ), etc.

Comentarios ? :-)
regards, saludos

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

Re: sugerencia RICHEDIT

Postby lucasdebeltran » Thu Feb 02, 2012 7:16 pm

Muchas gracias Antonio.

Así es como funcionaba EasyReport.

Por ejemplo, en report.prg:

MsgStop( "Preview.dll not found", "Error" )

Sería:

MsgStop( FWString( 1002 ), FWString( 1003 ) )



Y FWString( nChoice) devolvería según el idioma:

LOCAL cReturn
LOCAL cLang := ObtenemosIdiomaMensajes()

DO CASE
CASE nChoice = 1002
IF cLang = "EN"
cReturn := "Preview.dll not found"
ELSEIF cLang = "ESP"
cReturn := "No se encuentra el archvio preview.dll"
ENDIF
[...]
ENDCASE


RETURN( cReturn )


Sería estupendo!!
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: groiss and 33 guests