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

Creating a macro - Writing a Script - Using the API

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

Postby Shelly Belly » Tue May 20, 2014 9:25 pm

Does anyone know a macro that will display a message when mouse is over text.... Any help someone...plzzzz.
Last edited by Hagar Delest on Thu May 22, 2014 10:34 pm, edited 1 time in total.
Reason: tagged [Solved].
Open Office 4.0
Operating System---Windows 7 Professional
Shelly Belly
 
Posts: 8
Joined: Tue May 06, 2014 5:52 pm

Hover Text

Postby Shelly Belly » Wed May 21, 2014 5:55 pm

Does anyone know how to create a hover text message when the mouse is over an Object? I really need help on this.
Open Office 4.0
Operating System---Windows 7 Professional
Shelly Belly
 
Posts: 8
Joined: Tue May 06, 2014 5:52 pm

Re: Macro to hover message when mouse is over text

Postby RoryOF » Wed May 21, 2014 7:25 pm

Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28429
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Macro to hover message when mouse is over text

Postby Villeroy » Thu May 22, 2014 12:05 am

hover_text.odt
(11.47 KiB) Downloaded 847 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26408
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro to hover message when mouse is over text

Postby B Marcelly » Thu May 22, 2014 9:00 am

Funny, Villeroy !
I used some formatting to help the user find the texts with hints.
And added another solution.
Attachments
hover_text2.odt
Some texts with hints
(16.41 KiB) Downloaded 566 times
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
B Marcelly
Volunteer
 
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Macro to hover message when mouse is over text

Postby Villeroy » Thu May 22, 2014 10:17 am

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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26408
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro to hover message when mouse is over text

Postby Shelly Belly » Thu May 22, 2014 1:30 pm

Can this be applied to open office calc?
Open Office 4.0
Operating System---Windows 7 Professional
Shelly Belly
 
Posts: 8
Joined: Tue May 06, 2014 5:52 pm

Re: Macro to hover message when mouse is over text

Postby Villeroy » Thu May 22, 2014 3:53 pm

Shelly Belly wrote:Can this be applied to open office calc?

Did you try? No, of course not.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26408
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro to hover message when mouse is over text

Postby acknak » Thu May 22, 2014 4:52 pm

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
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Macro to hover message when mouse is over text

Postby Shelly Belly » Thu May 22, 2014 6:15 pm

lol lol thanks alot Villeroy....roryof...bmarcelly...u all were great....I'm learning open office as i go. Thanks again guys.
Open Office 4.0
Operating System---Windows 7 Professional
Shelly Belly
 
Posts: 8
Joined: Tue May 06, 2014 5:52 pm

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

Postby wgw » Tue Sep 09, 2014 8:14 am

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.)
LibreOffice 3.5.7.2 on Ubuntu 12.04
wgw
 
Posts: 2
Joined: Tue Sep 09, 2014 8:09 am

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

Postby B Marcelly » Tue Sep 09, 2014 9:48 am

They use Label fields (form controls).
Each control is sized over the desired zone, the popup is the help text of the control.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
B Marcelly
Volunteer
 
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

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

Postby wgw » Tue Sep 09, 2014 10:46 pm

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!
LibreOffice 3.5.7.2 on Ubuntu 12.04
wgw
 
Posts: 2
Joined: Tue Sep 09, 2014 8:09 am

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

Postby euan » Mon Jan 12, 2015 5:39 am

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!
OpenOffice 4.1.1 on Windows 7
euan
 
Posts: 1
Joined: Mon Jan 12, 2015 5:36 am

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

Postby JeJe » Mon Jan 21, 2019 3:10 pm

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   Expand viewCollapse view
'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.
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 429
Joined: Wed Mar 09, 2016 2:40 pm

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

Postby JeJe » Tue Jan 22, 2019 1:06 am

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   Expand viewCollapse view
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

Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 429
Joined: Wed Mar 09, 2016 2:40 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 7 guests