Edit Extended / Edit WorkArea - ABM / ABM2

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 1963
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 10 times
Been thanked: 8 times
Contact:

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by danielmaximiliano » Tue Jan 12, 2016 8:42 pm

Rubenalf, bienvenido a HMGforum!!!
gracias por el interes y mejoras que propone.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp / Telegrams To cel +54 011 690 26 142

rubenalf
Posts: 9
Joined: Mon Jan 11, 2016 5:55 pm
Been thanked: 1 time

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by rubenalf » Tue Jan 12, 2016 11:04 pm

Thanks to you all
Gracias a todos

rubenalf
Posts: 9
Joined: Mon Jan 11, 2016 5:55 pm
Been thanked: 1 time

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by rubenalf » Wed Jan 13, 2016 4:07 am

Item 3 - Fine ajustment of the controls.
The aproach I've used is to save the arrays "aLabel" and "aControl" to a file in memory "(dbname).EditConfig".
Next time the function is used, it will load it from memory if it exist, else it will create it in the usual way.
That is done and seems to work fine. If you need to begin again just erase "(dbname).EditConfig"

Next step is to make a procedure to modify the arrays. I made it, based on Esgici's LSanyArr
It is meant just for small changes (no wysiwyg) even while you could change anything around it is not recomended because you can easily make a mess (no checks at all).

It is working standalone (atached), but when I try to integrate everything it won't compile.
I used the same code, only changing the name of the function (coudn't be "main") and the window attribute "main" to "modal" and compliler gives "error on windows definition".
It will compile defining the window as anything but "modal" of course gives error on execute time because it is called from a modal windows (and it should be modal too) if the atrib is "main" it will logically fail when executed (there is already a main window).

Any idea what is wrong? why it did not let me define the window as "modal" ?
______

Item 3 - Ajuste fino de los controles.
La idea inicial es grabar las matrices "aLabel" y "aControl" a un archivo en memoria llamado "(dbname).EditConfig".
La próxima vez que se use la función ABM2(), las leerá del mencionado archivo si este existe, caso contrario las crea en la forma habitual. Si necesitas volver a empezar simplemente lo borras
Esta parte ya está hecha y parece funcionar bien.

El próximo paso es desarrollar un procedimiento para modificar las matrices. Ya está hecho basado en LSanyArr de Mr Esgici.
El objetivo es realizar solamente pequeños cambios (no es visual) si bien puedes cambiar todo lo que quieras, no es recomendable porque no efectúa ninguna verificación.

Funciona bien por si mismo (adjunto) pero no puedo integrarlo con "edit extended".
Copio el mismo programa, cambiando solamente el nombre de la función (no puede llamarse "main") y el atributo "main" de la ventana a "modal" pero no compila: Da error en la definición de la ventana
Compila si en lugar de "modal" uso cualquier otra opción (como "main" ó "child) pero por supuesto da error al ejecutarlo: con "main" porque ya existe (obvio) y cualquier otro porque al ser llamado desde una ventana "modal" también debe ser "modal"

Alguna idea porqué no me deja compilar la ventana como "modal"?
Attachments
lsArray.rar
(1.03 MiB) Downloaded 35 times

User avatar
esgici
Posts: 4245
Joined: Wed Jul 30, 2008 9:17 pm
Location: iskenderun / Turkiye
Has thanked: 128 times
Been thanked: 40 times
Contact:

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by esgici » Wed Jan 13, 2016 6:49 am

rubenalf wrote:Item 3 - Fine adjustment of the controls.
...
Any idea what is wrong? why it did not let me define the window as "modal" ?
...
Hi Ruben

Probably you need to use SET WINDOW MAIN OFF/ON command.

Official sample : <your_HMG_Folder>\SAMPLES\Miscellaneous\ScreenSplash

Another approach is in here.

I hope this feature will help you :arrow:

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D

rubenalf
Posts: 9
Joined: Mon Jan 11, 2016 5:55 pm
Been thanked: 1 time

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by rubenalf » Fri Jan 15, 2016 12:11 am

Hi.
Finally it works .
Modification to alter the position of the controls.
It should be called as follows:

Code: Select all

        LOCAL aOptions     := Array( 1, 2 )
        aOptions[1,1] := "Edit Control positions"
        aOptions[1,2] := { || ModificarArray() }
   ABM2("dbName", , , , , , aOptions )         
I did not try with different parameters . Probably it will fail
Attached comparative images with some changes
I hope someone like it

--------------------------Español--------------------------
Hola.
Finalmente trabaja.
Modificación para alterar la posición de los controles.
Debe ser llamada como sigue:

Code: Select all

        LOCAL aOptions     := Array( 1, 2 )
        aOptions[1,1] := "Alterar posición de Controles"
        aOptions[1,2] := { || ModificarArray() }
   ABM2("dbName", , , , , , aOptions )         
No lo probé con otros parámetros. Probablemente falle
Adjunto imagenes comparativas con algunos cambios
Espero que a alguien le interese
Attachments
Concept2colAlter.png
After some editing / Con cambios manuales
Concept2colAlter.png (11.86 KiB) Viewed 472 times
Concept2col.png
Auto generated / Autogenerada
Concept2col.png (12.12 KiB) Viewed 472 times

User avatar
luisvasquezcl
Posts: 959
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Been thanked: 2 times
Contact:

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by luisvasquezcl » Fri Jan 15, 2016 12:22 pm

Hola Rubenalf
se ve bastante bien, además de ser muy útil.
gracias por tu aporte.
saludos cordiales,
Luis Vásquez.

rubenalf
Posts: 9
Joined: Mon Jan 11, 2016 5:55 pm
Been thanked: 1 time

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by rubenalf » Fri Jan 15, 2016 4:15 pm

Gracias a vos Luis

I forgot to upload the program, sorry

Olvidé subir el programa acá va
Attachments
edit-SaveArr.prg.zip
Edit Extended Modificado
(18.27 KiB) Downloaded 62 times

rubenalf
Posts: 9
Joined: Mon Jan 11, 2016 5:55 pm
Been thanked: 1 time

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by rubenalf » Wed Feb 15, 2017 11:48 pm

Hi all
(Español más abajo)

I have made some changes on Edit Extended to get ComboBox’s

This change is not related with any other change I have made
(I can easily made it over the original "h_edit.prg", if anyone ask for it)

You do not need to pass any parameters, only you must create a
simple function for each ComboBox needed before calling ABM2()

The function will be named “CB_dbasename_fieldname()”. That is:

“CB” → ComboBox
dbasename → name of the related .DBF file name (or alias if used)
fieldname → name of the related text FIELD

If the respective function is found, it will be used to make a ComboBox;
other way a standard TextBox is made.

The function should return an array with the list of options (see demo.prg near line 100)

I hope this be helpfull por someone else. I feel still this is a great tool.
_____________________

He realizado algunos cambios al Edit Extended para tener ComboBox’es

Esto no guarda relación con otros cambios que hice
(puedo aplicarlo fácilmente sobre el "h_edit.prg" original, si a alguien le interesa)

No se necesita pasar ningún parámetro, solamente se debe crear una
función para cada ComboBox necesario antes de llamar ABM2()

La función se llamará “CB_dbasename_fieldname()”. Esto es:

“CB” → ComboBox
dbasename → nombre de el ARCHIVO .dbf relacionado (o alias si es usado)
fieldname → nombre de el CAMPO de texto relacionado

Si la respectiva función es hallada, se usará para construir el ComboBox;
de lo contrario, se construirá un TextBox estándar.

La función deberá devolver (return) la lista de opciones (ver demo.prg cerca de la linea 100)

Espero que se útil para alguien más. Yo sigo pensando que es una gran herramienta.
Attachments
Editex_Demo.zip
(49.28 KiB) Downloaded 11 times
Editex_ComboBox.jpg
Editex_ComboBox.jpg (81.68 KiB) Viewed 63 times

User avatar
serge_girard
Posts: 1415
Joined: Sun Nov 25, 2012 2:44 pm
Location: Belgium
Has thanked: 114 times
Been thanked: 17 times
Contact:

Re: Edit Extended / Edit WorkArea - ABM / ABM2

Post by serge_girard » Thu Feb 16, 2017 7:58 am

Thanks RubenAlf!
Serge

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

Edit Extended / Edit WorkArea - ABM / ABM2

Post by Pablo César » Thu Feb 16, 2017 9:39 am

Hola Ruben,

Muchas gracias por tu contribuicion.

Al compilar tu ejemplo emitió un error:
hbmk2: Error: Referenciado, faltando, funciones desconocida(s): BIGELEM()
Te faltó anexar la funcion BIGELEM. La encontré, seria esta ?

Code: Select all

/*
===============================================================
| FUNCTION BIGELEM()
===============================================================
| 
|  Short:
|  ------
|  BIGELEM() Returns length of longest string in an array
| 
|  Returns:
|  --------
|  <nLength> => Length of longest string in an array
| 
|  Syntax:
|  -------
|  BIGELEM(aTarget)
| 
|  Description:
|  ------------
|  Determines the length of the longest string element
|  in <aTarget> Array may have mixed types
| 
|  Examples:
|  ---------
|  BIGELEM(  {"1","22","333"}  )  => returns 3
| 
|  Notes:
|  -------
|  This was a C function in previous SuperLibs
| 
|  Source:
|  -------
|  S_BIGEL.PRG
| 
===============================================================*/
Function BigElem(aArray)
LOCAL nIterator, nLongest := 0

FOR nIterator = 1 to Len(aArray)
    If ValType(aArray[nIterator])=="C"
       nLongest := Max(nLongest, HMG_Len(aArray[nIterator]))
    Endif
NEXT
Return nLongest
Ruben wrote:Espero que se útil para alguien más. Yo sigo pensando que es una gran herramienta.
Si, a mi me vendrá de diez ! :P
Pienso igual: Edit Extended es una excelente herramienta.
 
Un gran abrazo.
 
Googled
Hi Ruben,

Thank you very much for your contribution.

When you compiled your example it gave an error:
Hbmk2: Error: Referenced, Missing, Unknown Function(s): BIGELEM()
 
You missed attaching the BIGELEM function. I found it, would it be this ?

<See above source code>
Ruben wrote:I hope it will be useful for someone else. I still think it's a great tool.
Yes, I'll be ten for me ! :P
I think the same: Edit Extended is an excellent tool.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest