Showing results 1 to 4 of 4

Thread: DragDrop operation

  1. #1

    Default DragDrop operation

    I try to realize Drag&Drop functionality for symbol element in Zenon Runtime mode.
    I have read post http://www.copadata.com/forums/showt...light=dragdrop for example.
    I wrote macros for DragBegin and it works. But when I clicked leftbutton of mouse on symbol and began dragging mouse cursor changed and looked not good for this functionality, see attachments. I tried to change it. But my code don't work.

    Is it possible to change cursor during drag&drop operation? How can to do it?

    Do you plan to develop a good Drag&Drop functionality for symbol in Runtime mode in new versions Zenon?

    Public Const IDC_APPSTARTING = 32650&
    Public Const IDC_HAND = 32649&
    Public Const IDC_ARROW = 32512&
    Public Const IDC_CROSS = 32515&
    Public Const IDC_IBEAM = 32513&
    Public Const IDC_ICON = 32641&
    Public Const IDC_NO = 32648&
    Public Const IDC_SIZE = 32640&
    Public Const IDC_SIZEALL = 32646&
    Public Const IDC_SIZENESW = 32643&
    Public Const IDC_SIZENS = 32645&
    Public Const IDC_SIZENWSE = 32642&
    Public Const IDC_SIZEWE = 32644&
    Public Const IDC_UPARROW = 32516&
    Public Const IDC_WAIT = 32514&
    
    Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" _
           (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
    
    Declare Function SetCursor Lib "user32" _
           (ByVal hCursor As Long) As Long
    
    Function MouseCursor(CursorType As Long)
      Dim lngRet As Long
      lngRet = LoadCursorBynum(0&, CursorType)
      lngRet = SetCursor(lngRet)
    End Function
    
    Public Sub DragBegin_select(obElem As Element, vPosX As Variant, vPosY As Variant)
      Set obElem_DR_begin = obElem
      Call MouseCursor(IDC_HAND)
    End Sub
    Attached Thumbnails Attached Thumbnails cursor.png  

  2. #2

    Default Re: DragDrop operation

    What is it exactly that you want to do?

    Maybe you can use the "lasso" functionality, to get a collection of elements that are selected in the runtime.

    Check out this awesome demo project by HerbertO, that also contains the lasso functionality to select elements in the runtime by dragging a rectangle, and performing a certain action with the selected elements (in this case show a pie graph in the HTML window)

    thread with sample project

  3. #3

    Default Re: DragDrop operation

    It's very interesting example but I want another functionality.
    I want to move symbol in Runtime mode using mouse that it looks like Drag&Drop in windows. I prepared test project, see attachment.
    It works but when I began dragging symbol (symbol "i" in example project) mouse cursor have changed and looked not good for this functionality. I want to use my mouse cursor type during this operation.

    You use Drag&Drop technology in Editor very widely. Do you plan to add this functiolality for symbos in Runtime mode?
    Attached Files Attached Files

  4. #4
    Join Date
    20.08.2009
    Posts
    293

    Default Re: DragDrop operation

    Hi,

    with the current implementation it is not possible to change the mouse cursor from VBA.

    I googled a bit and I think it's also not possible to change the global Windows cursor using API calls or something similar.

    Regards,
    Bernhard

Similar Threads

  1. Touchscreen operation: deactivation of mouse cursor
    By herberto in forum zenon Operator
    Replies: 0
    Last Post: 7th May 2010, 09:18

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •