in GUI Development by

Is it possible to show mouse type cursor to indicate the current position?!

If it is possible how can we show or hide the cursor?

Thank you!

1 Answer

0 votes


the native support of mouse pointers is not provided. You can however emulate the mouse pointer by displaying an Image. Try following:

Step 1: By using a graphic editor create a PNG file showing your desired mouse pointer. Or use some existing PNG file. Also possible, you can use the bitmaps provided per default in Embedded Wizard.

Step 2: Add the PNG file as new Bitmap Resource to your Embedded Wizard project.

Step 3: In your Application component add a new Image view:

Step 4: Configure the Image view to display the mouse pointer Bitmap Resource (from Step 2).

Step 5: In the Application component look for the inherited method DriveMoultiTouchMovement. You will find the method in the Inspector window.

Step 6: Override the method.

Step 7: Open the overridden method and implement code to adjust the position of Image view (from Step 3). For example, arrange the view to have its center at the current touch position known from the parameter aPos:

Now when you start the Prototyper, the image will follow the mouse movements as long as the mouse pointer lies within the Prototyper window. In the target system (if you are using a touch screen), the image will follow all touch movements. If you have a multi-touch screen, the image will assume the position of the latest touch event.

Step 8: Configure the Image view to be always topmost. For this purpose set the property StackingPriority of the Image view to some higher value (e.g. value 1 would be sufficient. If you have other GUI components configured already with some higher priority, use a larger value consequently to ensure that the pointer is always topmost).

I hope this helps you further.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint