Showing results 1 to 7 of 7

Thread: Mouse over

  1. #1

    Default Mouse over

    Hello,

    Help me please with my challenge.
    I have project on 2 monitors. I have written macro mouse over, that calls function to open pic. When I remove mouse out this object, pic is still open of course.
    What ways could I use to close pic on the mouse out the object?
    May be should I use timer for function that will close pic in this macro "mouse over" or something like that? Could you please give me some examples of code?

    Regards,
    Nataly

  2. #2
    tobiassedlmeier Gast

    Default Re: Mouse over

    Hello,

    you could draw e.g. an invisible button underneath the object with the mouse over event. The invisible button is a little bit bigger than the other element. On the invisible button you make a mouse over event where you close the pic again.
    I tried it and it worked fine.

  3. #3

    Default Re: Mouse over

    Thank you for advice!

  4. #4

    Default Re: Mouse over

    Hello,
    this way pic closes. But if mouse is over object, function works in macro "mouse over" constantly. I mean, pic openes and values update constantly. What should I do to open pic with using this macro one time?

  5. #5
    tobiassedlmeier Gast

    Default Re: Mouse over

    That's right. If you move the mouse over the element, the mouse over event will be fired every time. But you can link a screen active Variable to the PopUp window in zenon. (This is a Bool variable which gets the value 1 if the screen is open). In the VBA script the first thing you do is to look if the value is 0 then you open the screen, if the value is 1 you don't do anything. If the screen is closing with the other event, the variable gets the value 0 automatically.

  6. #6

    Default Re: Mouse over

    I wrote code, but it doen`t work.
    What`s wrong?


    Public Sub MouseOver_OverDevice(obElem As Element, vPosX As Variant, vPosY As Variant)
    Dim zVariables As Variables
    Dim zVariable As Variable

    Set zVariables = thisProject.Variables
    Set zVariable = zVariables.Item("var_open_pic_device")

    If zVariable = 0 Then
    thisProject.RtFunctions.Item("f_popup_device").DynProperties("PictSwitch[0].Monitor") = "0"
    thisProject.RtFunctions.Item("f_popup_device").Start
    End If

    End Sub

  7. #7

    Default Re: Mouse over

    Guess what's wrong:
    zVariable.Value

    However have one another problem
    When I bind a button to the function, which openes the pic in macro mouse over - the pic appeares mouse point relaitive. But if I use mouse over event for opening this pic, it appeares on the left top of the window.

    How can I open the pic mouse point relaitive using VBA macro?

Similar Threads

  1. Mouse wheel and world view
    By gz0000 in forum zenon Supervisor
    Replies: 6
    Last Post: 3rd February 2011, 09:32
  2. 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
  •