Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM
  New Posts New Posts RSS Feed - Drag/Drop from ribbon bar button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedDrag/Drop from ribbon bar button

 Post Reply Post Reply
Author
Message
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Topic: Drag/Drop from ribbon bar button
    Posted: 11 May 2010 at 3:25pm
That says it all. I need to drag/drop a button in a group on a ribbon bar to another control. In this case it's a third party graphing control. The part I need is how to start the drag process when User left clicks on a button in a ribbon bar and starts to drag.
 
I see that ribbon bars have drag start and drag drop but I don't see a mouse down to start the process.
 
Simple code example? (I didn't find one in my samples)
 
Using ActiveX v13 in a VB6 app.
 
As always thanks for the great support and help!
 
Gary Henson
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 4:53pm
You can put your buttons in a gallery and check for XTP_GN_STARTDRAG in ControlNotify event. This is how I do it, as I could't find another way.
Product: Codejock Xtreme SuitePro 15.3.1 for CommandBars
SuitePro 16.3.1 for all the rest

OS: Windows 8.1

Language: Visual Objects 2.8
Back to Top
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 5:41pm
Hmm. I'll see if I can do that, but I'm not banking on it as it would radically change the GUI look and feel.
 
Do you have any base code to process the dragstart/dragdrop of the button?
 
I'm hoping I'll get a 'just do this, dummy' response from oleg.
 
Right now I'm experimenting with checking for the control key or menu(alt) key to be down when the button is pressed (in the Execute event code ) to indicate that the User wants to drag drop not select. Seems kludy but may be ok for me.
 
Thanks for your quick response, Carlos!
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2010 at 6:16pm
The GUI look is a litle different, but not that much. You still get hoover effects in the buttons.

Originally posted by garyhenson garyhenson wrote:

Do you have any base code to process the dragstart/dragdrop of the button?


My programming language is very different from VB, but in my ControlNotify Event I have this:

if Code == XTP_GN_STARTDRAG .and. Control:Id == ID_GALLERY_OBJECTS
     oDesignerMenu:OLEDrag()
endif

Then you can process the behavior in OLEStartDrag event
Product: Codejock Xtreme SuitePro 15.3.1 for CommandBars
SuitePro 16.3.1 for all the rest

OS: Windows 8.1

Language: Visual Objects 2.8
Back to Top
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2010 at 12:32pm
My experiment failed of course since cb.Execute is not entered until you have the MouseUp event which will not happen if you try to drag off the button.
 
Sigh. This should not be hard.
 
I'll look into the Gallery idea but I'm really disappointed that the buttons do not support simple drag/drop events or give me MouseMove to play with.
 
Hopefully I'll hear from Oleg or someone at CJ soon about this.
 
Thanks again.
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2010 at 3:32pm
I may want/have to add a commandbar that has buttons or labels on it that I can drag from as well.
 
So I'm looking for a CJ commandbar or ribbonbar taht I can put icons/buttons on (20 or so) and the User can drag one down onto a graphing canvas object I have.
 
I already use the ribbonbar with groups that have buttons so I'd like to drag from the buttons as I've said before.
 
I'm not sure now I can even use a commandbar button to drag!!! Sheesh!
 
 
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2010 at 12:40pm
Carlos/Oleg,
 
I could use some code, even fake code, to implement dragging of a button in a gallery on a ribbon bar to a target control that accepts dragdrop. Whew!
 
I've added catching XT_GN_STARTDRAG in cbMain.ControlNotify as Carlos suggested. In cbMain.ControlNotify() is see XT_GN_STARTDRAG firing and make a call to 'cbMain.OLEDrag()'.
 
In cbMain_OLEStartDrag() I do this :
    Data.Clear
    Data.SetData "xxx", vbCFText
    AllowedEffects = vbDropEffectCopy
 
I see the 'copy' effect now when I drag the button around. BUT I do not get a DragOver event or DragDrop event on my target. As I drag I see the 'copy' icon if I drag over a treeview but I do see the 'cannot drop' icon over my real target control. My real target control WILL accept drag/drop from vb buttons that are dragging.
 
To be clear I'm dragging a button in a gallery in a group on a ribbon bar. The form that hosts the commandbar/ribbonbar has several other forms that share the client area. One form has a treeview. The other form has a graphing control (AddFlow).
 
Though dragging over the treeview shows the drag 'copy' icon it doesnt get the dragdrop event if i release the mouse button even though I have DragMode = Automatic. Dragging over the graphing control gives me the 'cannot drop' icon even though the control has DragMode= Automatic.
 
It seems that even though I get the dragging icon of the CJ button I do not get the dragover or dragdrop events in target controls.
 
Any code/help would be appreciated!
 
Gary
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2010 at 3:02pm
OK, My bad on part of this.
If I set 'OLEDropMode' to Manual on the TreeView and the ReportControl, then I get the OLEDragOver event from dragging the CJ button in a gallery.
 
So it's looking like my graphing control (AddFlow) in a separate form is the problem. A treeview and a reportcontrol in panes on the same form as the commandbar/ribbonbar seems to respond to drag events.
 
The graph control is on a form. The handle to that form is loaded to a pane in the AttachPane() event.
 
So now I'm wondering if the problem is that drag/drop does not get processed on the graph form because it does not or can not recieve events from another form??
 
Sigh.
 
Any thought?
 
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
garyhenson View Drop Down
Groupie
Groupie
Avatar

Joined: 26 September 2008
Location: Frisco, Texas
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote garyhenson Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2010 at 3:48pm
More info, still need second opinons for possible solutions.
 
Seems like CommandBars support OLEDragDrop but not DragDrop. The target control (AddFlow) supports DragDrop but not OLEDragDrop.
 
Sigh.
 
I'm still verifying all this but this could be a killer for me. I need to be able to tell the target control which button was dragged over the canvas.
 
Thanks for any help/suggestions.
 
Gary
Software Developer
Product: Xtreme SuitePro (ActiveX) version 13.0
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2010 at 11:18am
I can't help here. I had a similar problem that I coudn't solve, but I found a few answers from google regarding OLEDragDrop vs DragDrop at the time.
Anyway, support for both DragDrop and OLEDragDrop from CJ controls would save us, poor users, a lot of time and troubles
Product: Codejock Xtreme SuitePro 15.3.1 for CommandBars
SuitePro 16.3.1 for all the rest

OS: Windows 8.1

Language: Visual Objects 2.8
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.