Plex 2E

 View Only
  • 1.  Set cursor style to hand

    Posted May 20, 2014 04:11 AM

    I would like to set mouse pointer from arrow to hand when hovering over some parts of a panel (like hovering mouse over a hyperlink on a html page). I believe that a WinAPI function could be called on the component's Mouse Move event, but I have no idea how to change the pointer style. Is there a built-in way to do this or would one need to write a new WinAPI function? The function in which I would like this is a Windows C++ function. Or is it possible to implement this functionality in VBScript with which I am more familiar?

    Plex version is 7.0.



  • 2.  Re: Set cursor style to hand

    Posted Sep 30, 2014 12:32 PM

    Can anyone offer any advice?

    Juho Heinonen wrote:

     

    I would like to set mouse pointer from arrow to hand when hovering over some parts of a panel (like hovering mouse over a hyperlink on a html page). I believe that a WinAPI function could be called on the component's Mouse Move event, but I have no idea how to change the pointer style. Is there a built-in way to do this or would one need to write a new WinAPI function? The function in which I would like this is a Windows C++ function. Or is it possible to implement this functionality in VBScript with which I am more familiar?

    Plex version is 7.0.



  • 3.  Re: Set cursor style to hand
    Best Answer

    Broadcom Employee
    Posted Oct 07, 2014 07:17 AM

    Hi Juho,


    There are Plex source code API to change the cursor type e.g.

         WINAPI/SetCursorToArrow

         WINAPI/SetCursorToWait

     

    This does not give option to change cursor type to mouse Hand symbol. To do this, below is one source code to change the mouse pointer to Hand symbol.

     

    Create one source code object with following source code and associate with control's mouse move event:

    // Set mouse cursor to Hand Symbol.

    // Associate this source code api call on desired control's mouse move event.

    #define IDC_HAND MAKEINTRESOURCE(32649)

    ::SetCursor(::LoadCursor(NULL, IDC_HAND));

    // .....

     

    After calling above outlined source code API, need to call 'WINAPI/SetCursorControl' source code API with input parameter set to 'False' (to disable automatic setting of the cursor).

     

    Please let us know if this solves the purpose.

     

    Regards,

    Arun Painuly

    CA Technologies



  • 4.  Re: Set cursor style to hand

    Posted Oct 07, 2014 08:44 AM

    Hello, I could not make it to work yet. On my WinC panel I first called

     

    API Call  Source code: juhoheTestCpp

    API Call  Source code: WINAPI/SetCursorControl (parameter input is false).

     

    And juhoheTestCpp contents are

     

         #define IDC_HAND MAKEINTRESOURCE(32649)

     

         int msgboxID = MessageBox(

                 NULL,

                 "Testing cursor",

                 "Testing cursor caption",

                 MB_OK

         );

     

    ::SetCursor(::LoadCursor(NULL, IDC_HAND));

     

    When I run the panel, the cursor is not changed when I fire the event in which this source code function is called. Only the messagebox is displayed.

     

    I have Windows 8.1 -> does that have some effect on working of SetCursor? SetCursorToWait works correctly.



  • 5.  Re: Set cursor style to hand

    Broadcom Employee
    Posted Oct 07, 2014 09:37 AM

    Hi Juho,

     

    Thanks for the details.

    In above case, if you comment out message box display logic - then mouse pointer should change to HAND symbol as and when mouse hover happens on specific control that has MoveMove event associated to fire above mentioned source code APIs.

     

    Thanks.

     

    Regards,

    Arun Painuly

    CA Technologies



  • 6.  Re: Set cursor style to hand

    Posted Oct 08, 2014 01:37 AM

    Ok, after removing the message box from the script, the cursor turned into hand when the event was fired.

     

    Thank you, Arun!



  • 7.  Re: Set cursor style to hand

    Broadcom Employee
    Posted Oct 08, 2014 02:09 AM

    Hi Juho,

     

    Glad to hear that solution worked.

     

    Thanks.

     

    Regards,

    Arun Painuly

    CA Technologies