Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #10417 > unrolled thread

bBrowser Drag & Drop to multiple cells

Started byPaulo Oliveira <paulofvoliveira@gmail.com>
First post2017-04-12 09:06 -0700
Last post2017-04-13 13:04 -0700
Articles 10 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  bBrowser Drag & Drop to multiple cells Paulo Oliveira <paulofvoliveira@gmail.com> - 2017-04-12 09:06 -0700
    Re: bBrowser Drag & Drop to multiple cells "Jamal" <noooospam@example.com> - 2017-04-12 16:03 -0400
      Re: bBrowser Drag & Drop to multiple cells Paulo Oliveira <paulofvoliveira@gmail.com> - 2017-04-12 14:00 -0700
        Re: bBrowser Drag & Drop to multiple cells "Jamal" <noooospam@example.com> - 2017-04-13 02:47 -0400
    Re: bBrowser Drag & Drop to multiple cells Sherlock <sherlock@sherlock.com.au> - 2017-04-13 05:48 -0700
      Re: bBrowser Drag & Drop to multiple cells Sherlock <sherlock@sherlock.com.au> - 2017-04-13 05:50 -0700
        Re: bBrowser Drag & Drop to multiple cells Paulo Oliveira <paulofvoliveira@gmail.com> - 2017-04-13 06:15 -0700
          Re: bBrowser Drag & Drop to multiple cells Guy Deprez <dpzguy@skynet.be> - 2017-04-13 18:14 +0200
          Re: bBrowser Drag & Drop to multiple cells "Jamal" <noooospam@example.com> - 2017-04-13 14:01 -0400
            Re: bBrowser Drag & Drop to multiple cells Paulo Oliveira <paulofvoliveira@gmail.com> - 2017-04-13 13:04 -0700

#10417 — bBrowser Drag & Drop to multiple cells

FromPaulo Oliveira <paulofvoliveira@gmail.com>
Date2017-04-12 09:06 -0700
SubjectbBrowser Drag & Drop to multiple cells
Message-ID<81dfd79c-12c4-42a0-afb7-784a44945ff7@googlegroups.com>
Hi all,

Is possible Drag a value from one cell into more than one cells in the same record?

My idea is:

C1  C2  C3  C4  C5
--  --  --  --  --
1   0   0   0   0
2   0   0   0   0

Drag the value of C1 column into C2,C3,C4 and C5 with just one drag & drop assignment:

C1  C2  C3  C4  C5
--  --  --  --  --
1   1   1   1   1
2   0   0   0   0

TIA
Paulo Oliveira

[toc] | [next] | [standalone]


#10420

From"Jamal" <noooospam@example.com>
Date2017-04-12 16:03 -0400
Message-ID<ocm16m$60i$1@news.albasani.net>
In reply to#10417
May be with (not tested). You will have to experiment:

bBrowser:DragDropMode := _And(BDDM_SERVER, BDDM_CLIENT)

This will make the bBrowser the server and client of drag and drop 
operation. Then copy the dragged cell to other cells.

Jamal

"Paulo Oliveira"  wrote in message 
news:81dfd79c-12c4-42a0-afb7-784a44945ff7@googlegroups.com...

Hi all,

Is possible Drag a value from one cell into more than one cells in the same 
record?

My idea is:

C1  C2  C3  C4  C5
--  --  --  --  --
1   0   0   0   0
2   0   0   0   0

Drag the value of C1 column into C2,C3,C4 and C5 with just one drag & drop 
assignment:

C1  C2  C3  C4  C5
--  --  --  --  --
1   1   1   1   1
2   0   0   0   0

TIA
Paulo Oliveira 

[toc] | [prev] | [next] | [standalone]


#10422

FromPaulo Oliveira <paulofvoliveira@gmail.com>
Date2017-04-12 14:00 -0700
Message-ID<b8f5de66-c74e-4b77-a420-c132db40aa24@googlegroups.com>
In reply to#10420
Hi Jamal,

I can copy one cell to another cell without any problem, what i want is select C1 to drag and SHIFT (or CTRL) in C3,C4 and C5 for example and drop the value of C1 in the cells C3,C4 and C5.
After i select the cell to drag i want select more than one cell to copy the value.

[toc] | [prev] | [next] | [standalone]


#10424

From"Jamal" <noooospam@example.com>
Date2017-04-13 02:47 -0400
Message-ID<ocn6ua$ran$1@news.albasani.net>
In reply to#10422
You will have to dig deeper in bBrowser to accomplish this.

