Change mouse icon ?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

Change mouse icon ?

Post by arfgh »

Hey friends, how can i change the mouse icon when on mouse over hyperlinks i added to the base forms ?

thx in advance
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Change mouse icon ?

Post by UnklDonald418 »

Probably use a Mouse inside event on a form control
Press <Alt>F11 and look in OpenOffice Macros>Tools>Module Controls for SwitchMousePointer
the available pointer shapes are:
https://www.openoffice.org/api/docs/com ... inter.html
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Change mouse icon ?

Post by UnklDonald418 »

Andrew Pitonyak has something in his "Useful Macro Information" document, section 5.21. Changing The Mouse Cursor
And a forum discussion [Solved] How to change mouse cursor?
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

Re: Change mouse icon ?

Post by arfgh »

ok, the tools library...
As indicated, you must transmit the window peer of the control where you want to change the cursor.
Some more info about that needed parameter ? anyways i go to use it from events and, not sure that will work by that way...

Ok, i got it finally. Your help was perfect :) Thx so much.

Code: Select all

sub changeMousePointer(event as object)
	Dim Controller as object, DrawControl as object, control as object, Pointer as object
	Controller = ThisComponent.getCurrentController()
	DrawControl = event.source.model
	Control = Controller.getControl(DrawControl)
	Pointer = createUnoService("com.sun.star.awt.Pointer")
	Pointer.SetType(com.sun.star.awt.SystemPointer.REFHAND)
	Control.getPeer().setPointer(Pointer)

	'ThisComponent.getCurrentController().getFrame().getContainerWindow().setPointer(Pointer)	
End Sub
Anyways... do you know about the most updated document about 'Useful Macro Information' ?
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
Post Reply