Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 13975
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: Fri May 03 15:48:48 CEST 2024

Total time taken to generate the page: 0.02763 seconds