On 28.04.21 09:20, Jörg Schmidt wrote:
-----Original Message-----
From: Peter Kovacs [mailto:pe...@apache.org]
Sent: Wednesday, April 28, 2021 4:28 AM
To: dev@openoffice.apache.org
Subject: Feature: automatic enter of a decimal point at a
fixed position

Hello all,


I have been asked on Facebook, and I found a forum thread if
there is a
feature that interprets the entry of numbers the last 2
numbers as digits.

So if you enter 1234 calc will enter 12.34 in the cell. This
is good for
accountants to enter a lot of numbers. (Need to think less, which I
appreciate when I have to do a lot repeated tasks.)

Excel does this with some complicated menu.

I could not find any feature or extension. Adding this as a extension
sounds great to me and this sounds not to complicated.


I would go for

# a extension config which sets up the digits to be moved.

# a button to toggle the feature

# a small macro that divides by the setup amounts if the cell is
overwritten. (don't know if this definition can be used)


Any Ideas, or inputs? Does LO maybe have done this? (I could not find
any hints.)

How we could take care the extension gets translated? (we =
community, I
do not think this needs to be an ASF extension.)
This is simple. You need the following working macro (the macro still needs 
some error routines):

Sub Main
        addr = Thiscomponent.getCurrentSelection
        If addr.supportsService("com.sun.star.sheet.SheetCell") Then
                Thiscomponent.getCurrentSelection.Value = 
Thiscomponent.getCurrentSelection.Value/100
        End If
End Sub

and these two macros to activate and deactivate the function:

Sub activate_special_input()
        Dim mEventProps(1) as new com.sun.star.beans.PropertyValue
        mEventProps(0).Name = "EventType"
        mEventProps(0).Value = "Script"
        mEventProps(1).Name = "Script"
        mEventProps(1).Value = 
"vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document"
        
ThisComponent.CurrentController.ActiveSheet.Events.ReplaceByName("OnChange", 
mEventProps())
End Sub

Sub deactivate_special_input()
        
ThisComponent.CurrentController.ActiveSheet.Events.ReplaceByName("OnChange", 
Array())
End Sub

I have uploaded a draft here:
www.calc-info.de/files/SpecialInput.ods

Please note the menu "Special Input" included in the file.

Thanks, this is awesome.

What error handling is needed? Can you add the error handling? What license do you prefer?

It would be great if this can be an extension, that users can add if they whish.

I think it is to early to add the extension to the installer, but if there is interest within the user - community why not.

can we publish the code on github?

I would prefer with an ASF Repo, but I feel that we had so far no agreement to this. Is there any opposition if we create an "OpenOffice Extension" Organisation That then collects extension code?

This is just a wild Idea. Maybe it is bullocks. I am just flashed on Jörgs Macro :). And would like to game with the abilities. It helps me too to learn more on OpenOffice.


Anyone on an Idea how to make an extension multilingual? I will ask on forums, too. Havent forgot forums. Just thinking in Project terms first, before looking into individual solutions.


All the best

Peter

--
This is the Way! http://www.apache.org/theapacheway/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to