TREE control used as main menu - problems

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: TREE control used as main menu - problems

Post by Agil Abdullah »

Hi Andy,

I took a test on your demo-menu, I found it oke.
I am learning. Thanks. :)

-Agil
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

Re: TREE control used as main menu - problems

Post by asacaric »

I must say that GRID control doesn't work as it should :shock:
ARTIKLI.DBF has 4 INDEXes that are selected via ON HEADCLICK.
ON HEADCLICK changes INDEX ORDER, but I didn't find out how to stay on selected record.
Sometimes it stays, sometimes it does not.
I've tried your examples and advices and it really doesn't work - it is not usable.

After switching to BROWSE control, everything works as it should.

Code: Select all

function ARTIKLI_SORT
  parameters morder
  
  select artikli
  private mrn := recno()
  set order to morder
  dbgoto(mrn)

  FORM_ARTIKLI.BROWSE_artikli.refresh
return nil
Any suggestion?
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: TREE control used as main menu - problems

Post by andyglezl »

Hola asacaric / Hello asacaric
3) File ARTIKLI.DBF is opened with 4 indexes and I use ON HEADCLICK to SET ORDER.
How to stay on current RecNo() after SET ORDER? If I use GRID_ARTIKLI.REFRESH, it moves on 1st record.
If I don't refresh, GRID_ARTIKLI isn't refreshed and doesn't show correct data.
Si el "CONTROL BROWSE" te funciona, cual es la razón de querer utilizar el CONTROL GRID ???

El BROWSE trabaja directamente con la DB (por eso, el RecNo() esta bien)
y el "CONTROL GRID" es un ARRAY intermedio (físicamente debería estar donde mismo) pero la posición en el array
va a cambiar dependiendo del orden de tu indice.

A menos que le falte esa propiedad al GRID :roll:
------------------------------------------------------------------------------------------------------
If "CONTROL BROWSE" works for you, which is the reason for wanting to use the GRID CONTROL ???

The BROWSE works directly with the DB (hence, the RecNo () is fine)
and "CONTROL GRID" is an intermediate ARRAY (physically where it should be) but the position in the array
will change depending on the order of your index.

Unless lacks that property to GRID :roll:
Andrés González López
Desde Guadalajara, Jalisco. México.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: TREE control used as main menu - problems

Post by Javier Tovar »

Hola asacaric,

aparentemente esta bien tu rutina, pero sería más claro que hicieras un demo minimo con el mal funcionamiento, de esa manera compilamos y probamos! y así es más rápida la ayuda :D

Saludos
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Hello asacaric,

apparently okay your routine, but you did would be clearer with a minimum demo malfunction, so that compile and test! and yes is faster aid: D

greetings
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

Re: TREE control used as main menu - problems

Post by asacaric »

I thought that GRID control supersedes BROWSE, I don't know where I read this. And speed tests shows that GRID is faster than BROWSE.

Anyway, thanks to you, my friends, my project is growing every day. The core of this project will be used in other projects and I just want to make it right.
I want every single PRG to be like an object that can be included in another project. It's a bit harder at begining, but I think this is the right way.
At the end, I'll put my entire project here.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: TREE control used as main menu - problems

Post by Javier Tovar »

También con Grid se puede manejar la DBF por eso tiene la clausula:

ROWSOURCE <cRowSource>] Y COLUMNFIELDS <acColumnFields>

A lo mejor hay algo raro por ahi!

Saludos
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: TREE control used as main menu - problems

Post by Javier Tovar »

asacaric wrote:I thought that GRID control supersedes BROWSE, I don't know where I read this. And speed tests shows that GRID is faster than BROWSE.
Claro que Grid esta remplazando a BROWSE, es más rápido, creo que nada más es cuestión de saberlo manejar, este control si ponemos unos parametros que manejamos con arrays cuando trabajamos con DBF si tiene un comportamiento extraño, pero si ponemos nada más los necesarios y en el orden de la definición del GRID, GRID es muy bueno!

Saludos
///////////////////////////////////////////////////////////////////
Sure BROWSE Grid is replacing, is faster, think anything else is a matter of knowing manage this control if we put a few parameters to handle with arrays when working with DBF has odd behavior, but if we needed anything else and in the order of definition of GRID, GRID is very good!

greetings

Jajaja ni cuenta me di, por la velocidad del GRID!!! :D :D :D
Last edited by Javier Tovar on Tue Sep 02, 2014 5:13 pm, edited 1 time in total.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: TREE control used as main menu - problems

Post by andyglezl »

Javier, parece que hiciste traducción del español al español y ya ves como es google... :lol:
Claro this Rejilla Que remplazando una BUSCA, es Más Rápido, Creo Que Nada más es Cuestión de saberlo manejar, de control this ponemos SI UNOS parametros Que manejamos estafa arrays CUANDO trabajamos estafa DBF si la ONU Tiene comportamiento extraño, Pero si ponemos Nada Mas los necesarios y en el Orden de la Definición del GRID, GRID es Muy bueno!
Andrés González López
Desde Guadalajara, Jalisco. México.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: TREE control used as main menu - problems

Post by Javier Tovar »

andyglezl wrote:Javier, parece que hiciste traducción del español al español y ya ves como es google...
Jajaja ni cuenta me di por la velocidad del "GRID" :D :D :D
User avatar
asacaric
Posts: 9
Joined: Mon May 05, 2014 1:12 pm
Location: Croatia

Re: TREE control used as main menu - problems

Post by asacaric »

dedos rápidos, ha ha
Post Reply