Edit Extended / Edit WorkArea - ABM / ABM2

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

edit (R)extended

Post by Pablo César »

t57042 wrote:The language selection doesn't seem to work here.
I tried to set it with HB_LANGSELECT in the sourcecode and with the 'language select' option in the menu.
Always get english.

How does it work?
I have passed recentely with same case. Just to change languages in C:\hmg.3.1.3\SAMPLES\EDIT_EXTENDED\demo.prg, you have to add InitMessages( aLangID[nItem] ) after line where is HB_LANGSELECT( aLangID[nItem] ), then it will work fine ! :)

At begining you can set you local language, but remeber must be both lines:
HB_LANGSELECT( aLangID[nItem] )
InitMessages( aLangID[nItem] )

Alias better than the both lines, just put SET LANGUAGE TO FRENCH (for example).
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

edit (R)extended

Post by Pablo César »

My good question is:

Are someone still using EDIT EXTENDED ?

Compensates to make new implements in EDIT EXTENDED if no one uses ?

I feel missing features like as:

- Possibility to assign user function: OnChange, OnEnter, OnGotFocus and OnLostFocus events or new event just to "valid" each field in edition.
- Possibility to define ComboBox in place of TextBox (dificult assign, but I believe possible)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: edit (R)extended

Post by srvet_claudio »

Pablo César wrote:Are someone still using EDIT EXTENDED ?

Compensates to make new implements in EDIT EXTENDED if no one uses ?
+1
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Gustavo Romo
Posts: 29
Joined: Mon Feb 04, 2013 8:39 pm
Location: MEXICO
Contact:

Re: Edit Extended

Post by Gustavo Romo »

I have the same problem,

the Languaje still in English in Edit Extended,

SET LANGUAGE TO SPANISH
SET CODEPAGE TO SPANISH
InitMessages( "ES" )
HB_LANGSELECT( "ES" )


Don't Work


Yo tengo el mismo problema al USAR EDIT O EDIT EXTENDED
Todos los botones aparecen en ingles a pesar de iniciar tu procedimiento con las órdenes arriba indicadas


Saludos a todos!
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Edit Extended

Post by Pablo César »

Gustavo Romo wrote:the Languaje still in English in Edit Extended,

SET LANGUAGE TO SPANISH
SET CODEPAGE TO SPANISH
InitMessages( "ES" )
HB_LANGSELECT( "ES" )
Gustavo, your indication is totally different as I have suggested. Please note this example:

Code: Select all

#include "hmg.ch"
#define APP_TITLE    "EDIT EXTENDED Demo"

Function Main()
SET CENTURY ON
SET DELETED OFF
SET DATE TO BRITISH

// SET LANGUAGE TO PORTUGUESE
// InitMessages("PT")

SET LANGUAGE TO SPANISH
// SET CODEPAGE TO SPANISH
InitMessages( "ES" )
// HB_LANGSELECT( "ES" )

DEFINE WINDOW Win_1                  ;
   AT         0,0                    ;
   WIDTH      getdesktopWidth()      ;
   HEIGHT     getDeskTopHeight()-27  ;
   TITLE      APP_TITLE              ;
   MAIN                              ;
   NOMAXIMIZE                        ;
   NOSIZE                            ;
   ON INIT    OpenTable()            ;
   ON RELEASE CloseTable()          

   DEFINE BUTTON Button_1
        ROW    250
        COL    240
        WIDTH  100
        HEIGHT 28
        ACTION BasicDemo( "TEST2" )
        CAPTION "Editar DBF"
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        HELPID Nil
        FLAT .F.
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        MULTILINE .F.
        PICTURE Nil
        PICTALIGNMENT TOP
    END BUTTON
END WINDOW
ACTIVATE WINDOW Win_1
return NIL

Function OpenTable()
// USE TEST2 Shared
If !Open_Dbf("TEST2.DBF", .f., .f., "TEST2", "DBFNTX")
   MsgStop("Não foi possível abrir o arquivo: TEST2.DBF")
   Return Nil
Endif
if !File( "TEST2COM.NTX" )
   // Create order by first field plus last field.
   // You can't search by this order. Only for test.
   TEST2->( ordCreate( "TEST2COM.NTX",                     ;
                       "First Name",                       ;
                       "TEST2->First + TEST2->Last",       ;
                       {|| TEST2->First  + TEST2->Last } ) )
endif
if !File( "TEST2LAS.NTX" )
   // Create order by last field.
   TEST2->( ordCreate( "TEST2LAS.NTX",                     ;
                       "Last Name",                        ;
                       "TEST2->Last",                      ;
                       {|| TEST2->Last } ) )