See the help file and take a look at: bBrowser:SelectionMode which provides 
mouse and keyboard support.
Maybe you can use a Copy operation, then use the select mode action to paste 
the values instead of drag & drop.

Sorry I cannot be more of help on this <g>.

Jamal

"Paulo Oliveira"  wrote in message 
news:b8f5de66-c74e-4b77-a420-c132db40aa24@googlegroups.com...

Hi Jamal,

I can copy one cell to another cell without any problem, what i want is 
select C1 to drag and SHIFT (or CTRL) in C3,C4 and C5 for example and drop 
the value of C1 in the cells C3,C4 and C5.
After i select the cell to drag i want select more than one cell to copy the 
value. 

[toc] | [prev] | [next] | [standalone]


#10426

FromSherlock <sherlock@sherlock.com.au>
Date2017-04-13 05:48 -0700
Message-ID<5baf5415-e682-4981-95f6-8a153c2a6ebc@googlegroups.com>
In reply to#10417
snip[ Is possible Drag a value from one cell into more than one cells in the same record? ]

In the Dropevent you know column you came from and now where you are.

  nStart := SELF:oDCbRecBrowser:CurrentColumn        

 
  for xx := nStart+1 to nEnd
    SELF:oDCbRecBrowser:Server:FIELDPUT(xx)                      
  next

[toc] | [prev] | [next] | [standalone]


#10427

FromSherlock <sherlock@sherlock.com.au>
Date2017-04-13 05:50 -0700
Message-ID<34a639ea-06a7-44bf-b7fd-96d60c810813@googlegroups.com>
In reply to#10426
Woops .. bumped the keyboard post.

Not tested code but would be thinking along these lines.

Start  then end column and loop to fill the field data.

[toc] | [prev] | [next] | [standalone]


#10430

FromPaulo Oliveira <paulofvoliveira@gmail.com>
Date2017-04-13 06:15 -0700
Message-ID<00657a4b-1a8f-451f-914c-1c6f956d50c7@googlegroups.com>
In reply to#10427
quinta-feira, 13 de Abril de 2017 às 13:50:35 UTC+1, Sherlock escreveu:
> Woops .. bumped the keyboard post.
> 
> Not tested code but would be thinking along these lines.
> 
> Start  then end column and loop to fill the field data.

Thanks Jamal, Serlock

I have not tried it but the idea is this, now what I need is to know if the SHIFT key is pressed or not. Like:

if SHIFT is Pressed
 --All cells in the range receive the value
else
 --Only the destination cell receives the value
endif

As I know if the SHIFT key is pressed this is my dilemma

Paulo

Paulo

[toc] | [prev] | [next] | [standalone]


#10436

FromGuy Deprez <dpzguy@skynet.be>
Date2017-04-13 18:14 +0200
Message-ID<et8vec9bbfk6lnrm7h8j77jepfd8svgjb8@4ax.com>
In reply to#10430
Paulo
Maybe can you do something with this ?

lShiftOn   := LOGIC(_CAST, _And(GetKeyState(VK_SHIFT), SHORT(_CAST,
0x8000)))

Guy
On Thu, 13 Apr 2017 06:15:12 -0700 (PDT), Paulo Oliveira
<paulofvoliveira@gmail.com> wrote:

>quinta-feira, 13 de Abril de 2017 às 13:50:35 UTC+1, Sherlock escreveu:
>> Woops .. bumped the keyboard post.
>> 
>> Not tested code but would be thinking along these lines.
>> 
>> Start  then end column and loop to fill the field data.
>
>Thanks Jamal, Serlock
>
>I have not tried it but the idea is this, now what I need is to know if the SHIFT key is pressed or not. Like:
>
>if SHIFT is Pressed
> --All cells in the range receive the value
>else
> --Only the destination cell receives the value
>endif
>
>As I know if the SHIFT key is pressed this is my dilemma
>
>Paulo
>
>Paulo

[toc] | [prev] | [next] | [standalone]


#10437

From"Jamal" <noooospam@example.com>
Date2017-04-13 14:01 -0400
Message-ID<ocoedm$s37$1@news.albasani.net>
In reply to#10430
It looks like you may have missed my other post!

You can set bBrowser:SelectionMode to #Multiple, then bBrowser should handle 
the CTRL + Click and SHIFT + Click for you.

No need to reinvent the wheel.

Jamal


"Paulo Oliveira"  wrote in message 
news:00657a4b-1a8f-451f-914c-1c6f956d50c7@googlegroups.com...

quinta-feira, 13 de Abril de 2017 às 13:50:35 UTC+1, Sherlock escreveu:
> Woops .. bumped the keyboard post.
>
> Not tested code but would be thinking along these lines.
>
> Start  then end column and loop to fill the field data.

