From 15227df3de3128017fce7785853f88ba77792239 Mon Sep 17 00:00:00 2001 From: Dave Dribin Date: Mon, 25 May 2009 14:08:33 -0500 Subject: [PATCH] Conditionally set segment style in code, so XIB can compile without warnins on 10.4. Fixes Issue #1 --- lib/JRFeedbackController.h | 1 + lib/JRFeedbackController.m | 6 ++++++ lib/JRFeedbackProvider.xib | 40 ++++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lib/JRFeedbackController.h b/lib/JRFeedbackController.h index 66bbb04..6304b8a 100644 --- a/lib/JRFeedbackController.h +++ b/lib/JRFeedbackController.h @@ -20,6 +20,7 @@ typedef enum { IBOutlet NSTextField *nameTextField; IBOutlet NSComboBox *emailAddressComboBox; IBOutlet NSProgressIndicator *progress; + IBOutlet NSSegmentedControl *segmentedControl; NSAttributedString *sectionStrings[JRFeedbackController_SectionCount]; JRFeedbackController_Section currentSection; diff --git a/lib/JRFeedbackController.m b/lib/JRFeedbackController.m index 7ee6863..c63b4a0 100644 --- a/lib/JRFeedbackController.m +++ b/lib/JRFeedbackController.m @@ -74,6 +74,12 @@ - (id)init { } - (void)windowDidLoad { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + // Not sure why, but you have to call this twice to "take" (10.5.7). + // First call always sets it to NSSegmentStyleRounded. + [segmentedControl setSegmentStyle:NSSegmentStyleTexturedSquare]; + [segmentedControl setSegmentStyle:NSSegmentStyleTexturedSquare]; +#endif NSString* title = [NSString stringWithFormat:@"%@ Feedback", [[[NSBundle bundleForClass:[self class]] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey]]; [[self window] setTitle:title]; diff --git a/lib/JRFeedbackProvider.xib b/lib/JRFeedbackProvider.xib index 968a879..d59fc66 100644 --- a/lib/JRFeedbackProvider.xib +++ b/lib/JRFeedbackProvider.xib @@ -1,27 +1,19 @@ - + 1040 - 9G66 - 677 - 949.43 + 9J61 + 672 + 949.46 353.00 YES + YES com.apple.InterfaceBuilder.CocoaPlugin - - YES - - YES - - - YES - - YES @@ -44,14 +36,14 @@ {492, 5000} {492, 393} - + 319 YES 268 - {{19, 384}, {454, 25}} + {{19, 385}, {458, 24}} YES @@ -84,7 +76,6 @@ 2 - 4 @@ -584,6 +575,7 @@ ZWxwIHlvdT8KA {492, 428} + {{0, 0}, {1920, 1178}} {492, 415} @@ -729,6 +721,14 @@ ZWxwIHlvdT8KA 119 + + + segmentedControl + + + + 120 + @@ -960,10 +960,10 @@ ZWxwIHlvdT8KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{602, 651}, {492, 428}} + {{314, 619}, {492, 428}} com.apple.InterfaceBuilder.CocoaPlugin - {{602, 651}, {492, 428}} + {{314, 619}, {492, 428}} {196, 240} {{49, 462}, {492, 394}} @@ -1013,7 +1013,7 @@ ZWxwIHlvdT8KA - 119 + 120 @@ -1044,6 +1044,7 @@ ZWxwIHlvdT8KA includeHardwareDetailsCheckbox nameTextField progress + segmentedControl textView @@ -1052,6 +1053,7 @@ ZWxwIHlvdT8KA NSButton NSTextField NSProgressIndicator + NSSegmentedControl NSTextView