Ticket #14812 (closed enhancement: fixed)

Opened 7 months ago

Last modified 7 months ago

New GetSizeFromTextSize()

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

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

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

Change History

Changed 7 months ago by mmarsan

Changed 7 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).

Changed 7 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.

Changed 7 months ago by VZ

  • status changed from accepted to closed
  • resolution set to fixed

(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.