HMG 3.3.0 (Stable)

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2025
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 60 times
Been thanked: 11 times
Contact:

Re: HMG 3.3.0 - Grid

Post by danielmaximiliano » Thu Jun 12, 2014 12:37 am

Pablo César wrote: IMHO this function would need to have some option for fails returning or make escape from the grid. Most probably Dr. Soto could give us an opinion, because quite recently I read something that he has implemented around, see this message about events of the grid from Claudio.
esperemos las buenas nuevas que indica Claudio entonces.

hopefully the good news that indicates Claudio then.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
srvet_claudio
Posts: 1924
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 27 times
Been thanked: 99 times
Contact:

Post by srvet_claudio » Thu Jun 12, 2014 1:03 am

danielmaximiliano wrote:
Pablo César wrote: IMHO this function would need to have some option for fails returning or make escape from the grid. Most probably Dr. Soto could give us an opinion, because quite recently I read something that he has implemented around, see this message about events of the grid from Claudio.
esperemos las buenas nuevas que indica Claudio entonces.

hopefully the good news that indicates Claudio then.
Hi Daniel,
the ON KEY event only process the key pressed and continue the execution (return NIL), if you desire not continue the execution should be return 1

Code: Select all

ON CLICK click()

function click
  Form_1.Text_1.SetFocus
return 1
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Thu Jun 12, 2014 1:07 am

srvet_claudio wrote:if you desire not continue the execution should be return 1

Code: Select all

ON CLICK click()

function click
  Form_1.Text_1.SetFocus
return 1
Yeah ! Its working... we have to understand better all of these cases of events... we are beginners in this...

Thank you Claudio ! :D
Screen6.PNG
Screen6.PNG (11.69 KiB) Viewed 655 times
Daniel, what do you intend to do in this click function ? Can you tell us ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
danielmaximiliano
Posts: 2025
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 60 times
Been thanked: 11 times
Contact:

Post by danielmaximiliano » Thu Jun 12, 2014 1:19 am

Si Claudio. vuelve al TextBox como queria.

ahora voy a ver como soluciono que no queda el elemento del Grid que seleccione con el mouse.

te comento : con la impresora fiscal la AFIP dice que en ventas todo producto que sea capturado con el Scanner necesita tener conmitancia; o sea si se capturo se necesita imprimir sin mas cuestion.

una modificacion de esta aplicacion no utiliza impresora fiscal, asi que puedo manejas el GRID de ventas a mi antojo, por ello le permito modificar cantidad, precio del articulo por ello necesito que me indique mediante el mouse el articulo y que regrese al Textbox. ahora lo hace pero no me deja en el grid la seleccion . (nose si se comprende)
si hay 10 articulos en el grid y hago click sobre el articulo 4, este no queda seleccionado como antes pero si vuelve al textbox.

voy a hacer las modificaciones necesarias para ello..
Sludos y gracias por la ayuda.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Thu Jun 12, 2014 1:23 am

Daniel,

Solo para tu referencia, el ejemplo C:\hmg.3.3.0\SAMPLES\Controls\Grid\GridOnKeyOnClick\demo.prg te muestra la funcion CellRowFocused. Espero que la informacion te sirva.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
danielmaximiliano
Posts: 2025
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 60 times
Been thanked: 11 times
Contact:

Post by danielmaximiliano » Thu Jun 12, 2014 1:29 am

Pablo César wrote:Daniel,

Solo para tu referencia, el ejemplo C:\hmg.3.3.0\SAMPLES\Controls\Grid\GridOnKeyOnClick\demo.prg te muestra la funcion CellRowFocused. Espero que la informacion te sirva.
Thanks Pablo for the topic.
add these lines in my application and it works as before.

Code: Select all

function click ()
   Ventas.Articulos.VALUE: = Ventas.Articulos.CellRowClicked
   Ventas.Articulos.SetFocus
   Ventas.Text_1.SetFocus
return 1
el build necesita correccion, al faltar el archivo .hbp al hacer doble click sobre build.bat se genera un .exe sin nombre.

the build requires correction, the missing file .hbp double clicking on it build.bat generates a .exe
unnamed.
2014-06-11 22_59_04-GridOnKeyOnClick.jpg
2014-06-11 22_59_04-GridOnKeyOnClick.jpg (28.67 KiB) Viewed 643 times
Last edited by danielmaximiliano on Thu Jun 12, 2014 2:02 am, edited 1 time in total.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Thu Jun 12, 2014 1:56 am

danielmaximiliano wrote:el build necesita correccion, al faltar el archivo .hbp al hacer doble click sobre build.bat se genera un .exe sin nombre.
Que sugieres como hacerlo ? Hay que tomar en cuenta que pueden haber vários demos, varios prgs en la misma carpeta...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
srvet_claudio
Posts: 1924
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 27 times
Been thanked: 99 times
Contact:

Post by srvet_claudio » Thu Jun 12, 2014 1:58 am

danielmaximiliano wrote:Si Claudio. vuelve al TextBox como queria.

ahora voy a ver como soluciono que no queda el elemento del Grid que seleccione con el mouse.

te comento : con la impresora fiscal la AFIP dice que en ventas todo producto que sea capturado con el Scanner necesita tener conmitancia; o sea si se capturo se necesita imprimir sin mas cuestion.

una modificacion de esta aplicacion no utiliza impresora fiscal, asi que puedo manejas el GRID de ventas a mi antojo, por ello le permito modificar cantidad, precio del articulo por ello necesito que me indique mediante el mouse el articulo y que regrese al Textbox. ahora lo hace pero no me deja en el grid la seleccion . (nose si se comprende)
si hay 10 articulos en el grid y hago click sobre el articulo 4, este no queda seleccionado como antes pero si vuelve al textbox.

voy a hacer las modificaciones necesarias para ello..
Sludos y gracias por la ayuda.
Daniel,
estas son funciones nuevas disponibles en HMG.3.3.0

Code: Select all

         - <ParentWindowName>.<GridControlName>.CellRowFocused   --> nCellRowIndex
         - <ParentWindowName>.<GridControlName>.CellColFocused   --> nCellColIndex
         - <ParentWindowName>.<GridControlName>.CellRowClicked   --> nCellRowIndex
         - <ParentWindowName>.<GridControlName>.CellColClicked   --> nCellColIndex
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Thu Jun 12, 2014 2:10 am

Pablo César wrote:
danielmaximiliano wrote:el build necesita correccion, al faltar el archivo .hbp al hacer doble click sobre build.bat se genera un .exe sin nombre.
Que sugieres como hacerlo ? Hay que tomar en cuenta que pueden haber vários demos, varios prgs en la misma carpeta...
In this case, the main Build.bat should no takeplace for compiling. So I propose to change main at C:\hmg.3.3.0\Build.bat as follows:
@echo off

rem *******************************************************************************
rem SYNTAX
rem *******************************************************************************
rem build [ /n ] [ /d ] [ /c ] <program.prg> | <project.hbp> [<hbmk2 params>]
rem
rem /n no run after build
rem /d enabled debugger
rem /c console mode
rem
rem
rem This batch file passes information to hbmk2 to make possible an easy (zero
rem configuration build of HMG applications).
rem
rem You can achieve a customized build passing parameters directly to hbmk2.
rem Please, take a look at hbmk2 help:
rem
rem hbmk2 --help

rem *******************************************************************************
rem SET DEFAULT OPTIONS
rem *******************************************************************************

set gtdrivers=-gtgui -gtwin
set runafterbuild=.t.
set debug=

rem ******************************************************************************
rem DELETE FILES FROM PREVIOUS BUILD
rem ******************************************************************************

if exist build.log del build.log
if exist error.log del error.log
if exist init.cld del init.cld

rem ******************************************************************************
rem SET HMGPATH
rem ******************************************************************************
rem
rem Using %~dp0 the HMGPATH is automatically set to current (hmg) folder making it
rem portable (zero config)

SET HMGPATH=%~dp0

rem ******************************************************************************
rem SET BINARIES PATHS
rem ******************************************************************************

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

