GetTextExtent() and control sizing

15 views
Skip to first unread message

Igor Korot

unread,
Feb 8, 2013, 3:34:45 AM2/8/13
to wx-dev
Hi, (Vadim),
I remember the discussion and the ticket about GetTextExtent() and it's
implementation for the text and other related controls.

Now, I'm interested to pull this patch in my wx-2.9.4 version and use it
for the spin control and possibly for the combo box.

However, I can't seem to find a commit that took care of that.

Was it done and if yes, applied?

Thank you.

Vadim Zeitlin

unread,
Feb 8, 2013, 3:55:06 PM2/8/13
to wx-...@googlegroups.com
On Fri, 8 Feb 2013 00:34:45 -0800 Igor Korot wrote:

IK> Hi, (Vadim),
IK> I remember the discussion and the ticket about GetTextExtent() and it's
IK> implementation for the text and other related controls.
IK>
IK> Now, I'm interested to pull this patch in my wx-2.9.4 version and use it
IK> for the spin control and possibly for the combo box.
IK>
IK> However, I can't seem to find a commit that took care of that.
IK>
IK> Was it done and if yes, applied?

If you mean wxTextMeasure changes, then yes, they were applied, but it
took much more than a single commit so they're not going to be trivial to
backport. I am also not sure why do you think you need to do this because
they're completely private to the library, so you wouldn't be able to sue
them anyhow.

Regards,
VZ

Igor Korot

unread,
Feb 8, 2013, 4:00:57 PM2/8/13
to wx-...@googlegroups.com
Vadim,
In my code I'm using wxSpinCtrl and the width of it is too big.
If I remember correctly with this change I can decrease the width of
this control.

Am I wrong? Am I missing something?

Thank you.

>
> Regards,
> VZ

Vadim Zeitlin

unread,
Feb 8, 2013, 4:06:20 PM2/8/13
to wx-...@googlegroups.com
On Fri, 8 Feb 2013 13:00:57 -0800 Igor Korot wrote:

IK> In my code I'm using wxSpinCtrl and the width of it is too big.

You can decrease it by calling SetSize() as usual.

IK> If I remember correctly with this change I can decrease the width of
IK> this control.
IK>
IK> Am I wrong? Am I missing something?

wxTextMeasure changes were mostly refactoring in order to reduce code
duplication. They have no user-visible changes.

Regards,
VZ

Igor Korot

unread,
Feb 8, 2013, 5:21:13 PM2/8/13
to wx-...@googlegroups.com
Vadim,
I was thinking that with this change DoGetBestSize() is changed in compliance
with the text width that can be put in the control.

Guess I was wrong.

Thank you.

>
> Regards,
> VZ

Vadim Zeitlin

unread,
Feb 8, 2013, 6:29:19 PM2/8/13
to wx-...@googlegroups.com
On Fri, 8 Feb 2013 14:21:13 -0800 Igor Korot wrote:

IK> I was thinking that with this change DoGetBestSize() is changed in compliance
IK> with the text width that can be put in the control.

This was always the case and still is.
VZ

Manolo

unread,
Feb 8, 2013, 8:22:12 PM2/8/13
to wx-...@googlegroups.com
Igor,
You're talking about GetSizeFromTextSize()
The patch ("part 4") for wxSpinCtrl was at ticket #14840, applied in r72995.
What I don't remember is if you would need also previous "parts".

Regards,
Manolo

Reply all
Reply to author
Forward
0 new messages