Page 1 of 1

[Solved+Issue] Hover message when mouse is over text

Posted: Tue May 20, 2014 9:25 pm
by Shelly Belly
Does anyone know a macro that will display a message when mouse is over text.... Any help someone...plzzzz.

Hover Text

Posted: Wed May 21, 2014 5:55 pm
by Shelly Belly
Does anyone know how to create a hover text message when the mouse is over an Object? I really need help on this.

Re: Macro to hover message when mouse is over text

Posted: Wed May 21, 2014 7:25 pm
by RoryOF
Some information at
viewtopic.php?f=20&t=57791

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 12:05 am
by Villeroy
hover_text.odt
(11.47 KiB) Downloaded 1958 times

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 9:00 am
by B Marcelly
Funny, Villeroy !
I used some formatting to help the user find the texts with hints.
And added another solution.

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 10:17 am
by Villeroy
B Marcelly wrote:And added another solution.
I like the non-functional but nevertheless creative hyperlink. I would have expected that it throws some error about invalid URL or inaccessible resource or something. However, it doesn't which is just fine for this purpose.

Using a so called "group box" as a form control, you can still focus the text under the form control but you've got to live with a thin black border which can't be hidden nor formatted to back color.

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 1:30 pm
by Shelly Belly
Can this be applied to open office calc?

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 3:53 pm
by Villeroy
Shelly Belly wrote:Can this be applied to open office calc?
Did you try? No, of course not.

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 4:52 pm
by acknak
Very clever you guys--nice!

For the record, I found an open request for this:
Issue 84037: Request for generic tool tip functionality You can register there and add your vote (up to two) or comment.

Adding a macro for this seems like a steep climb: where would you store the help text? I looked at the ODF file format--it doesn't include any "title" property for links, as with html/web pages. Changing the file format to include something non-standard is not likely to happen.

Maybe an option to display comments as tooltips?

You also get pop-up text with footnotes--maybe that could be used.

NOTE: Calc already has pop-up notes: Insert > Comment

Re: Macro to hover message when mouse is over text

Posted: Thu May 22, 2014 6:15 pm
by Shelly Belly
lol lol thanks alot Villeroy....roryof...bmarcelly...u all were great....I'm learning open office as i go. Thanks again guys.

Re: [Solved+Issue] Hover message when mouse is over text

Posted: Tue Sep 09, 2014 8:14 am
by wgw
I looked at hover_text.odt and found no macros...The popup works, but I do not see how it was implemented!

Any clarifications?

Thanks!

(Using LibreOffice under Ubuntu.)

Re: [Solved+Issue] Hover message when mouse is over text

Posted: Tue Sep 09, 2014 9:48 am
by B Marcelly
They use Label fields (form controls).
Each control is sized over the desired zone, the popup is the help text of the control.

Re: [Solved+Issue] Hover message when mouse is over text

Posted: Tue Sep 09, 2014 10:46 pm
by wgw
Thanks! I would have never found it. (Anxiously awaiting a "reveal codes" feature for OpenOffice....)

There must be a better way to parachute popup definitions onto items (I will use it for quiz-like exercises).

For the moment, finding a way to hijack the hyperlink popup looks like the most promising (i.e., if the message "ctrl-click to open hyperlink" did not appear, then a link with destination "here is my popup information" would work. You could even make generate the text in html and import it into OO.)

It could be that changing that prompt would not be a massive undertaking...

Thanks again!

Re: [Solved+Issue] Hover message when mouse is over text

Posted: Mon Jan 12, 2015 5:39 am
by euan
Finding this page has been really useful for me. Thanks all. Another question though:

How did you locate the words on the page (to put into the <draw:control> element)? e.g. the layout location in cms? Is that something you can do automatically, or did you have to manually do that?

Thanks!

Re: [Solved+Issue] Hover message when mouse is over text

Posted: Mon Jan 21, 2019 3:10 pm
by JeJe
Another method to help complete this old thread. If you don't use the recording changes feature that can be adapted... run on a blank Writer Document...

Code: Select all

'based on
'https://www.mail-archive.com/allbugs@openoffice.org/msg356757.html


sub makeRedlinePopupMessage
dim aRedlineProperties(2) as new com.sun.star.beans.PropertyValue
xcrsr = thiscomponent.gettext.createtextcursor
thiscomponent.gettext.setstring( "Popup over Message.")

with xcrsr
.gotostart( false )
.goright( 11, false )
.goright( 7, true )
end with

aRedlineProperties(0).Name = "RedlineAuthor"
aRedlineProperties(0).Value = "Message"
aRedlineProperties(1).Name = "RedlineComment"
aRedlineProperties(1).Value = "Stuck with the " & chr(34) & "Formatted" & chr(34) & " and having a Date/time  but its a way..."
aRedlineProperties(2).Name = "RedlineDateTime"
aRedlineProperties(2).Value = time + date

xcrsr.makeRedline("Format", aRedlineProperties )
end sub
Edit:
NOTE: if you copy and paste the text the message will be lost/not pasted.

Re: [Solved+Issue] Hover message when mouse is over text

Posted: Tue Jan 22, 2019 1:06 am
by JeJe
Here's an improved version. Select the text that you want to comment and run MakeComment.
To edit the comment/popup run showCommentDialog
You might want to set keyboard shortcuts for these.

The changes/commenting make a good popup comment system. You don't need changes showing to see the popups or to change the comments, the text is unchanged, and the dialog lets you navigate through the comments.

Remember the comments don't get pasted if you copy and paste somewhere.

Code: Select all

sub MakeComment()

OVC = thiscomponent.currentcontroller.viewcursor
TC = OVC.gettext.createtextcursorbyrange(OVC)
makeRedlinePopupMessage TC,"Comment",""
OVC.collapsetostart
showCommentDialog

end sub



sub makeRedlinePopupMessage(TextCur,Author,Comment,Optional DateTime)
dim aRedlineProperties(2) as new com.sun.star.beans.PropertyValue

aRedlineProperties(0).Name = "RedlineAuthor"
aRedlineProperties(0).Value = Author
aRedlineProperties(1).Name = "RedlineComment"
aRedlineProperties(1).Value = Comment
aRedlineProperties(2).Name = "RedlineDateTime"

if ismissing(DateTime) =false then
aRedlineProperties(2).Value = DateTime
else
aRedlineProperties(2).Value = time + date
end if

TextCur.makeRedline("Format", aRedlineProperties )
end sub


sub showCommentDialog
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:CommentChangeTracking", "", 0, Array())
end sub