Showing results 1 to 5 of 5

Thread: Picture Command Positioning

  1. #1
    Join Date
    29.07.2007
    Posts
    10

    Default Picture Command Positioning

    Is it possible to position the picture command pop-up relative to the cursor position on a multi monitor? Pop-up will always appear on the left hand side of the first screen when executed from second screen. Can VB be used to reposition the picture in 6.22?

  2. #2
    juergenr Gast

    Default Re: Picture Command Positioning

    Quote Originally Posted by djgaunt View Post
    Is it possible to position the picture command pop-up relative to the cursor position on a multi monitor? Pop-up will always appear on the left hand side of the first screen when executed from second screen. Can VB be used to reposition the picture in 6.22?
    Hi djgaunt,

    In order to position the picture command pop-up relative to the mouse cursor you have to change a property of the template on which your command picture refers to. Do like that:
    Go to "Templates" in the zenon project tree. Mark your template for the command picture. Go to property "Position"->"Positioning" and select "relative to mouse pointer".

    Best regards,
    JuergenR

  3. #3
    Join Date
    29.07.2007
    Posts
    10

    Default Re: Picture Command Positioning

    Thanks for quick reply. I had already tried your suggestion, which works fine if the the picture command is iniated from first screen. However from the second screen the popup still appears on tbe first, the top of popup is correct relative to mouse y-position but the right side of the popup is at the left hand side of the first screen. The popup can be dragged across the both screens. Any further suggestions?

  4. #4
    Join Date
    29.07.2007
    Posts
    10

    Lächeln Re: Picture Command Positioning

    Hi Juergen

    Ok, I think I have found a solution to my problem by using the DynPicture element in VBA. Basically, by using the 'Picture Open event' when the command picture opens, I can interrogate where the cursor is, and if it is on the right hand screen I can move the command picture relative to that position.

    With regards

    David

    --------------


    'Declaration of zPIC, in order to use it with events

    Dim WithEvents zPIC1 As DynPicture

    Const ScreenWidth = 1280


    Private Sub Project_Active()

    'Initialize zPIC with the start picture
    Set zPIC1 = thisProject.DynPictures.Item("Picture_Cmd")
    End Sub



    Private Sub zPIC1_Open()

    Dim pTargetPoint As POINTAPI
    Dim IRetVal As Long

    IRetVal = GetCursorPos(pTargetPoint)

    With zPIC1
    If pTargetPoint.x > ScreenWidth Then ' Is cursor on screen 2?
    .Move pTargetPoint.x, .Top, .Width, .Height
    End If
    End With
    End Sub


    Private Sub Project_Inactive()
    'Deinitialize zPIC on project close
    Set zPIC1 = Nothing
    end Sub

  5. #5

    Default Re: Picture Command Positioning

    another possibility would be to create a picture switch function to open the command picture, and modify the variable at the function before calling, through VBA. At the function it is possible to define the monitor where the picture should be opened.

    Reacting on the picture open event however, is probably the solution with less efforts and less implementation risks

Similar Threads

  1. Replies: 0
    Last Post: 5th January 2009, 15:13
  2. action "COMMAND" at the dynamic element not visible
    By markclemens in forum zenon Energy Edition
    Replies: 0
    Last Post: 16th May 2008, 06:53
  3. Referencing variable on a picture
    By madphilly in forum VBA
    Replies: 8
    Last Post: 25th January 2008, 10:57
  4. Replies: 0
    Last Post: 29th November 2007, 12:50
  5. Action buttons at the command interlocking
    By markclemens in forum zenon Energy Edition
    Replies: 0
    Last Post: 8th August 2007, 16:05

Posting Rules

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