From 47d6568fec47fd0026aec559130ab9492fe57be3 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 20 Oct 2009 21:15:55 +0000 Subject: [Author: thomasvl] Add two apis for making checkboxs/radios and radio groups wrap to their size. Add a unittest to cover normal and mini sizes. R=dmaclach,stuartmorgan DELTA=1174 (1164 added, 0 deleted, 10 changed) --- AppKit/GTMUILocalizerAndLayoutTweaker.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'AppKit/GTMUILocalizerAndLayoutTweaker.h') diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.h b/AppKit/GTMUILocalizerAndLayoutTweaker.h index 4f08525..abcb758 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.h +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.h @@ -52,6 +52,14 @@ // Returns the amount the field changed height. + (CGFloat)sizeToFitFixedWidthTextField:(NSTextField *)textField; +// Insert newlines into the title of the button (radio or checkbox) or all cells +// in the radio group (NSMatrix) so they will word wrap to the item's current +// width. Then +sizeToFitView can be called to have then resize to the exact +// width and height needed. Note: any existing Opt-Return forced wraps are +// removed from the existing titles. ++ (void)wrapButtonTitleForWidth:(NSButton *)button; ++ (void)wrapRadioGroupForWidth:(NSMatrix *)radioGroup; + // Resizes |window| by |delta| without letting the subviews of |window| get // resized. Useful when you've done manual tweaking by things like // +sizeToFitFixedWidthTextField. The window's origin is not adjusted. Passes -- cgit v1.2.3