Thanks Jamal, Serlock

I have not tried it but the idea is this, now what I need is to know if the 
SHIFT key is pressed or not. Like:

if SHIFT is Pressed
--All cells in the range receive the value
else
--Only the destination cell receives the value
endif

As I know if the SHIFT key is pressed this is my dilemma

Paulo

Paulo 

[toc] | [prev] | [next] | [standalone]


#10438

FromPaulo Oliveira <paulofvoliveira@gmail.com>
Date2017-04-13 13:04 -0700
Message-ID<269b22b5-1c84-4401-b6b6-968571716df4@googlegroups.com>
In reply to#10437
quinta-feira, 13 de Abril de 2017 às 19:01:27 UTC+1, Jamal escreveu:
> It looks like you may have missed my other post!
> 
> You can set bBrowser:SelectionMode to #Multiple, then bBrowser should handle 
> the CTRL + Click and SHIFT + Click for you.
> 
> No need to reinvent the wheel.
> 
> Jamal
> 
> 
> "Paulo Oliveira"  wrote in message 
> news:00657a4b-1a8f-451f-914c-1c6f956d50c7@googlegroups.com...
> 
> quinta-feira, 13 de Abril de 2017 às 13:50:35 UTC+1, Sherlock escreveu:
> > Woops .. bumped the keyboard post.
> >
> > Not tested code but would be thinking along these lines.
> >
> > Start  then end column and loop to fill the field data.
> 
> Thanks Jamal, Serlock
> 
> I have not tried it but the idea is this, now what I need is to know if the 
> SHIFT key is pressed or not. Like:
> 
> if SHIFT is Pressed
> --All cells in the range receive the value
> else
> --Only the destination cell receives the value
> endif
> 
> As I know if the SHIFT key is pressed this is my dilemma
> 
> Paulo
> 
> Paulo

thank you all,

I wanted to prevent the user from selecting multiple cells, that's why I use the CellDragDrop method, now it is working as I want.
Jamal, 
I tried to use SELF: oDCbBQtdTam: SelectionMode: = # MultipleInRow but in the end I had chosen to use the following mechanism that is currently working as the user wants (select a cell and a target cell) by choosing to copy to the range or Only to the target cell.

...
ELSEIF oCellDragEvent:DragMode=BCDM_DROP
 IF oCellDragEvent:Control=SELF:oDCbBQtdTam
    // determine cell under the mouse
    GetCursorPos(@sptCursor)
    ScreenToClient(SELF:oDCbBQtdTam:Handle(), @sptCursor)
    oCell := SELF:oDCbBQtdTam:GetCellToPoint(Point{sptCursor.X, sptCursor.Y})
	IF oCell:RecNo>0 .and. oCell:Column>0
	// activate record under the mouse
       IF   oCell:RecNo<>SELF:oDCbBQtdTam:Server:RecNo					SELF:oDCbBQtdTam:Server:Goto(oCell:RecNo)
ENDIF
				// get column from cell
    oColumn := SELF:oDCbBQtdTam:GetOpenColumn(oCell:Column)
	IF !Empty(oColumn)
	 // copy droped cell value in cell under the mouse
	acCellList := oCellDragEvent:CellList
	nStart := SELF:oDCbBQtdTam:GetOpenColumnNo(String2Symbol(acCellList[1,   1, BCDD_NAME]))
	IF !Empty(acCellList)
	IF !lShiftOn
	oColumn:TextValue := acCellList[1, 1, BCDD_VALUE]
	ELSE
	IF nStart<oCell:Column  //to the right
	FOR i:=nStart+1 UPTO oCell:Column
	oColumn := SELF:oDCbBQtdTam:GetOpenColumn(i)
									 oColumn:TextValue := acCellList[1, 1, BCDD_VALUE]								
	NEXT i	
	ELSE  //to the left
	FOR i:=nStart-1 DOWNTO oCell:Column
	oColumn := SELF:oDCbBQtdTam:GetOpenColumn(i)
									 oColumn:TextValue := acCellList[1, 1, BCDD_VALUE]								
	NEXT i									
	ENDIF
	ENDIF
	SELF:oDCbBQtdTam:Server:Commit()
	IF SELF:oDCbBQtdTam:CurrentRecNo=1
							SELF:oDCfTotPares:Value:=SELF:oDCcart_enc:Value*SELF:oDCbBQtdTam:Total_Pares_Linha(1)
	ENDIF
	ENDIF
ENDIF
ENDIF
...

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web