#14812 closed enhancement (fixed)

New GetSizeFromTextSize()

Reported by: mmarsan Owned by: vadz
Priority: normal Milestone:
Component: GUI-all Version: stable-latest
Keywords: GetSizeFromTextSize GetBestSize Cc:
Blocked By: Blocking:
Patch: no

Description

This is the first part of a sequence of patches I'll submit.

The "part_1" implements main public GetSizeFromTextSize() at wxControl and its needed DoGetSizeFromTextSize() for wxTextCtrl, wxChoice, and wxComboBox wxGTK Gtk+{2,3} versions.

I've modified 'combo', 'controls', and 'text' samples in order to see this new feature. I've changed sizers flags so they don't hide real sizes.

Next planned parts:
wxMSW version of part_1
wxComboCtrl, wxSearchCtrl, wxSpinCtrl implementations

Attachments (1)

GetSizeFromTextSize_part_1.patch download (22.4 KB) - added by mmarsan 22 months ago.

Download all attachments as: .zip

Change History (4)

Changed 22 months ago by mmarsan

comment:1 Changed 22 months ago by vadz

  • Owner set to vadz
  • Status changed from new to accepted

Thanks, I'll apply this soon (with some renamings and docs for the new function).

comment:2 Changed 22 months ago by mmarsan

I was reserving docs for the time all other parts were submited. If you do this job, I can't object anything ;)

Before I send more parts, I'll wait for you to apply it, so I can see the new names.

comment:3 Changed 22 months ago by VZ

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [72935]) Add wxControl::GetSizeFromTextSize() to size the control to its text.

This function can be used to size a, say, wxTextCtrl to be exactly of the size
needed to enter the given amount of text in it.

This patch adds wxGTK implementation for wxTextCtrl, wxChoice and wxCombobox;
changes to the samples and the documentation.

Closes #14812.

Note: See TracTickets for help on using tickets.