endif
if !File( "TEST2HIR.NTX" )
   // Create order by hiredate field.
   TEST2->( ordCreate( "TEST2HIR.NTX",                     ;
                       "Hire Date",                        ;
                       "TEST2->Hiredate",                  ;
                       {|| TEST2->Hiredate } ) )
endif
if !File( "TEST2AGE.NTX" )
   // Create order by age field.
   TEST2->( ordCreate( "TEST2AGE.NTX",                     ;
                       "Age",                              ;
                       "TEST2->Age",                       ;
                       {|| TEST2->Age } ) )
endif
if !File( "TEST2MAR.NTX" )
   // Create order by.
   // You can't search by this order. Only for test.
   TEST2->( ordCreate( "TEST2MAR.NTX",                     ;
                       "Married",                          ;
                       "TEST2->Married",                   ;
                       {|| TEST2->Married } ) )
endif
TEST2->( ordListAdd( "TEST2COM.NTX", "Primeiro Nomes" ) )
TEST2->( ordListAdd( "TEST2LAS.NTX", "Sobre Nomes" ) )
TEST2->( ordListAdd( "TEST2HIR.NTX", "Data de aluguel" ) )
TEST2->( ordListAdd( "TEST2AGE.NTX", "Idade" ) )
TEST2->( ordListAdd( "TEST2MAR.NTX", "Casado" ) )
TEST2->( ordSetFocus( 1 ) )
Return Nil

Function Open_Dbf(cDbfName, lUseExclusive, lReadonly, cAlias, cRddName, nTries, lAsk)
Local nTriesOrig, lReturn:=.f., lNewArea:=.t.

DEFAULT lNewArea:=.t.
DEFAULT lReadonly:=.f.
DEFAULT lAsk:=.t.
DEFAULT nTries:=5
DEFAULT cRddName:="DBFNTX"

nTriesOrig := nTries
Do While nTries > 0
   DbUseArea(lNewArea,cRddName,cDbfName,cAlias,!lUseExclusive,lReadonly)
   If (!NetErr()) .and. Used()
      lReturn := .t.
      Exit
   Endif
   Inkey(.5)
   nTries--
   If nTries = 0 .and. lAsk
      If MsgRetryCancel(aLng[027]+cDbfName+aLng[143]+CRLF+aLng[144],aLng[145])
         nTries := nTriesOrig
      Endif
   Endif
Enddo
Return lReturn

Function CloseTable()
CLOSE TEST2
Return

Function BasicDemo( cArea )
Local aFieldName   := { "Primeiro Nome", "Sobrenome", "Endereço", "Cidade", ;
                       "Estado", "CEP", "Data Aluguel", "Casado", "Idade", ;
                       "Salário", "Observações" }
Local aFieldAdvise := { "Digite o primeiro nome",                ;
                       "Digite o sobrenome",                    ;
                       "Digite o endereço onde mora",           ;
                       "Digite a cidade onde mora",             ;
                       "Digite o estado (em dois caracteres)",  ;
                       "Entre com o código postal",             ;
                       "Selecione a data de aluguel",           ;
                       "Deixe marcado se for casado",           ;
                       "Entre com a idade",                     ;
                       "Entre com o salário",                   ;
                       "Deixe alguma observação, se for necessário" }
Local aVisTable    := { .t., .t., .t., .t., .f., .f., .f., .f., .t., .t., .f. }
Local aFieldEdit   := { .t., .t., .t., .t., .t., .t., .t., .t., .t., .f., .t. }
Local aOptions     := Array( 3, 2 )
Local bSave        := {|aValues, lNew| Salvar( aValues, lNew, cArea ) }
Local bSearch      := {|| MsgInfo( "Sua rotina de pesquiça" ) }
Local bPrint       := {|| MsgInfo( "Sua rotina para imprimir" ) }
aOptions[1,1] := "Executa opção 1"
aOptions[1,2] := {|| MsgInfo( "Você pode fazer a sua rotina 1" ) }
aOptions[2,1] := "Executa opção 2"
aOptions[2,2] := { || MsgInfo( "Você pode fazer a sua rotina 2" ) }
aOptions[3,1] := "Execute opção 3"
aOptions[3,2] := { || MsgInfo( "Você pode fazer a sua rotina 3" ) }
					   
EDIT EXTENDED WORKAREA &cArea      ;
	TITLE "Employees maintenance" ;
    FIELDNAMES aFieldName         ;
	FIELDMESSAGES aFieldAdvise    ;
    FIELDENABLED aFieldEdit       ;
    TABLEVIEW aVisTable           ;
    OPTIONS aOptions              ;
    ON SAVE bSave                 ;
    ON FIND bSearch               ;
    ON PRINT bPrint
Return Nil

Function Salvar( aValues, lNew, cArea )
Local i := 1

If Empty( aValues[1] )   // Primeiro nome
   MsgInfo( "O nome não pode estar em branco !" )
   Return .f.
Endif

// Calcula o salario
aValues[10] := 100.5

// Salva o registro
If lNew
   (cArea)->( dbAppend() )
Endif
For i := 1 TO Len( aValues )
   (cArea)->( FieldPut( i, aValues[i] ) )
Next
Return .t.
Please return if your tests was made with sucess, otherwise I can send my executable file to prove that is working the way I have indicated.

You can make this PRG in C:\hmg.3.1.3\SAMPLES\EDIT_EXTENDED folder just for testing.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Gustavo Romo
Posts: 29
Joined: Mon Feb 04, 2013 8:39 pm
Location: MEXICO
Contact:

Re: Edit Extended

Post by Gustavo Romo »

Pablo Cesar

My problem is my .bat


when I compile with build.bat your application runs in LANGUAGE correctly

when use my bat, the same problem still remain: language in English

Can you help me, I use minigui extended in my aplication

Mi problema es el bat que utilizo, cuando corro tu ejemplo con el build.bat la aplicacion esta en español
pero cuando lo corro con mi bat, (que adjunto) aparece nuevamente en ingles.

La situación es que no puedo utilizar build.bat porque uso minigui ya que uso mucho tsbrowse

gracias, podrias echarle un ojo a mi bat:

*----------------------------------

@echo off

SET HMGPATH=C:\hmg.3.1.2

SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%

SET HMGRPATH=C:\minigui

echo #define HMGRPATH %HMGRPATH%\RESOURCES > _hmg_resconfig.h

COPY /b %HMGRPATH%\resources\hmg.rc+%1.rc+%HMGRPATH%\resources\filler _temp.rc >>NUL
windres -i _temp.rc -o _temp.o

HBMK2 %1 %2 %3 %4 %5 %6 %7 %8 %HMGRPATH%\minigui.hbc -run

del _hmg_resconfig.h
del _temp.*

*----------------------------------
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Edit Extended

Post by Rathinagiri »

Code: Select all

SET HMGPATH=C:\hmg.3.1.2

SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%

SET HMGRPATH=C:\minigui
The second HMGPATH nullifies the first HMGPATH.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Gustavo Romo
Posts: 29
Joined: Mon Feb 04, 2013 8:39 pm
Location: MEXICO
Contact:

Re: Edit Extended

Post by Gustavo Romo »

there are diferent hmgRpath and hmgpath, if I remove one of them, can't compile my application

I can't use HMG and Minigui at the same time, with other .bat,


No se compilar HMG con Minigui con otro bat, seguramente es mi .bat el que enlaza de tal manera que el edit extended
permanezca en idioma inglés.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Edit Extended

Post by Pablo César »

Gustavo Romo wrote:seguramente es mi .bat el que enlaza de tal manera que el edit extended permanezca en idioma inglés.
Compilé en Minigui puro y el resultado se mostró perfecto para mi, fijate:
Screen88.PNG
Screen88.PNG (21.1 KiB) Viewed 4161 times
En verdad no tengo experiencia alguna con mezclar HMG y Extended. Tenés alguna razón de mantenerte con Extended ? No puedes pasar al HMG ?

---

Compiled in MiniGUI pure and the result was perfect for me and pls note:

In truth I have no experience whatsoever with HMG and Extended mix. You have any reason to stay with Extended? You can not go to HMG?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Gustavo Romo
Posts: 29
Joined: Mon Feb 04, 2013 8:39 pm
Location: MEXICO
Contact:

Re: Edit Extended

Post by Gustavo Romo »

Si de hecho compile el ejemplo y me funcionó perfectamente, pero el .bat marca error al tratar de usarlo en mi aplicacion.

Se que tu ejemplo funciona perfectamente, gracias, por eso me di cuenta que e error es la mezcla entre HMG y Minigui

Lo único que utilizo en minigui es TSbrowse por que me permite editar campos y que el cursor se mueva donde yo lo deseo. (no conozco que Grid pueda hacer eso) -a mi me encanta usar grid y usar arrays

Gracias por tu tiempo y apoyo

P.D. Dato curioso Fijate que si uso en lugar de HBMK2 utilizo Borland, se corrige el problema, pero se tarda mucho en compilar
Post Reply