CustomProperty Layout - horizontal row of radio buttons?

21 views
Skip to first unread message

Martin Chatterjee

unread,
Jan 12, 2011, 5:04:36 AM1/12/11
to soft...@listproc.autodesk.com
Hi there,

I'm working on the layout of a CustomProperty and would like to show a number of radio buttons in one horizontal line.

Creating the radioButtons via PPGLayout.AddEnumControl() works fine - however they always get shown as a column of radio buttons (one per line).

Is it possible to draw them one after the other in the same line?

Thanks in advance for any help/advice!

Cheers, Martin
--
        Martin Chatterjee

[ Freelance Technical Director ]
[    http://www.chatterjee.de    ]

Stefan Kubicek

unread,
Jan 12, 2011, 5:25:57 AM1/12/11
to soft...@listproc.autodesk.com
You can. Any item added to the layout between an oLayout.AddRow() and oLayout.EndRow()
will be rendered in a row without starting a new line, as long as there is enogh space.


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Martin Chatterjee

unread,
Jan 12, 2011, 5:36:57 AM1/12/11
to soft...@listproc.autodesk.com
Stefan,

yeah I'm aware of AddRow() and EndRow() - unfortunately this does not help in this situation.

Essentially I am adding one item (a RadioButton Control with three options) and I want to align these three buttons in a single row (see below). 

Initially I thought there should be an attribute for this that I could set via PPGItem.SetAttribute() but I cannot find anything  that works...  

Any ideas?  Thanks in advance, Martin

-----------------------------------------------
# [...]
aItems = ["ONE", "ONE", "TWO", "TWO", "THREE", "THREE"]

oLay.AddRow()
oLay.AddEnumControl(myStringParam, aItems,  "label", constants.siControlRadio)
oLay.EndRow()
# [...]
------------------------------------------------

--
        Martin Chatterjee

[ Freelance Technical Director ]
[    http://www.chatterjee.de    ]


Stefan Kubicek

unread,
Jan 12, 2011, 5:49:41 AM1/12/11
to soft...@listproc.autodesk.com
You are using AddEnumControl with the siPPGControlType set to siControlRadio, right?
I haven't used this yet, but rather used a siControlIconList, but maybe the following will work in analogy for you too:
(Staright copy/paste from my code, sorry)

aUIitems = (CustomGFXFilesPath + "QMenu_MenuA.bmp", 0, CustomGFXFilesPath + "QMenu_MenuB.bmp", 1, CustomGFXFilesPath + "QMenu_MenuD.bmp", 3, CustomGFXFilesPath + "QMenu_MenuC.bmp",2)
oMenuSelector = oLayout.AddEnumControl ("QuadSelector", aUIitems, "Quadrant", c.siControlIconList)

oMenuSelector.SetAttribute(c.siUINoLabel, True)
oMenuSelector.SetAttribute(c.siUIColumnCnt,2)
oMenuSelector.SetAttribute(c.siUILineCnt,2)
oMenuSelector.SetAttribute(c.siUISelectionColor,0x000ff)

Let me know if this worked.


--
-------------------------------------------
Stefan Kubicek Co-founder
-------------------------------------------
keyvis digital imagery
1050 Vienna Wehrgasse 9 Austria
Phone: +43/699/12614231
--- www.keyvis.at ste...@keyvis.at ---
-- This email and its attachments are
--confidential and for the recipient only--

Martin Chatterjee

unread,
Jan 12, 2011, 6:23:09 AM1/12/11
to soft...@listproc.autodesk.com
Stefan, 

thanks for your code snippet - however I'm afraid that siUIColumnCnt and siUILineCnt don't have any effect on radioButtons... Oh well, worth a try... ;-)

I'd still very much like to use radio buttons for this - anybody got an idea how to force them into one line?

Thanks in advance,

Martin
--
        Martin Chatterjee

[ Freelance Technical Director ]
[    http://www.chatterjee.de    ]


Stephen Blair

unread,
Jan 12, 2011, 6:44:12 AM1/12/11
to soft...@listproc.autodesk.com
HI Martin

I really don't think it is possible to get a horizontal layout for siControlRadio.

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Martin Chatterjee
Sent: January-12-11 6:23 AM
To: soft...@listproc.autodesk.com
Subject: Re: CustomProperty Layout - horizontal row of radio buttons?

Stefan,

thanks for your code snippet - however I'm afraid that siUIColumnCnt and siUILineCnt don't have any effect on radioButtons... Oh well, worth a try... ;-)

I'd still very much like to use radio buttons for this - anybody got an idea how to force them into one line?

Thanks in advance,

Martin
--
Martin Chatterjee

[ Freelance Technical Director ]
[ http://www.chatterjee.de ]

On Wed, Jan 12, 2011 at 11:49 AM, Stefan Kubicek <s...@tidbit-images.com<mailto:s...@tidbit-images.com>> wrote:
You are using AddEnumControl with the siPPGControlType set to siControlRadio, right?
I haven't used this yet, but rather used a siControlIconList, but maybe the following will work in analogy for you too:
(Staright copy/paste from my code, sorry)

aUIitems = (CustomGFXFilesPath + "QMenu_MenuA.bmp", 0, CustomGFXFilesPath + "QMenu_MenuB.bmp", 1, CustomGFXFilesPath + "QMenu_MenuD.bmp", 3, CustomGFXFilesPath + "QMenu_MenuC.bmp",2)
oMenuSelector = oLayout.AddEnumControl ("QuadSelector", aUIitems, "Quadrant", c.siControlIconList)

oMenuSelector.SetAttribute(c.siUINoLabel, True)
oMenuSelector.SetAttribute(c.siUIColumnCnt,2)
oMenuSelector.SetAttribute(c.siUILineCnt,2)
oMenuSelector.SetAttribute(c.siUISelectionColor,0x000ff)

Let me know if this worked.


--
-------------------------------------------
Stefan Kubicek Co-founder
-------------------------------------------
keyvis digital imagery
1050 Vienna Wehrgasse 9 Austria
Phone: +43/699/12614231

--- www.keyvis.at<http://www.keyvis.at> ste...@keyvis.at<mailto:ste...@keyvis.at> ---

winmail.dat

Martin Chatterjee

unread,
Jan 12, 2011, 6:54:57 AM1/12/11
to soft...@listproc.autodesk.com
Hi Stephen,

all right - thanks for the confirmation...  

Cheers, Martin

--
        Martin Chatterjee

[ Freelance Technical Director ]
[    http://www.chatterjee.de    ]


Reply all
Reply to author
Forward
0 new messages