summaryrefslogtreecommitdiff
path: root/src/Fl_Native_File_Chooser_MAC.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-06-06 12:11:04 +0000
committerManolo Gouy <Manolo>2011-06-06 12:11:04 +0000
commit922352799211caa32187bdd92af26a0527d3b304 (patch)
treebc8952f377fa265f9554f534a478f9db1f58ae41 /src/Fl_Native_File_Chooser_MAC.mm
parentc53313ac6ed1f1d11f2a2ca912cfc38596a28f50 (diff)
Mac OS: allow internationalization of file dialogs (continued).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Native_File_Chooser_MAC.mm')
-rw-r--r--src/Fl_Native_File_Chooser_MAC.mm11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm
index e96a9c2c6..4f534eb72 100644
--- a/src/Fl_Native_File_Chooser_MAC.mm
+++ b/src/Fl_Native_File_Chooser_MAC.mm
@@ -465,9 +465,9 @@ static NSPopUpButton *createPopupAccessory(NSSavePanel *panel, const char *filte
NSPopUpButton *popup;
NSRect rectview = NSMakeRect(5, 5, 350, 30 );
NSView *view = [[[NSView alloc] initWithFrame:rectview] autorelease];
- NSRect rectbox = NSMakeRect(0, 3, 50, 1 );
+ NSRect rectbox = NSMakeRect(0, 3, 140, 20 );
NSBox *box = [[[NSBox alloc] initWithFrame:rectbox] autorelease];
- NSRect rectpop = NSMakeRect(60, 0, 250, 30 );
+ NSRect rectpop = NSMakeRect(105, 0, 246, 30 );
popup = [[[NSPopUpButton alloc ] initWithFrame:rectpop pullsDown:NO] autorelease];
[view addSubview:box];
[view addSubview:popup];
@@ -478,9 +478,14 @@ static NSPopUpButton *createPopupAccessory(NSSavePanel *panel, const char *filte
NSFont *font = [NSFont controlContentFontOfSize:NSRegularControlSize];
[box setTitleFont:font];
[box sizeToFit];
+ // horizontally move box to fit the locale-dependent width of its title
+ NSRect r=[box frame];
+ NSPoint o = r.origin;
+ o.x = rectpop.origin.x - r.size.width + 15;
+ [box setFrameOrigin:o];
CFStringRef tab = CFSTR("\n");
CFStringRef tmp_cfs;
- tmp_cfs = CFStringCreateWithCString(NULL, filter, kCFStringEncodingASCII);
+ tmp_cfs = CFStringCreateWithCString(NULL, filter, kCFStringEncodingUTF8);
CFArrayRef array = CFStringCreateArrayBySeparatingStrings(NULL, tmp_cfs, tab);
CFRelease(tmp_cfs);
CFRelease(tab);