OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Reveal Codes macro - feedback required
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
rick_deckard
General User
General User


Joined: 01 Oct 2004
Posts: 22

PostPosted: Fri Oct 01, 2004 3:59 pm    Post subject: got it working Reply with quote

Ian,
In RevealCodes2, the relevant code is in the RevealCodes module, lines 186+

Code:

case "DocumentIndexMark"
   s = oPortion.textPortionType & " Keys=" & oPortion.documentIndexMark.primaryKey & _
         ":" & oPortion.documentIndexMark.secondaryKey & _
         ":" & oPortion.documentIndexMark.alternativeText


Basically, I added one line to pick up the "entry" text as well as the keys. I also added colon separators so that it would be easier to read.
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Sat Oct 02, 2004 7:01 pm    Post subject: Re: got it working Reply with quote

rick_deckard wrote:
Basically, I added one line to pick up the "entry" text as well as the keys. I also added colon separators so that it would be easier to read.

Thanks for this! You are the first person to recommed a change at the code level! I have updated the file on the web site.
In about a week I should have more time to improve the RevealCodes macro. This has inspired me to get going on it again.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
maxqnz
Super User
Super User


Joined: 24 Mar 2003
Posts: 1290
Location: Te Ika a Maui, Aotearoa

PostPosted: Sat Oct 02, 2004 7:51 pm    Post subject: Reply with quote

Great to hear that you've been inspired to take it up again, Ian. The only coding I could do is ROT13 but if there is any other way I can help, then, as a longtime WordPerfect user and fan, I would be more than happy to do so.
_________________
Noho ora mai, ka kite ano.
What Is A Pieriansipist?

OOo 2.4/XP Pro SP2 / OOo 2.3.0.1/OpenSuse 10.3
Back to top
View user's profile Send private message Visit poster's website
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Wed Oct 06, 2004 1:22 am    Post subject: Reply with quote

I managed to find some time today to work on the reveal codes2 macro. I have updated the file on the website.
Most of the buttons should work - if not please let me know!
Feedback is always welcome! Even if they are repeats of suggestions you have already made - they might just prompt me to make that change.
If anybody would like to review/improve the documentation I would be very grateful.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
maxqnz
Super User
Super User


Joined: 24 Mar 2003
Posts: 1290
Location: Te Ika a Maui, Aotearoa

PostPosted: Wed Oct 06, 2004 2:51 am    Post subject: Reply with quote

I installed the macro fine, but after adding the button to my toolbar, I got this:


I could still run the macro OK by manually selecting it from Tools>Macros>Run Macros.
_________________
Noho ora mai, ka kite ano.
What Is A Pieriansipist?

OOo 2.4/XP Pro SP2 / OOo 2.3.0.1/OpenSuse 10.3
Back to top
View user's profile Send private message Visit poster's website
maxqnz
Super User
Super User


Joined: 24 Mar 2003
Posts: 1290
Location: Te Ika a Maui, Aotearoa

PostPosted: Wed Oct 06, 2004 2:54 am    Post subject: Reply with quote

Whoops! Sorry, I had tried adding it to the toolbar instead of the menu. My mistake. Embarassed
_________________
Noho ora mai, ka kite ano.
What Is A Pieriansipist?

OOo 2.4/XP Pro SP2 / OOo 2.3.0.1/OpenSuse 10.3
Back to top
View user's profile Send private message Visit poster's website
revnomad
OOo Advocate
OOo Advocate


Joined: 23 Feb 2003
Posts: 211
Location: NE Nebraska

PostPosted: Wed Oct 06, 2004 7:49 pm    Post subject: window width Reply with quote

I have been using CodeReveal since you released it. It still has a major flaw. The window is wider than my screen.

NTP
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Wed Oct 06, 2004 8:54 pm    Post subject: Re: window width Reply with quote

revnomad wrote:
I have been using CodeReveal since you released it. It still has a major flaw. The window is wider than my screen.

In theory the dialog should now be the width of the window that was active when the macro was called.
Which operating system, OOo version, and what screen resolution are you using?
I know that there is a bug that at some sizes the controls at the right end of the dialog disappear (I haven't worked that one out yet).
I will try and find solutions to these problems.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
ossworks
General User
General User


Joined: 28 Jul 2004
Posts: 12

PostPosted: Thu Oct 07, 2004 6:02 am    Post subject: Reveal Codes should be integrated into OOo Reply with quote

Iannz,

Having worked with WP in the past, I downloaded your Reveal Codes macro out of curiosity just to see what it would do. I thought it was “cute” code and I left in my “edit” menu. Three months have passed by and now I realized that Reveal Codes has been essential for finding reference marks, seeing an overriding style, or just understanding what happened on the last format request.

<Rant>
I must say that I prefer any kind of markup (Nroff, LaTeX, Html, XML) over embedded codes. What's really missing, IMHO, is not a better Reveal Codes macro, but a true native XML script behind the GUI so that advanced users (or macros) can edit the XML strings and leave the XML-to-GUI translation to the word processor. I'm not saying it is easy, but I think OOo will eventually go in this “browser” direction. Meanwhile, I will keep using Reveal Codes to get me out of tight spots.
</Rant>

I recommend that Reveal Codes be integrated into the OOo distribution!

Ossworks
Back to top
View user's profile Send private message
revnomad
OOo Advocate
OOo Advocate


Joined: 23 Feb 2003
Posts: 211
Location: NE Nebraska

PostPosted: Sat Oct 16, 2004 8:54 pm    Post subject: Re: window width Reply with quote

Iannz wrote:
revnomad wrote:
I have been using CodeReveal since you released it. It still has a major flaw. The window is wider than my screen.

In theory the dialog should now be the width of the window that was active when the macro was called.
Which operating system, OOo version, and what screen resolution are you using?
I know that there is a bug that at some sizes the controls at the right end of the dialog disappear (I haven't worked that one out yet).
I will try and find solutions to these problems.


At the time I was using OOo 1.1.3 on Win98SE. I'm now (as of yesterday) using OOo 1.1.3 on WinXP. I have yet to reinstall all my macros. I'll respond as soon as I can check it out.
Thanks
Norman
Back to top
View user's profile Send private message
AntonioFabio82
Power User
Power User


Joined: 16 Oct 2004
Posts: 83
Location: Italy

PostPosted: Sun Oct 24, 2004 12:02 pm    Post subject: Reply with quote

I know the existence of "revealCodes" from just 2 days... simply wonderful!

It seems to me that the last version (downloaded today), does not eliminate the numbering style. It also don't give you the possibility of choising another numbering style.

Tnx Ian!
_________________
Antonio, Fabio.
Back to top
View user's profile Send private message
padmavyuha
General User
General User


Joined: 17 Mar 2004
Posts: 48
Location: Norwich, UK

PostPosted: Mon Oct 25, 2004 7:49 am    Post subject: Reply with quote

Hi Iannz -

I've just discovered your RC macro version 2, and I'm trying it out on a mac in OSX. Behaviour is 'unpredictable' when it comes to clicking on things using control keys to emulate the middle mouse button! I can't get that to work at all in X11, but in NeoOffice/J it does kind of work - Cmd-Click will pop up a dialog if it's a style I click on, but apart from that it generally just deletes the item clicked on whatever I do.

I'm wondering if, to make it more platform-independent, you could replace the middle-click with a shift-click, or something that all the Ooo platforms will have in common?

Otherwise, it's a very useful little tool to see what's going on under the floorboards, and it isn't too slow after the first time it's been launched (using a 400 Mhz powerbook, which isn't the fastest kid on the block).

Oh yes, one other request, which may or may not be implementable - if I middle-click/cmd-click on a style item, and the Style dialog pops up, and then I cancel it without changing anything, the whole RC window still redraws. Is there any way to make the redraw dependent on a change having actually taken place? It would save time when one is just looking at the options.

- padmavyuha
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Mon Oct 25, 2004 3:58 pm    Post subject: Reply with quote

AntonioFabio82 wrote:
It seems to me that the last version (downloaded today), does not eliminate the numbering style. It also don't give you the possibility of choising another numbering style.

You are correct. Currently for most attributes it simply resets that attribute to the default which, in this case does nothing. I will look into this further and try and have the ability to remove the numbering and to display the numbering and bullets dialog. I haven't worked out the best approach yet.

padmavyuha wrote:
I've just discovered your RC macro version 2, and I'm trying it out on a mac in OSX. Behaviour is 'unpredictable' when it comes to clicking on things using control keys to emulate the middle mouse button! I can't get that to work at all in X11, but in NeoOffice/J it does kind of work - Cmd-Click will pop up a dialog if it's a style I click on, but apart from that it generally just deletes the item clicked on whatever I do.

I'm wondering if, to make it more platform-independent, you could replace the middle-click with a shift-click, or something that all the Ooo platforms will have in common?

Thanks for this feedback - I don't have OSX - so I need feedback like this. I chose middle click as right click in Linux and Windows displays a context menu that I though might be useful. The idea of using shift click as an alternative is a good one.

padmavyuha wrote:
Oh yes, one other request, which may or may not be implementable - if I middle-click/cmd-click on a style item, and the Style dialog pops up, and then I cancel it without changing anything, the whole RC window still redraws. Is there any way to make the redraw dependent on a change having actually taken place? It would save time when one is just looking at the options.


Up until recently this macro was more just an academic exercise, now that I'm getting more feedback, I'll try and be less sloppy about my coding (I confess at this stage I'm not certain how easy this will be to implement - but I will look into it).
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
oblomov
Newbie
Newbie


Joined: 03 Nov 2004
Posts: 1

PostPosted: Wed Nov 03, 2004 8:33 am    Post subject: Reply with quote

Hello Ian, hello all.

I'm Giuseppe Bilotta, one of the stronger supporter of the implementation of a Reveal Codes feature in Writer. I notice that somebody already linked my paper on the subject --this saves me from a shameless plug Mr. Green.

Ian, I must really congratulate you for the excellent work. "Version 2" of the macro is, IMHO, the most promising and outstanding work.

I notice that your first concern is with speed. Well, in WordPerfect itself, the Reveal Codes windows is not updated in real time, while editing! It always lags a couple of seconds behind. So don't get too focused on the speed issue Smile it's IMO more important to have the functionality available now, with whatever performance hit (when it's active) than having to wait until it gets implemented in the core Smile

I took the liberty to browse through the code. I have an abysmal lack of knowledge of all the internal mechanisms of the various OOo components, so I'm afraid I can't help too much (oh, I wish the macro editor had an online help with autocompletion and all that stuff ... that would help!). So I will just give a few suggestions/comments here.

First of all: I absolutely don't like the Single Left Click -> Delete Code mapping. Rather:

Arrow the Delete action could be inserted in the Context Menu (Right Click on a code; options: edit, delete, whatever else).

Arrow Single Left Click on a Style (i.e. not direct attribute) button could act by calling up the Stylist dialog, with the appropriate Style type active (currently, if the Stylist was last used with Character styles, clicking on a Para Style will call it in Character style mode :\

Arrow Double left Click on a Style should launch the Style Editor for that Style

Arrow Double left Click on a Direct attribute should pop up the text or format dialog, at the appropriate page (is this possible?)

Exclamation currently: if you single click on a closing attribute, the closing attribute gets deleted but not the opening attribute --is this WAD or a bug?

Second: I very much like the fact that you can edit the text portions between the codes. I don't know if this is possible, but it would be great if you could map the Del and Backspace keys to delete the next/previous code when they are pressed at the border of any portion. In general, is it possible to have keyboard navigation work by considering each button as a 'token'? (See also the fourth point below)

Third, a purely aesthetic matter: attribute should get closed on a last-to-first basis; this is easily achieved by letting the for loop from uBound(...) to 0 step -1 instead of from 0 to uBound(...) when enumerating the "close" sections.

Fourth: if I remove all the text from a portion, the portion currently remains; is this WAD, or can it be fixed? Conversely, is there a way to insert a text portion between two codes? (e.g. by putting appropriate entries on the right-click menu: insert text before, insert text after; or by enabling a more free-form keyboard navigation)
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Sun Nov 07, 2004 3:29 am    Post subject: Reply with quote

I have just released another version of my reveal codes macro. Unfortunately this version needs to be installed in order to run - so no demo button this time.

Thanks to all those that have given feedback. Here are some comments in response to some of the issues raised.

padmavyuha wrote:
I'm wondering if, to make it more platform-independent, you could replace the middle-click with a shift-click, or something that all the Ooo platforms will have in common?

The mouse operations are now:
Left Click & Control+Left Click which are configurable.
Shift+left Click to configure a button.

padmavyuha wrote:
Oh yes, one other request, which may or may not be implementable - if I middle-click/cmd-click on a style item, and the Style dialog pops up, and then I cancel it without changing anything, the whole RC window still redraws. Is there any way to make the redraw dependent on a change having actually taken place? It would save time when one is just looking at the options.

Done - but if you click OK even if you haven't made a change it will refresh the dialog. Hopefully the refreshing of the dialog is now faster too.
AntonioFabio82 wrote:
It seems to me that the last version (downloaded today), does not eliminate the numbering style. It also don't give you the possibility of choising another numbering style.

I think this is done - thanks for letting me know! As "shipped" Click will delete the numbering, Ctrl+Click will display the Numbering and bullets dialog. There are bound to be other examples, so if people can keep me informed this macro should keep getting better and hopefully reach an alpha stage sometime soon.

oblomov wrote:
I notice that your first concern is with speed. Well, in WordPerfect itself, the Reveal Codes windows is not updated in real time, while editing! It always lags a couple of seconds behind. So don't get too focused on the speed issue Smile it's IMO more important to have the functionality available now, with whatever performance hit (when it's active) than having to wait until it gets implemented in the core Smile

I think that I have significantly improved the overall speed performance. There is still a major problem with editing large text portions.

I took the liberty to browse through the code. I have an abysmal lack of knowledge of all the internal mechanisms of the various OOo components, so I'm afraid I can't help too much (oh, I wish the macro editor had an online help with autocompletion and all that stuff ... that would help!). So I will just give a few suggestions/comments here.
oblomov wrote:
First of all: I absolutely don't like the Single Left Click -> Delete Code mapping. Rather:

Arrow the Delete action could be inserted in the Context Menu (Right Click on a code; options: edit, delete, whatever else).

The property buttons are now configurable - so you can set them to work as you would like them to. I haven't got a context menu routine yet.

oblomov wrote:
Arrow Double left Click on a Style should launch the Style Editor for that Style

Confess that I don't know how to implement a double click. But you can now configure Click and Control+Click.
oblomov wrote:
Arrow Double left Click on a Direct attribute should pop up the text or format dialog, at the appropriate page (is this possible?)

There are two sources of information for this, one is the slots.sxc file (lost the online reference) and the other is http://framework.openoffice.org/files/documents/25/1042/commands_11beta.html
Neither are complete nor are they up to date. I haven't checked these for this concept. If you or anyone else finds the uno dispatch calls for this please let us know.
oblomov wrote:
Exclamation currently: if you single click on a closing attribute, the closing attribute gets deleted but not the opening attribute --is this WAD or a bug?

This was as designed. It is now an option.
oblomov wrote:
Second: I very much like the fact that you can edit the text portions between the codes. I don't know if this is possible, but it would be great if you could map the Del and Backspace keys to delete the next/previous code when they are pressed at the border of any portion. In general, is it possible to have keyboard navigation work by considering each button as a 'token'? (See also the fourth point below)

It maybe be possible but in my opinion not sensible. The order of the "codes" is arbitrarily assigned by the macro (which happens to be the order that OOo uses which is alphabetical). In the internal workings of OOo there are no codes just properties. So the concept of working with a string of codes to me just doesn't make sense. But, I am willing to be convinced other wise for this delete and backspace issue.

oblomov wrote:
Third, a purely aesthetic matter: attribute should get closed on a last-to-first basis; this is easily achieved by letting the for loop from uBound(...) to 0 step -1 instead of from 0 to uBound(...) when enumerating the "close" sections.

I could but I have got used to them being in alphabetical order so have left it that way. If more people want this changed I will do so.

oblomov wrote:
Fourth: if I remove all the text from a portion, the portion currently remains; is this WAD, or can it be fixed? Conversely, is there a way to insert a text portion between two codes? (e.g. by putting appropriate entries on the right-click menu: insert text before, insert text after; or by enabling a more free-form keyboard navigation)

In my previous approach if all the text was deleted then OOo crashed, so I had to code to avoid that. You should now be able to delete all the text in a text portion, but mysteriously the portion break still remains - I confess I don't know why.
The concept of inserting a text portion between two codes just doesn't make sense to me see comment above.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group