API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
CPAlert.j
Go to the documentation of this file.
1 /*
2  * CPAlert.j
3  * AppKit
4  *
5  * Created by Jake MacMullin.
6  * Copyright 2008, Jake MacMullin.
7  *
8  * 11/10/2008 Ross Boucher
9  * - Make it conform to style guidelines, general cleanup and enhancements
10  * 11/10/2010 Antoine Mercadal
11  * - Enhancements, better compliance with Cocoa API
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2.1 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with this library; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26  */
27 
28 
29 
30 @class CPCheckBox
31 
32 @global CPApp
33 
34 /*
35  @global
36  @group CPAlertStyle
37 */
38 CPWarningAlertStyle = 0;
39 /*
40  @global
41  @group CPAlertStyle
42 */
43 CPInformationalAlertStyle = 1;
44 /*
45  @global
46  @group CPAlertStyle
47 */
48 CPCriticalAlertStyle = 2;
49 
50 var bottomHeight = 71;
51 
74 @implementation CPAlert : CPObject
75 {
76  BOOL _showHelp;
77  BOOL _showSuppressionButton;
78 
79  CPAlertStyle _alertStyle;
80  CPString _title;
81  CPView _accessoryView;
82  CPImage _icon;
83 
84  CPArray _buttons;
85  CPCheckBox _suppressionButton;
86 
87  id _delegate;
88  id _modalDelegate;
89  SEL _didEndSelector;
90  Function _didEndBlock;
91 
92  _CPAlertThemeView _themeView;
93  CPWindow _window;
94  int _defaultWindowStyle;
95 
96  CPImageView _alertImageView;
97  CPTextField _informativeLabel;
98  CPTextField _messageLabel;
99  CPButton _alertHelpButton;
100 
101  BOOL _needsLayout;
102 }
103 
104 #pragma mark Creating Alerts
105 
116 + (CPAlert)alertWithMessageText:(CPString)aMessage defaultButton:(CPString)defaultButtonTitle alternateButton:(CPString)alternateButtonTitle otherButton:(CPString)otherButtonTitle informativeTextWithFormat:(CPString)informativeText
117 {
118  var newAlert = [[self alloc] init];
119 
120  [newAlert setMessageText:aMessage];
121  [newAlert addButtonWithTitle:defaultButtonTitle];
122 
123  if (alternateButtonTitle)
124  [newAlert addButtonWithTitle:alternateButtonTitle];
125 
126  if (otherButtonTitle)
127  [newAlert addButtonWithTitle:otherButtonTitle];
128 
129  if (informativeText)
130  [newAlert setInformativeText:informativeText];
131 
132  return newAlert;
133 }
134 
141 + (CPAlert)alertWithError:(CPString)anErrorMessage
142 {
143  var newAlert = [[self alloc] init];
144 
145  [newAlert setMessageText:anErrorMessage];
146  [newAlert setAlertStyle:CPCriticalAlertStyle];
147 
148  return newAlert;
149 }
150 
154 - (id)init
155 {
156  self = [super init];
157 
158  if (self)
159  {
160  _buttons = [];
161  _alertStyle = CPWarningAlertStyle;
162  _showHelp = NO;
163  _needsLayout = YES;
164  _defaultWindowStyle = _CPModalWindowMask;
165  _themeView = [_CPAlertThemeView new];
166 
167  _messageLabel = [CPTextField labelWithTitle:@"Alert"];
168  _alertImageView = [[CPImageView alloc] init];
169  _informativeLabel = [[CPTextField alloc] init];
170  _suppressionButton = [CPCheckBox checkBoxWithTitle:@"Do not show this message again"];
171 
172  _alertHelpButton = [[CPButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 16.0, 16.0)];
173  [_alertHelpButton setTarget:self];
174  [_alertHelpButton setAction:@selector(_showHelp:)];
175  }
176 
177  return self;
178 }
179 
180 #pragma mark Accessors
181 
182 - (CPTheme)theme
183 {
184  return [_themeView theme];
185 }
186 
192 - (void)setTheme:(CPTheme)aTheme
193 {
194  if (aTheme === [self theme])
195  return;
196 
197  if (aTheme === [CPTheme defaultHudTheme])
198  _defaultWindowStyle = CPTitledWindowMask | CPHUDBackgroundWindowMask;
199  else
200  _defaultWindowStyle = CPTitledWindowMask;
201 
202  _window = nil; // will be regenerated at next layout
203  _needsLayout = YES;
204  [_themeView setTheme:aTheme];
205 }
206 
207 - (void)setValue:(id)aValue forThemeAttribute:(CPString)aName
208 {
209  [_themeView setValue:aValue forThemeAttribute:aName];
210 }
211 
212 - (void)setValue:(id)aValue forThemeAttribute:(CPString)aName inState:(CPThemeState)aState
213 {
214  [_themeView setValue:aValue forThemeAttribute:aName inState:aState];
215 }
216 
217 
219 - (void)setWindowStyle:(int)style
220 {
221  CPLog.warn("DEPRECATED: setWindowStyle: is deprecated. use setTheme: instead");
222 
223  [self setTheme:(style === CPHUDBackgroundWindowMask) ? [CPTheme defaultHudTheme] : [CPTheme defaultTheme]];
224 }
225 
227 - (int)windowStyle
228 {
229  CPLog.warn("DEPRECATED: windowStyle: is deprecated. use theme instead");
230  return _defaultWindowStyle;
231 }
232 
233 
239 - (void)setMessageText:(CPString)text
240 {
241  [_messageLabel setStringValue:text];
242  _needsLayout = YES;
243 }
244 
250 - (CPString)messageText
251 {
252  return [_messageLabel stringValue];
253 }
254 
260 - (void)setInformativeText:(CPString)text
261 {
262  [_informativeLabel setStringValue:text];
263  _needsLayout = YES;
264 }
265 
271 - (CPString)informativeText
272 {
273  return [_informativeLabel stringValue];
274 }
275 
282 - (void)setTitle:(CPString)aTitle
283 {
284  _title = aTitle;
285  [_window setTitle:aTitle];
286 }
287 
293 - (void)setAccessoryView:(CPView)aView
294 {
295  _accessoryView = aView;
296  _needsLayout = YES;
297 }
298 
304 - (void)setShowsSuppressionButton:(BOOL)shouldShowSuppressionButton
305 {
306  _showSuppressionButton = shouldShowSuppressionButton;
307  _needsLayout = YES;
308 }
309 
310 #pragma mark Accessing Buttons
311 
324 - (void)addButtonWithTitle:(CPString)aTitle
325 {
326  var bounds = [[_window contentView] bounds],
327  count = [_buttons count],
328 
329  button = [[CPButton alloc] initWithFrame:CGRectMakeZero()];
330 
331  [button setTitle:aTitle];
332  [button setTag:count];
333  [button setTarget:self];
334  [button setAction:@selector(_takeReturnCodeFrom:)];
335 
336  [[_window contentView] addSubview:button];
337 
338  if (count == 0)
339  [button setKeyEquivalent:CPCarriageReturnCharacter];
340  else if ([aTitle lowercaseString] === @"cancel")
341  [button setKeyEquivalent:CPEscapeFunctionKey];
342 
343  [_buttons insertObject:button atIndex:0];
344 }
345 
346 #pragma mark Layout
347 
351 - (void)_layoutMessageView
352 {
353  var inset = [_themeView currentValueForThemeAttribute:@"content-inset"],
354  sizeWithFontCorrection = 6.0,
355  messageLabelWidth,
356  messageLabelTextSize;
357 
358  [_messageLabel setTextColor:[_themeView currentValueForThemeAttribute:@"message-text-color"]];
359  [_messageLabel setFont:[_themeView currentValueForThemeAttribute:@"message-text-font"]];
360  [_messageLabel setTextShadowColor:[_themeView currentValueForThemeAttribute:@"message-text-shadow-color"]];
361  [_messageLabel setTextShadowOffset:[_themeView currentValueForThemeAttribute:@"message-text-shadow-offset"]];
362  [_messageLabel setAlignment:[_themeView currentValueForThemeAttribute:@"message-text-alignment"]];
363  [_messageLabel setLineBreakMode:CPLineBreakByWordWrapping];
364 
365  messageLabelWidth = CGRectGetWidth([[_window contentView] frame]) - inset.left - inset.right;
366  messageLabelTextSize = [[_messageLabel stringValue] sizeWithFont:[_messageLabel font] inWidth:messageLabelWidth];
367 
368  [_messageLabel setFrame:CGRectMake(inset.left, inset.top, messageLabelTextSize.width, messageLabelTextSize.height + sizeWithFontCorrection)];
369 }
370 
374 - (void)_layoutInformativeView
375 {
376  var inset = [_themeView currentValueForThemeAttribute:@"content-inset"],
377  defaultElementsMargin = [_themeView currentValueForThemeAttribute:@"default-elements-margin"],
378  sizeWithFontCorrection = 6.0,
379  informativeLabelWidth,
380  informativeLabelOriginY,
381  informativeLabelTextSize;
382 
383  [_informativeLabel setTextColor:[_themeView currentValueForThemeAttribute:@"informative-text-color"]];
384  [_informativeLabel setFont:[_themeView currentValueForThemeAttribute:@"informative-text-font"]];
385  [_informativeLabel setTextShadowColor:[_themeView currentValueForThemeAttribute:@"informative-text-shadow-color"]];
386  [_informativeLabel setTextShadowOffset:[_themeView currentValueForThemeAttribute:@"informative-text-shadow-offset"]];
387  [_informativeLabel setAlignment:[_themeView currentValueForThemeAttribute:@"informative-text-alignment"]];
388  [_informativeLabel setLineBreakMode:CPLineBreakByWordWrapping];
389 
390  informativeLabelWidth = CGRectGetWidth([[_window contentView] frame]) - inset.left - inset.right;
391  informativeLabelOriginY = [_messageLabel frameOrigin].y + [_messageLabel frameSize].height + defaultElementsMargin;
392  informativeLabelTextSize = [[_informativeLabel stringValue] sizeWithFont:[_informativeLabel font] inWidth:informativeLabelWidth];
393 
394  [_informativeLabel setFrame:CGRectMake(inset.left, informativeLabelOriginY, informativeLabelTextSize.width, informativeLabelTextSize.height + sizeWithFontCorrection)];
395 }
396 
400 - (void)_layoutAccessoryView
401 {
402  if (!_accessoryView)
403  return;
404 
405  var inset = [_themeView currentValueForThemeAttribute:@"content-inset"],
406  defaultElementsMargin = [_themeView currentValueForThemeAttribute:@"default-elements-margin"],
407  accessoryViewWidth = CGRectGetWidth([[_window contentView] frame]) - inset.left - inset.right,
408  accessoryViewOriginY = CGRectGetMaxY([_informativeLabel frame]) + defaultElementsMargin;
409 
410  [_accessoryView setFrameOrigin:CGPointMake(inset.left, accessoryViewOriginY)];
411  [[_window contentView] addSubview:_accessoryView];
412 }
413 
417 - (void)_layoutSuppressionButton
418 {
419  if (!_showSuppressionButton)
420  return;
421 
422  var inset = [_themeView currentValueForThemeAttribute:@"content-inset"],
423  suppressionViewXOffset = [_themeView currentValueForThemeAttribute:@"suppression-button-x-offset"],
424  suppressionViewYOffset = [_themeView currentValueForThemeAttribute:@"suppression-button-y-offset"],
425  defaultElementsMargin = [_themeView currentValueForThemeAttribute:@"default-elements-margin"],
426  suppressionButtonViewOriginY = CGRectGetMaxY([(_accessoryView || _informativeLabel) frame]) + defaultElementsMargin + suppressionViewYOffset;
427 
428  [_suppressionButton setTextColor:[_themeView currentValueForThemeAttribute:@"suppression-button-text-color"]];
429  [_suppressionButton setFont:[_themeView currentValueForThemeAttribute:@"suppression-button-text-font"]];
430  [_suppressionButton setTextShadowColor:[_themeView currentValueForThemeAttribute:@"suppression-button-text-shadow-color"]];
431  [_suppressionButton setTextShadowOffset:[_themeView currentValueForThemeAttribute:@"suppression-button-text-shadow-offset"]];
432  [_suppressionButton sizeToFit];
433 
434  [_suppressionButton setFrameOrigin:CGPointMake(inset.left + suppressionViewXOffset, suppressionButtonViewOriginY)];
435  [[_window contentView] addSubview:_suppressionButton];
436 }
437 
441 - (CGSize)_layoutButtonsFromView:(CPView)lastView
442 {
443  var inset = [_themeView currentValueForThemeAttribute:@"content-inset"],
444  minimumSize = [_themeView currentValueForThemeAttribute:@"size"],
445  buttonOffset = [_themeView currentValueForThemeAttribute:@"button-offset"],
446  helpLeftOffset = [_themeView currentValueForThemeAttribute:@"help-image-left-offset"],
447  aRepresentativeButton = [_buttons objectAtIndex:0],
448  defaultElementsMargin = [_themeView currentValueForThemeAttribute:@"default-elements-margin"],
449  panelSize = [[_window contentView] frame].size,
450  buttonsOriginY,
451  buttonMarginY,
452  buttonMarginX,
453  theme = [self theme],
454  offsetX;
455 
456  [aRepresentativeButton setTheme:[self theme]];
457  [aRepresentativeButton sizeToFit];
458 
459  panelSize.height = CGRectGetMaxY([lastView frame]) + defaultElementsMargin + [aRepresentativeButton frameSize].height;
460  if (panelSize.height < minimumSize.height)
461  panelSize.height = minimumSize.height;
462 
463  buttonsOriginY = panelSize.height - [aRepresentativeButton frameSize].height + buttonOffset;
464  offsetX = panelSize.width - inset.right;
465 
466  switch ([_window styleMask])
467  {
468  case _CPModalWindowMask:
469  buttonMarginY = [_themeView currentValueForThemeAttribute:@"modal-window-button-margin-y"];
470  buttonMarginX = [_themeView currentValueForThemeAttribute:@"modal-window-button-margin-x"];
471  break;
472 
473  default:
474  buttonMarginY = [_themeView currentValueForThemeAttribute:@"standard-window-button-margin-y"];
475  buttonMarginX = [_themeView currentValueForThemeAttribute:@"standard-window-button-margin-x"];
476  break;
477  }
478 
479  for (var i = [_buttons count] - 1; i >= 0 ; i--)
480  {
481  var button = _buttons[i];
482  [button setTheme:[self theme]];
483  [button sizeToFit];
484 
485  var buttonFrame = [button frame],
486  width = MAX(80.0, CGRectGetWidth(buttonFrame)),
487  height = CGRectGetHeight(buttonFrame);
488 
489  offsetX -= width;
490  [button setFrame:CGRectMake(offsetX + buttonMarginX, buttonsOriginY + buttonMarginY, width, height)];
491  offsetX -= 10;
492  }
493 
494  if (_showHelp)
495  {
496  var helpImage = [_themeView currentValueForThemeAttribute:@"help-image"],
497  helpImagePressed = [_themeView currentValueForThemeAttribute:@"help-image-pressed"],
498  helpImageSize = helpImage ? [helpImage size] : CGSizeMakeZero(),
499  helpFrame = CGRectMake(helpLeftOffset, buttonsOriginY, helpImageSize.width, helpImageSize.height);
500 
501  [_alertHelpButton setImage:helpImage];
502  [_alertHelpButton setAlternateImage:helpImagePressed];
503  [_alertHelpButton setBordered:NO];
504  [_alertHelpButton setFrame:helpFrame];
505  }
506 
507  panelSize.height += [aRepresentativeButton frameSize].height + inset.bottom + buttonOffset;
508  return panelSize;
509 }
510 
514 - (void)layout
515 {
516  if (!_needsLayout)
517  return;
518 
519  if (!_window)
520  [self _createWindowWithStyle:nil];
521 
522  var iconOffset = [_themeView currentValueForThemeAttribute:@"image-offset"],
523  theImage = _icon,
524  finalSize;
525 
526  if (!theImage)
527  switch (_alertStyle)
528  {
529  case CPWarningAlertStyle:
530  theImage = [_themeView currentValueForThemeAttribute:@"warning-image"];
531  break;
532  case CPInformationalAlertStyle:
533  theImage = [_themeView currentValueForThemeAttribute:@"information-image"];
534  break;
535  case CPCriticalAlertStyle:
536  theImage = [_themeView currentValueForThemeAttribute:@"error-image"];
537  break;
538  }
539 
540  [_alertImageView setImage:theImage];
541 
542  var imageSize = theImage ? [theImage size] : CGSizeMakeZero();
543  [_alertImageView setFrame:CGRectMake(iconOffset.x, iconOffset.y, imageSize.width, imageSize.height)];
544 
545  [self _layoutMessageView];
546  [self _layoutInformativeView];
547  [self _layoutAccessoryView];
548  [self _layoutSuppressionButton];
549 
550  var lastView = _informativeLabel;
551  if (_showSuppressionButton)
552  lastView = _suppressionButton;
553  else if (_accessoryView)
554  lastView = _accessoryView;
555 
556  finalSize = [self _layoutButtonsFromView:lastView];
557  if ([_window styleMask] & CPDocModalWindowMask)
558  finalSize.height -= 26; // adjust the absence of title bar
559 
560  [_window setFrameSize:finalSize];
561  [_window center];
562 
563  if ([_window styleMask] & _CPModalWindowMask || [_window styleMask] & CPHUDBackgroundWindowMask)
564  {
565  [_window setMovable:YES];
566  [_window setMovableByWindowBackground:YES];
567  }
568 
569  _needsLayout = NO;
570 }
571 
572 #pragma mark Displaying Alerts
573 
579 - (void)runModal
580 {
581  if (!([_window styleMask] & _defaultWindowStyle))
582  {
583  _needsLayout = YES;
584  [self _createWindowWithStyle:_defaultWindowStyle];
585  }
586 
587  [self layout];
588  [CPApp runModalForWindow:_window];
589 }
590 
595 - (void)runModalWithDidEndBlock:(Function /*(CPAlert alert, int returnCode)*/)block
596 {
597  _didEndBlock = block;
598 
599  [self runModal];
600 }
601 
610 - (void)beginSheetModalForWindow:(CPWindow)aWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)alertDidEndSelector contextInfo:(id)contextInfo
611 {
612  if (!([_window styleMask] & CPDocModalWindowMask))
613  {
614  _needsLayout = YES;
615  [self _createWindowWithStyle:CPDocModalWindowMask];
616  }
617 
618  [self layout];
619 
620  _modalDelegate = modalDelegate;
621  _didEndSelector = alertDidEndSelector;
622 
623  [CPApp beginSheet:_window modalForWindow:aWindow modalDelegate:self didEndSelector:@selector(_alertDidEnd:returnCode:contextInfo:) contextInfo:contextInfo];
624 }
625 
631 - (void)beginSheetModalForWindow:(CPWindow)aWindow
632 {
633  [self beginSheetModalForWindow:aWindow modalDelegate:nil didEndSelector:nil contextInfo:nil];
634 }
635 
643 - (void)beginSheetModalForWindow:(CPWindow)aWindow didEndBlock:(Function /*(CPAlert alert, int returnCode)*/)block
644 {
645  _didEndBlock = block;
646 
647  [self beginSheetModalForWindow:aWindow modalDelegate:nil didEndSelector:nil contextInfo:nil];
648 }
649 
650 #pragma mark Private
651 
655 - (void)_createWindowWithStyle:(int)forceStyle
656 {
657  var frame = CGRectMakeZero();
658  frame.size = [_themeView currentValueForThemeAttribute:@"size"];
659 
660  _window = [[CPPanel alloc] initWithContentRect:frame styleMask:forceStyle || _defaultWindowStyle];
661  [_window setLevel:CPStatusWindowLevel];
662  [_window setPlatformWindow:[[CPApp keyWindow] platformWindow]];
663 
664  if (_title)
665  [_window setTitle:_title];
666 
667  var contentView = [_window contentView],
668  count = [_buttons count];
669 
670  if (count)
671  while (count--)
672  [contentView addSubview:_buttons[count]];
673  else
674  [self addButtonWithTitle:@"OK"];
675 
676  [contentView addSubview:_messageLabel];
677  [contentView addSubview:_alertImageView];
678  [contentView addSubview:_informativeLabel];
679 
680  if (_showHelp)
681  [contentView addSubview:_alertHelpButton];
682 }
683 
687 - (@action)_showHelp:(id)aSender
688 {
689  if ([_delegate respondsToSelector:@selector(alertShowHelp:)])
690  [_delegate alertShowHelp:self];
691 }
692 
693 /*
694  @ignore
695 */
696 - (@action)_takeReturnCodeFrom:(id)aSender
697 {
698  if ([_window isSheet])
699  {
700  [_window orderOut:nil];
701  [CPApp endSheet:_window returnCode:[aSender tag]];
702  }
703  else
704  {
705  [CPApp abortModal];
706  [_window close];
707 
708  [self _alertDidEnd:_window returnCode:[aSender tag] contextInfo:nil];
709  }
710 }
711 
715 - (void)_alertDidEnd:(CPWindow)aWindow returnCode:(int)returnCode contextInfo:(id)contextInfo
716 {
717  if (_didEndBlock)
718  {
719  if (typeof(_didEndBlock) === "function")
720  _didEndBlock(self, returnCode);
721  else
722  CPLog.warn("%s: didEnd block is not a function", [self description]);
723 
724  // didEnd blocks are transient
725  _didEndBlock = nil;
726  }
727  else if (_modalDelegate)
728  {
729  if (_didEndSelector)
730  objj_msgSend(_modalDelegate, _didEndSelector, self, returnCode, contextInfo);
731  }
732  else if (_delegate)
733  {
734  if (_didEndSelector)
735  objj_msgSend(_delegate, _didEndSelector, self, returnCode);
736  else if ([_delegate respondsToSelector:@selector(alertDidEnd:returnCode:)])
737  [_delegate alertDidEnd:self returnCode:returnCode];
738  }
739 }
740 
741 @end
742 @implementation _CPAlertThemeView : CPView
743 {
744  id __doxygen__;
745 }
746 
747 + (CPString)defaultThemeClass
748 {
749  return @"alert";
750 }
751 
752 + (CPDictionary)themeAttributes
753 {
754  return @{
755  @"size": CGSizeMake(400.0, 110.0),
756  @"content-inset": CGInsetMake(15, 15, 15, 50),
757  @"informative-offset": 6,
758  @"button-offset": 10,
759  @"message-text-alignment": CPJustifiedTextAlignment,
760  @"message-text-color": [CPColor blackColor],
761  @"message-text-font": [CPFont boldSystemFontOfSize:13.0],
762  @"message-text-shadow-color": [CPNull null],
763  @"message-text-shadow-offset": CGSizeMakeZero(),
764  @"informative-text-alignment": CPJustifiedTextAlignment,
765  @"informative-text-color": [CPColor blackColor],
766  @"informative-text-font": [CPFont systemFontOfSize:12.0],
767  @"informative-text-shadow-color": [CPNull null],
768  @"informative-text-shadow-offset": CGSizeMakeZero(),
769  @"image-offset": CGPointMake(15, 12),
770  @"information-image": [CPNull null],
771  @"warning-image": [CPNull null],
772  @"error-image": [CPNull null],
773  @"help-image": [CPNull null],
774  @"help-image-left-offset": 15,
775  @"help-image-pressed": [CPNull null],
776  @"suppression-button-y-offset": 0.0,
777  @"suppression-button-x-offset": 0.0,
778  @"default-elements-margin": 3.0,
779  @"suppression-button-text-color": [CPColor blackColor],
780  @"suppression-button-text-font": [CPFont systemFontOfSize:12.0],
781  @"suppression-button-text-shadow-color": [CPNull null],
782  @"suppression-button-text-shadow-offset": 0.0,
783  @"modal-window-button-margin-y": 0.0,
784  @"modal-window-button-margin-x": 0.0,
785  @"standard-window-button-margin-y": 0.0,
786  @"standard-window-button-margin-x": 0.0,
787  };
788 }
789 
790 @end
791 
792 @implementation CPAlert (CPSynthesizedAccessors)
793 
797 - (BOOL)showsHelp
798 {
799  return _showHelp;
800 }
801 
805 - (void)setShowsHelp:(BOOL)aValue
806 {
807  _showHelp = aValue;
808 }
809 
813 - (BOOL)showsSuppressionButton
814 {
815  return _showSuppressionButton;
816 }
817 
821 - (void)setShowsSuppressionButton:(BOOL)aValue
822 {
823  _showSuppressionButton = aValue;
824 }
825 
829 - (CPAlertStyle)alertStyle
830 {
831  return _alertStyle;
832 }
833 
837 - (void)setAlertStyle:(CPAlertStyle)aValue
838 {
839  _alertStyle = aValue;
840 }
841 
845 - (CPString)title
846 {
847  return _title;
848 }
849 
853 - (void)setTitle:(CPString)aValue
854 {
855  _title = aValue;
856 }
857 
861 - (CPView)accessoryView
862 {
863  return _accessoryView;
864 }
865 
869 - (void)setAccessoryView:(CPView)aValue
870 {
871  _accessoryView = aValue;
872 }
873 
877 - (CPImage)icon
878 {
879  return _icon;
880 }
881 
885 - (void)setIcon:(CPImage)aValue
886 {
887  _icon = aValue;
888 }
889 
893 - (CPArray)buttons
894 {
895  return _buttons;
896 }
897 
901 - (CPCheckBox)suppressionButton
902 {
903  return _suppressionButton;
904 }
905 
909 - (id)delegate
910 {
911  return _delegate;
912 }
913 
917 - (void)setDelegate:(id)aValue
918 {
919  _delegate = aValue;
920 }
921 
925 - (SEL)didEndSelector
926 {
927  return _didEndSelector;
928 }
929 
933 - (void)setDidEndSelector:(SEL)aValue
934 {
935  _didEndSelector = aValue;
936 }
937 
941 - (_CPAlertThemeView)themeView
942 {
943  return _themeView;
944 }
945 
949 - (CPWindow)window
950 {
951  return _window;
952 }
953 
954 @end