@@ -160,23 +160,19 @@ - (id)init
160160
161161- (void )awakeFromNib
162162{
163- #ifndef SP_CODA /* ui manipulation */
164163 // Set the structure and index view's vertical gridlines if required
165164 [tableSourceView setGridStyleMask: [prefs boolForKey: SPDisplayTableViewVerticalGridlines] ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
166165 [indexesTableView setGridStyleMask: [prefs boolForKey: SPDisplayTableViewVerticalGridlines] ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
167- #endif
168166
169167 // Set the double-click action in blank areas of the table to create new rows
170168 [tableSourceView setEmptyDoubleClickAction: @selector (addField: )];
171169
172- #ifndef SP_CODA /* set font from prefs */
173170 BOOL useMonospacedFont = [prefs boolForKey: SPUseMonospacedFonts];
174171 NSInteger monospacedFontSize = [prefs integerForKey: SPMonospacedFontSize] > 0 ? [prefs integerForKey: SPMonospacedFontSize] : [NSFont smallSystemFontSize ];
175172
176173 // Set the strutcture and index view's font
177174 [tableSourceView setFont: useMonospacedFont ? [NSFont fontWithName: SPDefaultMonospacedFontName size: monospacedFontSize] : [NSFont systemFontOfSize: [NSFont smallSystemFontSize ]]];
178175 [indexesTableView setFont: useMonospacedFont ? [NSFont fontWithName: SPDefaultMonospacedFontName size: monospacedFontSize] : [NSFont systemFontOfSize: [NSFont smallSystemFontSize ]]];
179- #endif
180176
181177 extraFieldSuggestions = [@[
182178 @" None" ,
@@ -250,17 +246,12 @@ - (void)awakeFromNib
250246 name: SPDocumentTaskEndNotification
251247 object: tableDocumentInstance];
252248
253- #ifndef SP_CODA /* add prefs observer */
254249 [prefs addObserver: indexesController forKeyPath: SPUseMonospacedFonts options: NSKeyValueObservingOptionNew context: NULL ];
255- #endif
256250
257- #ifndef SP_CODA
258251 // Init the view column submenu according to saved hidden status;
259252 // menu items are identified by their tag number which represents the initial column index
260253 for (NSMenuItem *item in [viewColumnsMenu itemArray ]) [item setState: NSOnState ]; // Set all items to NSOnState
261- #endif
262254
263- #ifndef SP_CODA /* patch */
264255 for (NSTableColumn *col in [tableSourceView tableColumns ])
265256 {
266257 if ([col isHidden ]) {
@@ -274,24 +265,7 @@ - (void)awakeFromNib
274265 [[viewColumnsMenu itemWithTag: 12 ] setState: NSOffState ];
275266 }
276267 }
277- #else
278- /*
279- for (NSTableColumn *col in [tableSourceView tableColumns])
280- {
281- if ([col isHidden]) {
282- if ([[col identifier] isEqualToString:@"Key"])
283- [[viewColumnsMenu itemAtIndex:[viewColumnsMenu indexOfItemWithTag:7]] setState:NSOffState];
284- else if ([[col identifier] isEqualToString:@"encoding"])
285- [[viewColumnsMenu itemAtIndex:[viewColumnsMenu indexOfItemWithTag:10]] setState:NSOffState];
286- else if ([[col identifier] isEqualToString:@"collation"])
287- [[viewColumnsMenu itemAtIndex:[viewColumnsMenu indexOfItemWithTag:11]] setState:NSOffState];
288- else if ([[col identifier] isEqualToString:@"comment"])
289- [[viewColumnsMenu itemAtIndex:[viewColumnsMenu indexOfItemWithTag:12]] setState:NSOffState];
290- }
291- }
292- */
293- #endif
294-
268+
295269 [tableSourceView reloadData ];
296270}
297271
@@ -2478,20 +2452,20 @@ - (void)_displayFieldTypeHelpIfPossible:(SPComboBoxCell *)cell
24782452
24792453 const SPFieldTypeHelp *help = [[self class ] helpForFieldType: selected];
24802454
2481- if (help) {
2455+ if (help) {
24822456 NSMutableAttributedString *as = [[NSMutableAttributedString alloc ] init ];
24832457
24842458 // title
24852459 {
2486- NSDictionary *titleAttr = @{NSFontAttributeName : [NSFont boldSystemFontOfSize: [NSFont systemFontSize ]]};
2460+ NSDictionary *titleAttr = @{NSFontAttributeName : [NSFont boldSystemFontOfSize: [NSFont systemFontSize ]], NSForegroundColorAttributeName : [ NSColor controlTextColor ] };
24872461 NSAttributedString *title = [[NSAttributedString alloc ] initWithString: [help typeDefinition ] attributes: titleAttr];
24882462 [as appendAttributedString: [title autorelease ]];
24892463 [[as mutableString ] appendString: @" \n " ];
24902464 }
24912465
24922466 // range
2493- if ([[help typeRange ] length ]) {
2494- NSDictionary *rangeAttr = @{NSFontAttributeName : [NSFont systemFontOfSize: [NSFont smallSystemFontSize ]]};
2467+ if ([[help typeRange ] length ]) {
2468+ NSDictionary *rangeAttr = @{NSFontAttributeName : [NSFont systemFontOfSize: [NSFont smallSystemFontSize ]], NSForegroundColorAttributeName : [ NSColor controlTextColor ] };
24952469 NSAttributedString *range = [[NSAttributedString alloc ] initWithString: [help typeRange ] attributes: rangeAttr];
24962470 [as appendAttributedString: [range autorelease ]];
24972471 [[as mutableString ] appendString: @" \n " ];
@@ -2501,7 +2475,7 @@ - (void)_displayFieldTypeHelpIfPossible:(SPComboBoxCell *)cell
25012475
25022476 // description
25032477 {
2504- NSDictionary *descAttr = @{NSFontAttributeName : [NSFont systemFontOfSize: [NSFont systemFontSize ]]};
2478+ NSDictionary *descAttr = @{NSFontAttributeName : [NSFont systemFontOfSize: [NSFont systemFontSize ]], NSForegroundColorAttributeName : [ NSColor controlTextColor ] };
25052479 NSAttributedString *desc = [[NSAttributedString alloc ] initWithString: [help typeDescription ] attributes: descAttr];
25062480 [as appendAttributedString: [desc autorelease ]];
25072481 }
@@ -2522,7 +2496,7 @@ - (void)_displayFieldTypeHelpIfPossible:(SPComboBoxCell *)cell
25222496 NSPoint topRightCorner = NSMakePoint (popUpFrame.origin .x , NSMaxY (popUpFrame));
25232497 NSRect screenRect = [NSScreen rectOfScreenAtPoint: topRightCorner];
25242498
2525- if (NSMaxX (popUpFrame)+10 +winRect.size .width > NSMaxX (screenRect)-10 ) {
2499+ if (NSMaxX (popUpFrame)+10 +winRect.size .width > NSMaxX (screenRect)-10 ) {
25262500 // exceeds right border, display on the left
25272501 winRect.origin .x = popUpFrame.origin .x - 10 - winRect.size .width ;
25282502 }
@@ -2533,6 +2507,7 @@ - (void)_displayFieldTypeHelpIfPossible:(SPComboBoxCell *)cell
25332507
25342508 winRect.size .height = rect.size .height + winAddonSize;
25352509 winRect.origin .y = NSMaxY (popUpFrame) - winRect.size .height ;
2510+
25362511 [structureHelpPanel setFrame: winRect display: YES ];
25372512
25382513 [structureHelpPanel orderFront: nil ];
0 commit comments