Grouping radiobuttons together

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
jarkky
Posts: 14
Joined: Sat Oct 12, 2019 5:18 pm

Grouping radiobuttons together

Post by jarkky »

Radio buttons were created as:

Code: Select all

ControlShape = Doc.createInstance("com.sun.star.drawing.ControlShape")
For i=1 To 10
        Cell = SheetErr.getCellByPosition(0, i)
        ControlShape.setPosition(Cell.Position)
        ControlShape.setSize(Cell.Size)
        ButtonModel = CreateUnoService("com.sun.star.form.component.RadioButton")
        ButtonModel.Name = CStr(i)
        ButtonModel.Label = CStr(i)
        ControlShape.setControl(ButtonModel)
        DrawPage.add(ControlShape)
        ControlShape.Anchor = Cell
Next
But it looks they are not grouped together by default.
How can I make the grouping of these radiobuttons?
Is this collection needed to be made as:
ControlShapes = createUnoService("com.sun.star.drawing.ShapeCollection") ?
Last edited by robleyd on Sun Sep 27, 2020 6:04 am, edited 1 time in total.
Reason: Added Code tags
OpenOffice 3.1 on CentOS Linux release 8.0.1905 (Core)
JeJe
Volunteer
Posts: 2784
Joined: Wed Mar 09, 2016 2:40 pm

Re: Grouping radiobuttons together

Post by JeJe »

Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply