Re: [api-dev] Attempt for an UNO Undo API
Moin, sorry for being late. There have been a lot of mails to read in the last days. ;-) On 15.10.2010 20:23, Ingrid Halama wrote: I think the Chart does qualify for all those Usage scenarios. Changes in Calc can lead to changes within the Chart that should be offered as one UNDO action together. Further the changes made within the Chart should be visible in the global UNDO stack also. I'm not sure if that is a good idea. IMHO an undo action only should record direct actions in the document core of the undo provider. If this action causes changes elsewhere (e.g. by a listener mechanism), they should not be recorded as it can be assumed that the opposite change in the core (when the undo action is executed) will cause the appropriate change in the listening component also. Doing that differently will create such a code mess we have in the Writer core when it comes to Undo. :-) So the Chart would be an ideal candidate for a test implementation. I would like to join your efforts, if time fits. :-) There might be some extra complications to expect regarding the OLE inplace editing mode and the OLE swapping mechanism. That could become ugly, maybe ... . Indeed, chart actions that are recorded while the component is activated, are dangerous, as executing them later when the component is no longer active and perhaps even disposed will at least make the implementation rather tricky - if not even a disaster. As the other nice improvements we can bring to extension developers should be ready rather today than tomorrow, I would opt for a simple implementation that does not try to use combined undo stacks from different components. Being able to group actions caused by API calls that - from the POV of the extension - should be one combined entry in the undo stack is worth the implementation already. Whether we want to use that for combined undo stacks also is something we should decide for version 2.0 of the implementation (it wouldn't influence the API, IMHO). Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Attempt for an UNO Undo API
On 10/22/2010 09:01 PM, Frank Schönheit wrote: As a sketch for the later evolution, we think that the XUndoManagerSupplier comes handy here: The chart model would be such a supplier, and for the moment, it would return an own, model-local instance of the XUndoManager. The later extension would be to let it provide the XUndoManager of the embedding document. In theory, this should be completely transparent to the client, which would simply add its actions to another instance, without actually noticing it. In practice, the concrete XUndoAction implementations of course might need to be adjusted (what if you do changes to the chart, then delete the chart, then do Undo multiple times? The chart Undo actions might have a reference to an outdated chart model then.). Also, you would not want to provide, in the menu/toolbox, Undo actions of the embedding document while the Chart is activated. I'm still worried about the problem I foresee, but we can postpone that until things get more concrete. Regardless of this, we agreed that in this first step, we will migrate Chart's XUndoManager to the new one, laying a common ground in all applications this way, which will also be prepared for the above-mentioned changes. Ciao Frank PS: If only a Writer developer could lend me a hand for implementing the new ::svl::IUndoManager interface on top of Writer's own home-grown Undo implementation, the whole thing would be nearly finished :) Sure. :-) As promised, we will do our very best. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Attempt for an UNO Undo API
On 10/22/2010 09:07 PM, Frank Schönheit wrote: Hi Mathias, I think the Chart does qualify for all those Usage scenarios. Changes in Calc can lead to changes within the Chart that should be offered as one UNDO action together. Further the changes made within the Chart should be visible in the global UNDO stack also. I'm not sure if that is a good idea. IMHO an undo action only should record direct actions in the document core of the undo provider. If this action causes changes elsewhere (e.g. by a listener mechanism), they should not be recorded as it can be assumed that the opposite change in the core (when the undo action is executed) will cause the appropriate change in the listening component also. Well, one scenario Ingrid and I discussed here is the deletion of rows/columns which are part of a source range for a chart. If this is undone, the best chart can currently notice is the insertion of a row/column. Whether or not this column was part of the source range is not part of the broadcast event - not much of a chance for Chart to find out. This implies that chart source range handling/undo should be done in Calc. On the other hand, this means Calc (or any application embedding charts) needs to know pretty much details about Chart's handling of data source ranges - imagine all the different chart types, and the degrees of freedom you have for their defining their data sources. Which means that extensions to the Chart core might require extensions to the core of the embedding documents - not really desirable. Those problems are probably solvable (and as said, we don't aim for those solutions for 1.0), but I am not convinced it is as easy as saying undoing an instigating change will automatically undo the resulting change - simply because currently, listeners might not always transport enough information for this. Let me put it that way: undo actions should only record direct actions. If changes in a component cause indirect changes elsewhere (e.g. by a listener connection), these changes should not be recorded in an undo action. Or the other way around: if actions in a sub component are recorded, they should be made directly by the super component. Otherwise you will get ugly code that always needs to know whether it is currently in an undo action or not. This code is very prone to regressions. Been there, done that, got to hate that. If the information provided to a listener is not sufficient, that should be changed. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Re: Attempt for an UNO Undo API
On 10/18/2010 05:16 PM, Malte Timmermann wrote: Or implementations w/o support for ref counting: For example, each EditEngine Undo action needs to have an EditEngine*. And EditEngines in OOo are destroyed and re-created quite frequently. Maybe using an own Undo manager for the EditEngine is wrong. When we implemented Notes2, I finally ended up with letting the container (Writer) tracking the changes, I didn't create an additional undo manager for the note(s). That means, each time when an undo entry shall be created, the Writer just copies the content of the outliner object inside the note. For more complicated cases this could be improved by a better encapsulation of what needs to be copied by providing suitable methods in the Outliner class. This way we got an Undo that is not prone to crashes and that doesn't depend on whether the user is editing the note or the text of the document. It also appeared that giving access to all entries of the undo stack while editing in a note doesn't create a problem if the implementation of the notes view is aware of sudden destruction (something that IMHO is necessary anyway). I think that we could apply this idea to drawing objects also. For OLE objects OTOH this probably wouldn't help as copying the whole object each time it changes surely would be too much. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] DocumentLoader memory leaking on cleanup
On 10/25/2010 07:10 PM, Chris Rider wrote: We are using DocumentLoader to manage the opening of PowerPoint files, and have recently discovered what appears to be a memory leak. As a quick background, these are self-advancing presentations, created using Microsoft by the end-user, who then uses our product (CentOS based) to display the files. When the cleanup routine is called, it appears to do its thing, but a bit of time later, the machine is almost frozen from all of its memory being used up... and after taking a look at the processes on the machine, we tracked it back to this. Below is from our log file... It looks like it reaches the end of the slideshow (event OnEndPresentation) and fires the Cleanup routine... but is it working past that point? Appears to not be. Are there any known issues with this sort of thing? Anyone else seeing this? Thanks! Chris 1288025660 : pid: 6935 - Acquiring lock... 1288025660 : pid: 6935 - Lock acquired! 1288025660 : pid: 6935 - Connected successfully to the office 1288025660 : pid: 6935 - XComponentloader successfully instantiated 1288025660 : pid: 6935 - argv[1]=/home/silentm/public_html/multimedia/951918099.Clarian.ppt 1288025660 : pid: 6935 - Document: file:///home/silentm/public_html/multimedia/951918099.Clarian.ppt 1288025661 : pid: 6935 - Starting Presentation... 1288025661 : pid: 6935 - Presentation Started! 1288025661 : pid: 6935 - Frame: 1288025661 : pid: 6935 - Frame: 1288025661 : pid: 6935 - Frame: 1288025661 : pid: 6935 - Releasing lock... 1288025661 : pid: 6935 - Lock released! 1288025661 : pid: 6935 - Wait for end! 1288025661 : pid: 6935 - Event : OnUnfocus received 1288025661 : pid: 6935 - Event : OnStartPresentation received 1288025661 : pid: 6935 - Event : OnFocus received 1288025661 : pid: 6935 - Event : OnLoad received 1288025662 : pid: 6935 - Event : OnEndPresentation received 1288025662 : pid: 6935 - Ending! 1288025662 : pid: 6935 - Event : OnViewClosed received 1288025662 : pid: 6935 - Event : OnUnfocus received 1288025664 : pid: 6935 - Cleanup 1288025664 : pid: 6935 - Cleanup - close - dispose I don't know how you created your logs, but at least in this log I don't see traces of the document being closed (Event OnClose, disposing etc.). But maybe that's part of the last line. Besides that, the document being closed does not mean that it is removed from memory. It's possible that it is still referenced somewhere and so the object is not destroyed. I think that eating up the memory completely - as you described it - would require thousands of such dangling references, but you never know. So look for references to documents (models) in your code. In case your application is implemented in Java, don't rely on the garbage collection doing the work for you, it might kick in just too late. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] DocumentLoader memory leaking on cleanup
On 10/26/2010 05:26 PM, Chris Rider wrote: As you can tell from the log file, the close method is being called, but not the dispose. Do I need to dispose also? Couldn't really find enough documentation to figure out *exactly* what those two methods entail. I kind of assumed it was something like the difference between clearing the objects memory or not. No, it a component supports XCloseable, you must call close(), otherwise dispose(). As close() will call dispose() internally, all you can get from an explicit dispose() call is a DisposedException. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Attempt for an UNO Undo API
On 10/26/2010 03:07 PM, Andrew Douglas Pitonyak wrote: Although I am ignorant in much of this, I do have some random thoughts. Mathias Bauer mentioned allowing the container to control changes for some items (such as he did with notes2), but that this may be a problem with larger objects such as graphics objects and even OLE objects. Right, it doesn't work for OLE objects, but in case the object could provide undo actions that don't require to be in edit mode, it should work for even the largest graphic objects. The difference between graphic objects and OLE objects is that the graphic object does not vanish after editing - it just may be in a different mode. But that is also true for the container itself where different shell objects are created and removed depending on the current editing context. On the other hand, I do not expect that an OLE object will have any ability to actively participate in the undo process, which forces implementation back to the container (or you simply state that changes made to an OLE object internally are not undoable). For some reason, I keep thinking about the implications of a linked sheet in a Calc document. I think that editing of OLE objects (and linked sheets are just a variant of them) should stay as they are: while you are editing the object, you might be able to undo parts of the editing, but after leaving the OLE object all changes made in this session can only be undone as a whole. A new API can't remove the intrinsic limitations of this concept. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Attempt for an UNO Undo API
On 10/28/2010 10:03 AM, Frank Schönheit wrote: Hi Mathias, I think that editing of OLE objects (and linked sheets are just a variant of them) should stay as they are: while you are editing the object, you might be able to undo parts of the editing, but after leaving the OLE object all changes made in this session can only be undone as a whole. A new API can't remove the intrinsic limitations of this concept. Not sure I'd sign this. Technically, I could imagine the embedded object adding Undo actions to the Undo manager of the container document (letting those actions survive/handle the temporary destruction of the embedded object when it is deactivated is, well, a challenge only, not an impossibility, I suppose :) ). Whether this is desired from an UX point of view might be a different question. This will break at least if the OLE object is not an OOo object. :-P Besides that, of course nothing is impossible in software. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Document Server Memory Leak Suspicion
Hi Chris, On 02.11.2010 13:40, Chris Rider wrote: I hope this is an active mailing list ~ we have a serious issue with the document server and are trying to track down some more knowledge that might exist about it. I have new information from further testing, but here's a quick summary: We have a program that calls the document server to load a PPT file (as explained below). That goes fine, and then we call it to close the file after some time... also goes fine -- mostly. The file will close, but then the memory continues to be eaten up by document server until the machine becomes non-responsive. We've run strace and can't find anything. We're calling the server over port 2803. We're calling the close method (which I've learned also calls dispose, etc.). We've got hundreds of products at customers and some are beginning to doubt OpenOffice as a platform... please help! We still don't have enough information, or perhaps not the right one. OOo in general definitely does not have a memory leak of that kind - you wouldn't be the first to find it in case of. I know that OOo is used as a server in a lot of installations without such huge problems. So there must be a particular issue that is special for your setup. So let's summarize and see where we can make progress. We should try to describe everything exactly as possible. You are talking about a document server and a DocumentLoader. The latter seems to be a C++ application and the former seems to be an instance of OOo that is talking with the C++ application though a remote UNO bridge. The DocumentLoader seems to use this instance of OOo to load a ppt file and then it seems that something is eating up your memory. Is that the correct picture? If not, can you describe it better? Especially we need to know most exactly how OOo is used in this scenario. Next question - this something that eats up your memory - did you verify that it is the OOo process whose memory consumption goes through the roof? Another question: did you try the same with other kinds of documents (not ppt)? Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Footnote service not starting
On 29.11.2010 09:27, Swati Soni wrote: Dear Sir, I tried executing the Following code. The mxDocFactory is unable to open the footnote service. How to resolve this error. Request you to please reply to this problem. try { // Create a new footnote from the document factory and get it's // XFootnote interface XFootnote xFootnote = (XFootnote) UnoRuntime.queryInterface( XFootnote.class, mxDocFactory.createInstance ( com.sun.star.text.Footnote ) ); I don't know what mxDocFactory is in your code. If I take it from a text document, creating a footnote works as expected, e.g. in Basic: Sub Main obj = ThisComponent.createInstance(com.sun.star.text.Footnote) print obj.dbg_supportedinterfaces End Sub This will display all interfaces of the implementation class SwXFootnote. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Working with embedded OLE files/packages
Hi David, On 07.12.2010 12:24, David Roe wrote: I have some Excel spreadsheets that contain files embedded as OLE packages (Insert-Object- From file). I want to retrieve the data for those files. I've managed to use the API to retrieve the Shape object and get at the OLE data but I don't fancy writing my own OLE reading code. Is there an API to get at the data inside? I saw css.embed.OLESimpleStorage but I can't seem to get anywhere with that. My code so far is (in Python): # ... setting up of OOo ... sheet = doc.Sheets.getByName('Sheet1') draw_page = sheet.DrawPage shape = draw_page.getByIndex(0) # CLSID ---- is a file?? print 'CLSID:', shape.CLSID obj = shape.EmbeddedObject # Create a storage object to hold the data from our embedded object storage_factory = service_manager.createInstance('com.sun.star.embed.StorageFactory') storage = storage_factory.createInstance() # Store the data into the Something entry of our storage object obj.storeToEntry(storage, 'Something', (), ()) str_elem = storage.openStreamElement('Something', ElementModes.READ) stream = str_elem.getInputStream() sfa = service_manager.createInstance('com.sun.star.ucb.SimpleFileAccess') sfa.writeFile(file_url('test.txt'), stream) Thanks, David Roe As you are asking here, this code obviously doesn't work. Can you tell us where something goes wrong? Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] Re: How to retrieve the state of the feature Format AutoCorrect While Typing in Writer ?
On 28.02.2011 14:07, Thibault Vataire wrote: Hi, I need to programmatically retrieve the state of the feature Format AutoCorrect While Typing in Writer. I've tried two ways but none works properly : 1/ Reading the corresponding property in the Writer.xcu configuration file. But this value don't seem to be updated when application is running, only when the application is shutting down. That's intended; you should see the xcu files as an implementation detail that shouldn't be accessed at runtime. 2/ I can read the state of the menu's entry : myFrame.LayoutManager.getElement(private:resource/menubar/menubar).XMenuBar.getPopupMenu(itemId1).(...).isItemChecked(itemId2) But this value is really updated only if the menu AutoCorrect is displayed one more time after the value has changed. This isn't a good idea. Is someone known another way to retrieve this value ? You could register a StatusListener for .uno:OnlineAutoFormat (IIRC). But this means that you have to do that at every frame. It should be possible to register a ConfigurationUpdateListener for the corresponding key in the xcu file, but it's possible that it doesn't work either because Writer caches this setting internally. That would be a bug, but I assume that this doesn't make it better. I'm afraid you have to find that out. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Severe PrinterSettings Problems, need confirmation
Hi Fernand, AFAIK Philipp Lohmann (pl) is working on it or at least should know who else. If you prefer an open communication channel, please try dev@gsl. Regards, Mathias On 16.03.2011 09:10, Fernand Vanrie wrote: Mathias, Any idea, who is working on or in what version we can do some testing ? thanks Fernand Hi Fernand, On 09.03.2011 14:24, Fernand Vanrie wrote: Hallo Sinds 3.3 (windows) all PrinterSettings except the Printer Name are no longer persistent and not stored anywhere not in the profile, not in the document. Within the settings we have the options who are not Printer specific and we have Settings who are bound to a specific printer. Both are all lost after reloading the document, but we can only use the Printer specific settings during the printing itself. So PageSizes set PrinterSettings must been redone while actualy printing. Setting the PageSizes using the API is also broken, please trye the included code with a printer who accept to changes the PaperSizes PLease can someone confirm this, so i can fill a issue AFAIK the new printer dialog implementation brought this unfortunate side effect. Also AFAIK this is already being worked on. Regards, Mathias -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: embed OO-Window in a Qt Window
On 22.03.2011 09:59, Konstantin Tokarev wrote: 19.03.2011, 17:08, Goran Markicgo...@markic.ch: Dear Sirs We are developing a multi platform (Windows, Linux, Mac) software for communication with our scientific instruments. Therefore we use the qt framework. We would like to embed a spreadsheet or a writer window within our qt window. Because we are developing for several operating systems we think that Open Office could be appropriate for our needs. After studying the UNO framework I haven't found the possibility to integrate an Open Office window into another Application. As far as I have seen, with an axtiveX component it should be possible, but then we are restricted to Windows. Could you please inform us if this is possible with Open Office for the mentioned platforms. Thank you very much Best regards, Dr. Goran Markic Markic Scientific Instruments Disclaimer: I'm not an expert in OOo or UNO programming Nevertheless your answers are excellent. :-) I just want to add something. 3. On X11 platforms you can try to use QX11EmbedWidget to embed OOo window. In general OOo can reuse system windows as OOo windows. We are using this technique not only for the ActiveX component that was mentioned above, but also for the Mozilla browser plugin that works on all platforms. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Toolbar items: how to get them to show the shortcut letter underlined ?
On 25.05.2011 10:34, Rony G. Flatscher wrote: On 25.05.2011 08:35, Mathias Bauer wrote: On 24.05.2011 22:31, Rony G. Flatscher wrote: Hi there, in the meantime I have been able to add shortcuts to the toolbar items and they are operational. However, the shortcut letter is not underlined, although using the tilde (~) before the letter to be underlined in the Label property of the toolbar item. Is there a different property that I would need to use for having OOo underline the shortcut-key? (Again it works, using SHIFT+ALT+letter, where ALT is the META2 KeyModifier.) TIA, ---rony What do you mean by again it works, using SHIFT+ALT+LETTER ? Just that the defined shortcut-keys are operational. E.g. the shortcut for the ~Import toolbar item gets defined as SHIFT+META2+I and if you press SHIFT+ALT+I (META2 is ALT on my Windows keyboard) the toolbar item gets executed. It is just the case that the I does not get underlined in the toolbar item (a button where the text and the assigned icon get displayed). Sorry for being dense ;-), where did you define the shortcut? If a shortcut is defined in a menu, it will executed only if the menu has the focus. I don't think that this works in toolbars. If I just ad a tilde to a toolbar item label, I don't see a way to execute this label as a command like in a menu. Are you sure that you don't talk about accelerators (those who are assigned to commands using tools-customize-keyboard)? Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Toolbar items: how to get them to show the shortcut letter underlined ?
On 25.05.2011 12:06, Rony G. Flatscher wrote: Are you sure that you don't talk about accelerators (those who are assigned to commands using tools-customize-keyboard)? O.K., I think the best is that I show you the code snippets then. The code is in ooRexx but excersises the Java API behind the curtain. The tilde in ooRexx is the message operator, so left of the tilde is the receiving object, right of it the message. In case a queryInterface() is needed, the ooRexx UNO support allows one to merely send the unqualified interface name to the UNO object in order to retrieve that interface. Line comments start with two consecutive dashes (--), block comments are C-like (but can be nested in the Rexx language). Having said that, here's the snippet, which should give you the exact information, please look for the area after the comments lead in as /* (snip) /* *** shortcut *** */ -- got shortcut manager, define key with Shift+Alt combination oShortCutManager=x_UIConfigurationManager~getShortcutManager xShortCutManager=oShortCutManager~XAcceleratorConfiguration modifiers =bsf.getConstant(com.sun.star.awt.KeyModifier, SHIFT) -- Shift-key modifiers+=bsf.getConstant(com.sun.star.awt.KeyModifier, MOD2) -- Alt-key KeyEventClz=bsf.importClass(com.sun.star.awt.KeyEvent) Exactly, these are accelerators, not shortcuts. This is not about the words (others might even use them the other way around), but about the way they are executed. In OOo accelerators work independently from any other UI elements, e.g. menu or toolbar items. In the default configuration CTRL-O will always execute the command .uno:Open, even if no toolbars or menus are present. OTOH, the *menu shortcut* (specified by putting a tilde in front of the letter O in a corresponding menu item label) for this function ALT-F, O (in the English version) can only be used by operating the menu with the keyboard. A comparable functionality does not exist for toolbar items. Thus, a tilde in a toolbar item label does not have any effect and is just considered as garbage. OTOH, toolbar quickhelp texts can show *accelerators* that are configured for the same functionality, in the same way as the menus do. (We don't do that in the item text as in menus as space in toolbars is more limited.) The quickhelp for the Open button shows Open (CTRL+O) because CTRL+O is the accelerator for the .uno:Open command (in the default configuration that may be changed via tools-customize-keyboard). And the menu item for Open also shows CTRL+O. There is some code in OOo's framework that adds the accelerators to the label or quickhelpt text. In menus this code works immediately as menus are always created at the very moment they are opened. Toolbar quickhelp texts need an update notification when the shortcut was changed. As it seems, this update notification is not sent. But the quickhelp text of a new document would be correct as the accelerator is already known when the toolbar is created. As an example, I configured SHIFT-ALT-G for Insert-Gallery in the keyboard configuration. The view menu (don't ask me why the menu has it in view, the config in insert ;-)) immediately shows the new accelerator, the toolbar quickhelp doesn't. If I now open a new document, its toolbar shows the accelerator in the quickhelp text of the Gallery button. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Toolbar items: how to get them to show the shortcut letter underlined ?
On 25.05.2011 14:32, Rony G. Flatscher wrote: How can I define a quickhelp text for each toolbar item? It seems that by default the label of the toolbar item is used as the quickhelp (tooltip?) text, and that does not exhibit the shortcut key by underlying it. Indeed the quickhelp text is the label. It *should* exhibit the shortcut key that is assigned to the same command as the toolbar item, if you make sure that the keyboard configuration was created before the toolbar was created. If not, this would be a missing feature ;-). As I wrote, the accelerator key was shown for built-in commands and for basic macros. So I don't see a general reason why it shouldn't work for scripts. As an example, I configured SHIFT-ALT-G for Insert-Gallery in the keyboard configuration. The view menu (don't ask me why the menu has it in view, the config in insert ;-)) immediately shows the new accelerator, the toolbar quickhelp doesn't. If I now open a new document, its toolbar shows the accelerator in the quickhelp text of the Gallery button. Just tried this via Tools-Customize, but it did not work with the toolbar item. *what* did you try? My example with .uno:Gallery or your script/macro? In case you didn't notice, it is necessary to create the toolbar *after* you have configured the shortcut, e.g. by opening a new document window. P.S.: One observation: it is not possible to delete the programmatically created toolbar using Tools - Customize as the delete option is greyed out. One can delete the individual toolbar items and make the toolbar empty and on the next restart the toolbar seems to have gone. I don't know if this is a bug or by intent, sorry. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Toolbar items: how to get them to show the shortcut letter underlined ?
On 25.05.2011 17:35, Rony G. Flatscher wrote: As an example, I configured SHIFT-ALT-G for Insert-Gallery in the keyboard configuration. The view menu (don't ask me why the menu has it in view, the config in insert ;-)) immediately shows the new accelerator, the toolbar quickhelp doesn't. If I now open a new document, its toolbar shows the accelerator in the quickhelp text of the Gallery button. Just tried this via Tools-Customize, but it did not work with the toolbar item. *what* did you try? My example with .uno:Gallery or your script/macro? Your example. In case you didn't notice, it is necessary to create the toolbar *after* you have configured the shortcut, e.g. by opening a new document window. Did try that, even shut down all instances of OOo writer. It's OOo 3.2.1 though, so maybe that does not work with that old version? Hm, probable. I tested with 3.3. Maybe if I come across a 3.2.1 I might try it again. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Displaying Multiple Dialogs from BASIC
On 16.06.2011 09:22, Hal Vaughan wrote: I've mentioned the sticky-note project I'm working on yesterday in two emails. Now I'm running into a problem: I'd like to display a number of sticky-notes, but to display any kind of dialog in BASIC, I need to do something like this: oSticky = createUnoDialog(DialogLibraries.HalLib.StickyNote) oSticky.Execute() And the program will stop until I close the dialog, either by the close button, a cancel, or OK, or another button. That means the only way to have multiple dialogs open is to open one and from there, open the next, and then open the next and so on. Is there some way, from BASIC, to display a dialog and leave it open without it stopping a script? Execute() starts a modal mode, so it is not only understandable but also required that further *linear* execution of the script stops (handlers registered to buttons still we be called). If you want to have more than one dialog, you have to execute them in a modeless way. I don't know if oSticky.SetVisible(True) works (I even don't know if UnoDialogs export an XWindow interface), but that's how it is done with C++ dialogs. Besides that you will need to redesign your dialog a bit, modeless dialogs usually don't have OK or Cancel buttons, because they directly act on the document when their buttons are operated by the user. If your dialog logic makes it necessary to have an OK button, most probably a modal dialog is recommended and no other dialogs (except sub dialogs) should be operable while it is visible. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS Please don't reply to nospamfor...@gmx.de. I use it for the OOo lists and only rarely read other mails sent to it. -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help