move a record from xbrowse
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
move a record from xbrowse
it is possible move a record from position x to position y into a xbrowse
because my customer want the possibility to move a record into a table of order ( made with xbrowse) to another position
the customer let me see an old prg made in vb6 he moved the record taking with the mouse and press on recordselector and move it into another position
my customer sad me need it to group products and comments
because my customer want the possibility to move a record into a table of order ( made with xbrowse) to another position
the customer let me see an old prg made in vb6 he moved the record taking with the mouse and press on recordselector and move it into another position
my customer sad me need it to group products and comments
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- Antonio Linares
- Site Admin
- Posts: 42512
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: move a record from xbrowse
I think it can be hard to create ...
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Re: move a record from xbrowse
Silvio,
I have the same problem changing the position.
My solution for the moment :
selecting the 2 records I want to change the position.
Doing the change on button-click
Now the COMPLETE records are changing the position
![Image](http://www.pflegeplus.com/IMAGES/Position1.jpg)
best regards
Uwe![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
I have the same problem changing the position.
My solution for the moment :
selecting the 2 records I want to change the position.
Doing the change on button-click
Now the COMPLETE records are changing the position
![Image](http://www.pflegeplus.com/IMAGES/Position1.jpg)
best regards
Uwe
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Last edited by ukoenig on Tue Nov 10, 2015 6:47 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- FranciscoA
- Posts: 2163
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: move a record from xbrowse
I'm traying it, also. With arrays.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: move a record from xbrowse
Disculpen mi ignorancia, si es con un array no seria mas facil si solo le cambian el valor a oBrw:nArrayAt en ambos lados con el juego de 3 casillas.? digo, si es que se le puede reasignar el valor a nArrayAt y luego hacer un refresh.
La otra idea es crear un registro en blanco, copiar alli uno de los registros, reemplazar los valores a uno de los registros por el que se quiere cambiar, luego copiar el del registro nuevo al cambiado y por ultimo borrar el registro nuevo dublicado...nose si es una loquera lo que digo, solo lo veo en forma de SEUDOCOIDE, habria que ver si es factible en codigo, saludos...![Shocked :shock:](./images/smilies/icon_eek.gif)
La otra idea es crear un registro en blanco, copiar alli uno de los registros, reemplazar los valores a uno de los registros por el que se quiere cambiar, luego copiar el del registro nuevo al cambiado y por ultimo borrar el registro nuevo dublicado...nose si es una loquera lo que digo, solo lo veo en forma de SEUDOCOIDE, habria que ver si es factible en codigo, saludos...
![Shocked :shock:](./images/smilies/icon_eek.gif)
Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- FranciscoA
- Posts: 2163
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: move a record from xbrowse
Silvio wrote: ...the customer let me see an old prg made in vb6 he moved the record taking with the mouse and press on recordselector and move it into another position
José Luis.
La pregunta es: ¿Cómo hacerlo con Drag and Drop?
The question is: How to do it using Drag and Drop?
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: move a record from xbrowse
FranciscoA wrote:Silvio wrote: ...the customer let me see an old prg made in vb6 he moved the record taking with the mouse and press on recordselector and move it into another position
José Luis.
La pregunta es: ¿Cómo hacerlo con Drag and Drop?
The question is: How to do it using Drag and Drop?
Ha bueno, ya eso es otra cosa, yo lo vi solo como un intercambio de posiciones, no por DRAG/DROP.? ya aca debera ver nuestro Mr.Noa o Daniel o AL, que son mas expertos, digo yo ..nose..solo fue una loca idea que se me vino, saludos...
![Shocked :shock:](./images/smilies/icon_eek.gif)
Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- Antonio Linares
- Site Admin
- Posts: 42512
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
Re: move a record from xbrowse
Silvio,
If I click on a row and keep the mouse pressed and move it downwards, then two selected
records appear. Could you try this on your browses and let me know if you get it too ?
![Image](https://bitbucket.org/fivetech/screenshots/downloads/browse_drag.JPG)
If I click on a row and keep the mouse pressed and move it downwards, then two selected
records appear. Could you try this on your browses and let me know if you get it too ?
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 22 times
- Been thanked: 2 times
- Contact:
Re: move a record from xbrowse
Dear Antonio,
what you see is from kinetic behavior.
Best regards,
Otto
what you see is from kinetic behavior.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: move a record from xbrowse
This is an example of moving a row from one position to another position by drag and drop. This is demonstrated with an array
Code: Select all | Expand
#include "fivewin.ch"
function main()
local oDlg, oBrw, oFont, oCur, aData[ 12 ]
AEval( aData, { |u,i| aData[ i ] := NtoCMonth( i ) } )
DEFINE CURSOR oCur DRAG
DEFINE FONT oFont NAME "VERDANA" SIZE 0,-16
DEFINE DIALOG oDlg SIZE 250,500 PIXEL FONT oFont
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE aData COLUMNS 1 CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 1
:oDragCursor := oCur
:bDragBegin := { |r,c,f,o| SetDropInfo( { oBrw:nArrayAt, oBrw:aRow } ) }
:bDropOver := { |u,r,c,f| oBrw:LButtonDown( r,c ), ;
oBrw:LButtonUp(), ;
aDel( aData, u[ 1 ] ), ;
AIns( aData, oBrw:nArrayAt, u[ 2 ] ), ;
oBrw:Refresh() }
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
RELEASE CURSOR oCur
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- FranciscoA
- Posts: 2163
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: move a record from xbrowse
Thanks, Rao.
I tried it and it works well for me.
Tomorrow I will do more tests on medium and large arrays.
Best regards.
I tried it and it works well for me.
Tomorrow I will do more tests on medium and large arrays.
Best regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: move a record from xbrowse
FranciscoA wrote:Thanks, Rao.
I tried it and it works well for me.
Tomorrow I will do more tests on medium and large arrays.
Best regards.
This is a very simple case, works only when the start and destination are both visible on the same screen. This example also does not have any error handling. In real life we may need to handle scrolling also if the destination is several rows away.
This should serve as a simple example to form the basis of a complex final product.
Cut and Paste instead of Drag and Drop:
Instead of using Drag/Drop, we can also use Cut and Paste. Cut the source record, navigate to the new position and then move the record there .
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: move a record from xbrowse
elvira wrote:Mr. Nages,
Can we please have this sample with a DBF?.
Thank you.
This xbrowse example, after the end of the drag, informs the programmer, start record number and destination record number. The programmer has to decide if he wants to swap data of some fields between these two records or wants a visual re-ordering of the rows where the moved record appears in the new position.
First thing to decide is how the programmer wants to record the change in the dbf. Once that is clear, it can be plugged into the bDropOver.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India