rem *******************************************************************************
rem PROCESS PARAMETERS
rem *******************************************************************************
rem
rem /n no run after build
rem /d enabled debugger
rem /c console mode
rem

if "%1"=="" goto End
if [%1]==[/n] set runafterbuild=.f.
if [%1]==[/n] shift

if [%1]==[/d] set gtdrivers=-gtwin -gtgui
if [%1]==[/d] set debug=-b
if [%1]==[/d] echo options norunatstartup > init.cld
if [%1]==[/d] shift

if [%1]==[/c] set gtdrivers=-gtwin -gtgui
if [%1]==[/c] shift

rem ******************************************************************************
rem COMPILE RESOURCES
rem ******************************************************************************

echo #define HMGRPATH %HmgPath%\RESOURCES > _hmg_resconfig.h
COPY /b %HMGPATH%\resources\hmg.rc+"%~n1.rc"+%HMGPATH%\resources\filler _temp.rc >NUL
windres -i _temp.rc -o _temp.o >windres.log 2>&1

rem *******************************************************************************
rem SET PROJECT OUTPUT FILE NAME
rem *******************************************************************************
rem
rem The first parameter sent to hbmk2 is -o%~n1.exe. I've added to it create the
rem application with the project basename (<projectname.hbp> specified by the user.

rem *******************************************************************************
rem SET DEFAULT CONFIGURATION FILE
rem *******************************************************************************
rem
rem The second parameter sent to hbmk2 is the hmg.hbc script to set config required.

rem *******************************************************************************
rem SET QUIET MODE
rem *******************************************************************************
rem
rem The third parameter sent to hbmk2 is -q (Harbour quiet mode)

rem ******************************************************************************
rem CALL HBMK2
rem ******************************************************************************

rem HBMK2 -mt -o%~n1.exe %HMGPATH%\hmg.hbc %gtdrivers% %debug% -q %1 %2 %3 %4 %5 %6 %7 %8 >hbmk.log 2>&1
HBMK2 -mt -o"%~n1" %HMGPATH%\hmg.hbc %gtdrivers% %debug% -q %1 %2 %3 %4 %5 %6 %7 %8 >hbmk.log 2>&1

rem ******************************************************************************
rem CREATE LOGS
rem ******************************************************************************

if errorlevel 1 if exist windres.log copy /a windres.log+hbmk.log error.log >nul
if errorlevel 1 if not exist windres.log copy /a hbmk.log error.log >nul

if errorlevel 0 if exist windres.log copy /a windres.log+hbmk.log build.log >nul
if errorlevel 0 if not exist windres.log copy /a hbmk.log build.log >nul

rem ******************************************************************************
rem CLEANUP
rem ******************************************************************************

if exist windres.log del windres.log
if exist hbmk.log del hbmk.log
if exist _hmg_resconfig.h del _hmg_resconfig.h
if exist _temp.rc del _temp.rc
if exist _temp.o del _temp.o

rem ******************************************************************************
rem SHOW LOG
rem ******************************************************************************

if exist error.log type error.log
if exist build.log type build.log

rem ******************************************************************************
rem RUN APPLICATION
rem ******************************************************************************

if [%runafterbuild%]==[.f.] goto END
if exist dat GOTO OTHER
if exist "%~n1".exe "%~n1".exe
GOTO END
:OTHER
SET /p "OTHER=" <dat
COPY "%~n1".exe %other%
if errorlevel 1 goto END
if exist "%~n1".exe %other%\"%~n1".exe
:END
See at first line of PROCESS PARAMETERS. This Build.bat is also prepared to build for long names for hbp or prg files names.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
danielmaximiliano
Posts: 2025
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 60 times
Been thanked: 11 times
Contact:

Post by danielmaximiliano » Thu Jun 12, 2014 3:07 am

Pablo :
un Batch que procese un archivo .HBP si este existe. sino que busque dentro de los .PRG "Function Main" y de esa manera compilar el programa principal.

Pablo:
to process a batch file. HBP if it exists. but look within. PRG "Main Function" and thus compiling the main program.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

Post Reply