Xbrowse : Delete and autoshift left .or. Drag/Drop

Xbrowse : Delete and autoshift left .or. Drag/Drop

Postby Marc Venken » Mon Apr 24, 2023 12:05 pm

Image

In this browse I have 12 pics on a row ( Pic1 - Pic2 - Pic3 .... )

I need to do folowing 2 things and hope to get some idea's how to do it in Xbrowse.

1.
When I delete pic 2 the pictures from Pic3 to Pic12 should shift to left and become the Pic2 position so there is no empty cel. the empty cel is going to be the last one,
most right on the last free position. Pic 12 would be the empty cell.

2. Is drag and drop possible within the same row ? So drag pic 5 and drop on pic 2, pic2 and all others shift to the right and the dragged pic become the pic2.

Or for point 2 better to create a dialog with 2 xbrowse and drag/drop on that dialog and copy back to complete the modifications ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : Delete and autoshift left .or. Drag/Drop

Postby Natter » Mon Apr 24, 2023 2:15 pm

You can try this
1.
Code: Select all  Expand view
adel(oBrw:aArrayData[nn], 2)
   atail(oBrw:aArrayData[nn])=NIL
   oBrw:DrawSelect()

2
Code: Select all  Expand view
for st=1 to nn
     oBrw:aCols[st]:bRClickData:=&('{||Out_Elm('+ltrim(str(st))+')}')
     oBrw:aCols[st]:bLDClickData:=&('{||Ins_Elm('+ltrim(str(st))+')}')
  next

  procedure Out_Elm(col)
  local row:=oBrw:nArrayAt
     oBrw:Cargo:=oBrw:aArrayData[row,col]
     adel(oBrw:aArrayData[row], col)
  return

 procedure Ins_Elm(col)
     ains(oBrw:aArrayData[row], oBrw:Cargo, col)
     oBrw:DrawSelect()
 return
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: Xbrowse : Delete and autoshift left .or. Drag/Drop

Postby Marc Venken » Mon Apr 24, 2023 6:31 pm

Forgot to mention that I use DBF file with xbrowse.
Looking into the code, but all new to me ))))
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : Delete and autoshift left .or. Drag/Drop

Postby nageswaragunupudi » Mon Apr 24, 2023 7:32 pm

1.
When I delete pic 2 the pictures from Pic3 to Pic12 should shift to left and become the Pic2 position so there is no empty cel. the empty cel is going to be the last one,
most right on the last free position. Pic 12 would be the empty cell.

2. Is drag and drop possible within the same row ? So drag pic 5 and drop on pic 2, pic2 and all others shift to the right and the dragged pic become the pic2.

Or for point 2 better to create a dialog with 2 xbrowse and drag/drop on that dialog and copy back to complete the modifications ?

Both 1 and 2 are quite possible inside a single browse.

I guess you want the field data in the dbf also to be changed. Right?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse : Delete and autoshift left .or. Drag/Drop

Postby Marc Venken » Mon Apr 24, 2023 7:34 pm

nageswaragunupudi wrote:
1.
When I delete pic 2 the pictures from Pic3 to Pic12 should shift to left and become the Pic2 position so there is no empty cel. the empty cel is going to be the last one,
most right on the last free position. Pic 12 would be the empty cell.

2. Is drag and drop possible within the same row ? So drag pic 5 and drop on pic 2, pic2 and all others shift to the right and the dragged pic become the pic2.

Or for point 2 better to create a dialog with 2 xbrowse and drag/drop on that dialog and copy back to complete the modifications ?

Both 1 and 2 are quite possible inside a single browse.

I guess you want the field data in the dbf also to be changed. Right?


Yes, Indeed. Afther changes, I will upload to a API webshop
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : Delete and autoshift left .or. Drag/Drop

Postby Marc Venken » Wed Apr 26, 2023 7:38 pm

nageswaragunupudi wrote:
1.
When I delete pic 2 the pictures from Pic3 to Pic12 should shift to left and become the Pic2 position so there is no empty cel. the empty cel is going to be the last one,
most right on the last free position. Pic 12 would be the empty cell.

2. Is drag and drop possible within the same row ? So drag pic 5 and drop on pic 2, pic2 and all others shift to the right and the dragged pic become the pic2.

Or for point 2 better to create a dialog with 2 xbrowse and drag/drop on that dialog and copy back to complete the modifications ?

Both 1 and 2 are quite possible inside a single browse.

I guess you want the field data in the dbf also to be changed. Right?


Can you give me a hint, so that I can hunt for samples in the forum ? Many thanks
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 54 guests