Home » U++ Library support » RichText,QTF,RTF... » how to get Text Size from controls like EditString?
|
|
|
|
|
|
Re: how to get Text Size from controls like EditString? [message #2373 is a reply to message #2372] |
Mon, 10 April 2006 09:22 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
fudadmin wrote on Sun, 09 April 2006 21:55 |
luzr wrote on Sun, 09 April 2006 14:55 |
...
Draw::GetTextSize?
Mirek
|
1. How to use it? (Same difficulty as Image resize... )
2. I've found more...
Size sz1 = ScreenInfo().GetTextSize("text size test",font);
Size sz2 = StdDisplay().GetStdSize(editvalue);
but they require recalculations EditString...
3. Actually, it would be good to have EditField::AutoSize(true) or similar...
|
1. Not at all - quite minimal interface IMHO (to get the text size, you have to know the text and the font, do not you).
OK, that ScreenInfo() is unnecessary and current refactoring will remove that...
2. Beware, StdDisplay().GetStdSize does not do exactly the same thing!
3. Ok, that would solve that, would not it? I am sorry, not until now I have seen that that F2 feature in IE resizes editfield.... BTW, it is pretty fuzzy bussines....
Mirek
|
|
|
|
|
|
|
Re: how to get Text Size from controls like EditString? [message #2395 is a reply to message #2394] |
Tue, 11 April 2006 10:13 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
fudadmin wrote on Mon, 10 April 2006 22:31 |
luzr wrote on Mon, 10 April 2006 08:22 |
3. Ok, that would solve that, would not it? I am sorry, not until now I have seen that that F2 feature in IE resizes editfield.... BTW, it is pretty fuzzy bussines....
Mirek
|
I did it.
Edit: P.S. Why is it fuzzy?
|
Well, see HOW it gets resized... It grows when you type characters in, but the size is limited by the size of "view".
However, when you get the text scrolled, size is defined just by the part after the "scrollpoint", so if you delete them, it gets smaller than it would need to be to show the whole text. Quite weird
Mirek
|
|
|
Re: how to get Text Size from controls like EditString? [message #2396 is a reply to message #2395] |
Tue, 11 April 2006 13:18 |
|
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Tue, 11 April 2006 09:13 |
fudadmin wrote on Mon, 10 April 2006 22:31 |
luzr wrote on Mon, 10 April 2006 08:22 |
3. Ok, that would solve that, would not it? I am sorry, not until now I have seen that that F2 feature in IE resizes editfield.... BTW, it is pretty fuzzy bussines....
Mirek
|
I did it.
Edit: P.S. Why is it fuzzy?
|
Well, see HOW it gets resized... It grows when you type characters in, but the size is limited by the size of "view".
However, when you get the text scrolled, size is defined just by the part after the "scrollpoint", so if you delete them, it gets smaller than it would need to be to show the whole text. Quite weird
Mirek
|
I think it's more weird when Ultimate++ TreeCtrl doesn't have any editing capabilities... and users have to spend enormous amount of time searching for simple simple methods ...
ok, this is a piece of code for it
Size NodeEditor::GetMinFitSize() //todo: other fonts and displays
{
Size sz = StdDisplay().GetStdSize(GetData());
sz += Size(2 * 4, 2 * 3); //adding some margins...
return sz;
}
BTW, it's possible to make the view to grow or grow Edit vertically, too.
[Updated on: Tue, 11 April 2006 16:20] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:26:42 CET 2024
Total time taken to generate the page: 0.00594 seconds
|