Showing results 1 to 6 of 6

Thread: mouse event

  1. #1
    Join Date
    24.05.2012
    Location
    Augsburg
    Posts
    30

    Frage mouse event

    Hello Everybody,

    have Problems with following code. The Event does not raise, when i click on a button.
    i have it also testet with other Events like dblClick and so on.. but nothing happens.

    thanks for help.



    Code:
    zenOn.DynPictures zScreens = new zenOn.DynPictures();
    // i also tested with   zenOn.DynPictures zScreens;   without the new statement
     
    void ThisProject_Active()
    {
        //Create any required API-References here (Event handlers, OnlineContainers, local references,etc. )
        // << TODO: Add Initialization code here >>
     
        zScreens.ElementLeftButtonUp += new zenOn.ElementLeftButtonUpEventHandler(zScreens_ElementLeftButtonUp);
     
    }
     
    void zScreens_ElementLeftButtonUp(zenOn.IDynPicture obDynPicture, zenOn.IElement obElement, int lPosX, int lPosY, int lButton)
    {
        //Do something here
    }
     
    void ThisProject_Inactive()
    {
        //Release all API-References here (Event handlers, OnlineContainers, local references, etc. )
        // << TODO: Add Clean-up code here >>
        zScreens.ElementLeftButtonUp -= new zenOn.ElementLeftButtonUpEventHandler(zScreens_ElementLeftButtonUp);
     
     
        //Final release and garbage collection of any API-Objects.
        FreeObjects();
    }

  2. #2

    Default Re: mouse event

    Hi Armin,

    Judging from your other post, it guess you got it working now


            void ThisProject_Active()
            {
                //Create any required API-References here (Event handlers, OnlineContainers, local references,etc. )
                zScreens = this.DynPictures();
                zScreens.ElementLeftButtonUp += new zenOn.ElementLeftButtonUpEventHandler(zScreens_ElementLeftButtonUp);
            }
    
            void ThisProject_Inactive()
            {
                //Release all API-References here (Event handlers, OnlineContainers, local references, etc. )
                zScreens.ElementLeftButtonUp -= new zenOn.ElementLeftButtonUpEventHandler(zScreens_ElementLeftButtonUp);
                zScreens = null;
                //Final release and garbage collection of any API-Objects.
                FreeObjects();
            }


    Best regards,
    Mark

  3. #3
    Join Date
    24.05.2012
    Location
    Augsburg
    Posts
    30

    Default Re: mouse event

    [IMG]d:\users\armin.seitz\Desktop\mousevent.png[/IMG]
    Hello Mark,
    unfortunately i does not work. There is something missing in my code.
    i send you a picture of my code, hope you can help me.

  4. #4
    Join Date
    24.05.2012
    Location
    Augsburg
    Posts
    30

    Default Mouse Event is not working

    Hi,
    i want to react to a mouse event with the following code, but it doesn´t work. Is the event-routine wrong, or the definition of zScreen ?
    help needed
    Thanks

    Code:
           int count = 0;
            zenOn.DynPictures zScreens;
            void ThisProject_Active()
            {
     // zScreens = this.DynPictures();
                zScreens.ElementLeftButtonUp += new zenOn.ElementLeftButtonUpEventHandler(zScreens_ElementLeftButtonUp);
            }
           
            void ThisProject_Inactive()
            {
                //Release all API-References here (Event handlers, OnlineContainers, local references, etc. )
                // << TODO: Add Clean-up code here >>
    
                //Final release and garbage collection of any API-Objects.
                FreeObjects();
            }
    
            #region Macros (Add macros in this region)
    
            void zScreens_ElementLeftButtonUp(zenOn.IDynPicture obDynPicture, zenOn.IElement obElement, int lPosX, int lPosY, int lButton)
            {
               count++;
               this.Variables().Item("Testvar1").set_Value(0, count);
            }

  5. #5

    Default Re: mouse event

    Hi Armin,

    I moved your post to your existing thread.

    Use "zenOn.IDynPictures zScreens;" instead of "zenOn.DynPictures zScreens;"

    and use "zScreens = this.DynPictures();" in project active.

    Also make sure to remove the event handler in project inactive, and release the references.

    best regards,
    Mark

  6. #6
    Join Date
    24.05.2012
    Location
    Augsburg
    Posts
    30

    Lächeln AW: Re: mouse event

    Quote Originally Posted by markclemens View Post
    Hi Armin,

    I moved your post to your existing thread.

    Use "zenOn.IDynPictures zScreens;" instead of "zenOn.DynPictures zScreens;"

    and use "zScreens = this.DynPictures();" in project active.

    Also make sure to remove the event handler in project inactive, and release the references.

    best regards,
    Mark
    Thank you, appreciate it

Similar Threads

  1. Problem with mouse click
    By dario in forum zenon Supervisor
    Replies: 4
    Last Post: 8th November 2012, 14:25
  2. Mouse over
    By croc in forum VBA
    Replies: 6
    Last Post: 23rd December 2011, 13:25
  3. Mouse wheel and world view
    By gz0000 in forum zenon Supervisor
    Replies: 6
    Last Post: 3rd February 2011, 09:32
  4. Touchscreen operation: deactivation of mouse cursor
    By herberto in forum zenon Operator
    Replies: 0
    Last Post: 7th May 2010, 09:18
  5. Drawn event
    By flajoso in forum VBA
    Replies: 5
    Last Post: 26th August 2008, 11:09

Posting Rules

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