[Solved] Where is the currency symbol property?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
Mr.Dandy
Posts: 463
Joined: Tue Dec 11, 2012 4:22 pm

[Solved] Where is the currency symbol property?

Post by Mr.Dandy »

2024-07-13 17_00_12-OpenOffice Basic.png
2024-07-13 17_00_12-OpenOffice Basic.png (51.83 KiB) Viewed 5602 times
I don't see where is this property :?

Code: Select all

(Name)             (Value Type)                       (Value)       (Info.)   (Attr.)    (Handle)  
AccessibleContext  .accessibility.XAccessibleContext  -INTERFACE-   Pseud     Read_Only       
Background         long                                             Pseud     WriteOnly       
ControlFont        .awt.FontDescriptor                              Pseud     WriteOnly       
DecimalDigits      short                              2             Pseud                     
DesignMode         boolean                            False         Pseud                     
EchoChar           char                                             Pseud     WriteOnly       
Editable           boolean                            False         Pseud                     
Enable             boolean                                          Pseud     WriteOnly       
First              double                             0.0           Pseud                     
FloatingMode       boolean                                          Pseud     WriteOnly       
FontDescriptors    [].awt.FontDescriptor              -Sequence-    Pseud     Read_Only       
Foreground         long                                             Pseud     WriteOnly       
Graphics           .awt.XGraphics                     -void-        Pseud     Read_Only       
ImplementationId   []byte                             -SEQUENCE-    Pseud     Read_Only       
Info               .awt.DeviceInfo                    -STRUCT-      Pseud     Read_Only       
Last               double                             2147483647.0  Pseud                     
Max                double                             1000000.0     Pseud                     
MaxTextLen         short                              -1            Pseud                     
Min                double                             -1000000.0    Pseud                     
MinimumSize        .awt.Size                          -STRUCT-                Read_Only       
OutputSize         .awt.Size                          -STRUCT-      Pseud                     
Pointer            .awt.XPointer                                    Pseud     WriteOnly       
PosSize            .awt.Rectangle                     -STRUCT-      Pseud     Read_Only       
PreferredSize      .awt.Size                          -STRUCT-      Pseud     Read_Only       
Properties         [].beans.Property                  -Sequence-    Pseud     Read_Only       
SelectedText       string                             0,00 $        Pseud     Read_Only       
Selection          .awt.Selection                     -STRUCT-      Pseud                     
Size               .awt.Size                          -STRUCT-      Pseud     Read_Only       
SpinSize           double                             1.0           Pseud                     
StrictFormat       boolean                            True          Pseud                     
StyleSettings      .awt.XStyleSettings                -INTERFACE-   Attr.     Read_Only       
Text               string                             0,00 $        Pseud                     
Toolkit            .awt.XToolkit                      -INTERFACE-   Pseud     Read_Only       
Types              []type                             -Sequence-    Pseud     Read_Only       
Value              double                             0.0           Pseud                     
Visible            boolean                            True          Pseud                     
Last edited by Mr.Dandy on Sat Jul 13, 2024 6:26 pm, edited 1 time in total.
OpenOffice 4.1.12 - Windows 10
FJCC
Moderator
Posts: 9588
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Where is the currency symbol property?

Post by FJCC »

In this code, CurrencySymbol is a property of the oPrice object, and I suppose the oTotal object also.

Code: Select all

Global oDlg AS Object
Sub Main
	DialogLibraries.LoadLibrary("Standard")
	oLib = DialogLibraries.GetByName("Standard")
	oLib.GetByName("Dialog1")
	oDlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
	oDlg.Execute
End Sub

Sub CalculateMe(oEvt)

	oModel = oDlg.getModel
	oQty 	= oModel.getByName("NumericField1")
	oPrice 	= oModel.getByName("CurrencyField1")
	oTotal 	= oModel.getByName("CurrencyField2")
	qty = oQty.Value
	price = oPrice.Value
	total = price * qty
	oTotal.Value = total
End sub
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Mr.Dandy
Posts: 463
Joined: Tue Dec 11, 2012 4:22 pm

Re: Where is the currency symbol property?

Post by Mr.Dandy »

Weird, because it does not appear through MRI
But it works fine

Code: Select all

oTotal.setProperty("CurrencySymbol", "€")
Thanks
OpenOffice 4.1.12 - Windows 10
User avatar
Villeroy
Volunteer
Posts: 31355
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Where is the currency symbol property?

Post by Villeroy »

What you inspect is the shape on a draw page. You should inspect the member of a form or the member's model. oDrawPage.Forms.getByName("MyForm").getByName("MyControl").getModel().
You can bind a form's or a control's event directly to Xray or MRI and get the event struct of the calling object wich is the Source element of that struct.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Mr.Dandy
Posts: 463
Joined: Tue Dec 11, 2012 4:22 pm

Re: [Solved] Where is the currency symbol property?

Post by Mr.Dandy »

This is not in a form but in a dialog. The Currency control has not this property.
OpenOffice 4.1.12 - Windows 10
User avatar
Zizi64
Volunteer
Posts: 11497
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved] Where is the currency symbol property?

Post by Zizi64 »

This is not in a form but in a dialog. The Currency control has not this property.
Please upload your ODF type sample file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Mr.Dandy
Posts: 463
Joined: Tue Dec 11, 2012 4:22 pm

Re: [Solved] Where is the currency symbol property?

Post by Mr.Dandy »

OpenOffice 4.1.12 - Windows 10
JeJe
Volunteer
Posts: 3127
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Where is the currency symbol property?

Post by JeJe »

oDlg.getcontrol("CurrencyField1").model.CurrencySymbol
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Zizi64
Volunteer
Posts: 11497
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved] Where is the currency symbol property?

Post by Zizi64 »

Weird, because it does not appear through MRI
The XrayTool can show the property list of the method getProperties of oPrice and oTotal objects:
Properties.png
Properties.png (54.13 KiB) Viewed 5393 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
JeJe
Volunteer
Posts: 3127
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Where is the currency symbol property?

Post by JeJe »

There for me MRI oDlg.getcontrol("CurrencyField1").model (Properties tab)
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply