U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Fit control to text
Fit control to text [message #5803] Tue, 17 October 2006 01:31 Go to next message
antonio is currently offline  antonio
Messages: 2
Registered: October 2006
Location: iTALY
Junior Member
I would like to create a function like this


int res=RadioDialog
("Select an option | Option 1 | Option 2 | Option 3")


Which should show a dialog with radio options (Option 1, 2 etc ) and return user choice in res variable.

The problem for me is to get the size of the options text and therefore set the size of the dialog windows.

In other words: how can I fit a button (or any other widget with text inside) to its caption text.

Thanks in advance.
Re: Fit control to text [message #5804 is a reply to message #5803] Tue, 17 October 2006 02:19 Go to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
No direct support now.

I think you have following options:

- get the dimensions from the additional parameter and/or application environment - this is what I have done in past in similiar scenarios

- get the text width and add some reasonable constant for the option image and image-text gap (32 would work fine I think).

- create your own widget (not as hard as it sounds)

- suggest and discuss U++ improvement Wink

Mirek
Previous Topic: Problem with ColumnList (with example) [BUG/FIXED]
Next Topic: StdFont(11) in DocEdit and LineEdit
Goto Forum:
  


Current Time: Wed Sep 16 09:41:46 GMT+2 2026

Total time taken to generate the page: 0.00628 seconds