Hi Jürgen, Alle 14:55, venerdì 14 luglio 2006, Jürgen Schmidt ha scritto: [...] > Let me say some words on the snippets and what i have in mind with at > least the Basic snippets. > I would like to see a lot of small snippets which can be categorized and > sorted easily.
About this I would suggest that, at least for Calc, anyone can use my DispatchToApiRecorder to automatically generate valid code to submit as CodeSnippet Currently about 80 Calc dispatches are mapped to the corresponding API (starbasic) code, so I think that in this way we can obtain about 20-30 small snippets or even more. If you want a try, download and install the following two UNO packages: http://www.paolo-mantovani.org/downloads/DispatchToApiRecorder/DispatchToApiRecorder-20060707.uno.pkg http://www.paolo-mantovani.org/downloads/DispatchToApiRecorder/transformers/Calc/CalcDispatchToApiTransformer-20060707.uno.pkg Just to give the idea, at the end of this post you can find an example of the automatically generated code that you can obtain. > The idea is to have some kind of snippet browser in the > Basic IDE some time in the future. The browse should make it possible to > simply browse over a huge snippet collection and using drag and drop to > insert a snippet in an existing macro. Ideally the important > variables/points which needs adaption can be accessed easily by > navigation with the tab key. How it should look like in detail i have no > idea yet but i assume that it can help beginners to get started with > macros and of course it can speed up the work of power macros coders. Great!! > I think that this can be implemented as a component (maybe we have to > support some special interfaces) and maybe their is one more volunteers > in the community who are interested in such a project. It is a good way > to get started without deep knowledge of the code base. > > Don't hesitate to come back on the list with your own ideas or when you > are simply interested to help. regards Paolo Mantovani REM ***** BASIC ***** Sub Main ' Recorded by Paolo Mantovani ' Date: Fri Jul 14 15:17:18 2006 ' get access to the document oDocumentModel = ThisComponent oDocumentView = oDocumentModel.getCurrentController() oCellRange = oDocumentView.ActiveSheet.getCellRangeByName("A1:A15") oDocumentView.select(oCellRange) ' Retrieve the standard number format for currency aLocale = CreateUnoStruct("com.sun.star.lang.Locale") With aLocale .Language = "it" .Country = "IT" End With nFormatType = com.sun.star.util.NumberFormat.CURRENCY nFormatKey = oDocumentModel.NumberFormats.getStandardFormat(nFormatType, aLocale) ' Apply the number format to the current selection oDocumentView.Selection.NumberFormat = nFormatKey End Sub --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
