3
3
@class SSYWrappingCheckbox ;
4
4
5
5
enum {
6
- SSYAlertIconNoIcon, /* !< Alert will have no icon */
6
+ SSYAlertIconNoIcon, /* !< Alert will have no icon */
7
7
SSYAlertIconInformational, /* !< Alert will be app icon with no badge */
8
8
SSYAlertIconWarning, /* !< Alert will be app icon with yellow warning badge */
9
- SSYAlertIconCritical, /* !< Alert will be app icon with red critical badge */
9
+ SSYAlertIconCritical, /* !< Alert will be app icon with red critical badge */
10
10
} ;
11
11
12
12
enum SSYAlertMode_enum {
@@ -17,8 +17,30 @@ enum SSYAlertMode_enum {
17
17
typedef enum SSYAlertMode_enum SSYAlertMode ;
18
18
19
19
/* !
20
- @brief This is an addition to Apple's anonymous enumeration containing
21
- NSAlertFirstButtonReturn, NSAlertThirdButtonReturn, NSAlertSecondButtonReturn and NSAlertErrorReturn.
20
+ @details
21
+
22
+ Classic layout is commonly used when button1 = OK, button2 = cancel
23
+ and button3 = alternate. It looks like this:
24
+
25
+ | [2] [3] [1] |
26
+
27
+ Right to left layout is what it says
28
+
29
+ | [3] [2] [1] |
30
+
31
+ which reflects Apple's current descriptions of NSAlertFirstButtonReturn,
32
+ NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
33
+ */
34
+ enum SSYAlertButtonLayout_enum {
35
+ SSYAlertButtonLayoutClassic,
36
+ SSYAlertButtonLayoutRightToLeft,
37
+ };
38
+ typedef enum SSYAlertMode_enum SSYAlertButtonLayout ;
39
+
40
+ /* !
41
+ @brief These are an addition to Apple's anonymous enumeration containing
42
+ NSAlertFirstButtonReturn, NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
43
+ and NSAlertErrorReturn.
22
44
23
45
@details These values are reflected in the 'Sheep Systems Suite'
24
46
AppleScript terminology. Any changes you make here should be reflected
@@ -35,6 +57,7 @@ enum SSYAlertRecovery_enum {
35
57
SSYAlertRecoveryInternalError = 106
36
58
} ;
37
59
typedef enum SSYAlertRecovery_enum SSYAlertRecovery ;
60
+
38
61
enum SSYAlertRecoveryApplescriptCode_enum {
39
62
SSYAlertRecoveryAppleScriptCodeThereWasNoError = ' Nerr' ,
40
63
SSYAlertRecoveryAppleScriptCodeSucceeded = ' ReSx' ,
@@ -44,7 +67,7 @@ enum SSYAlertRecoveryApplescriptCode_enum {
44
67
SSYAlertRecoveryAppleScriptCodeErrorIsHidden = ' ErHd' ,
45
68
SSYAlertRecoveryAppleScriptCodeUserCancelledPreviously = ' UsCn'
46
69
} ;
47
- typedef enum SSYAlertRecoveryAppleScriptCode_enum SSYAlertRecoveryAppleScriptCode ;
70
+ typedef enum SSYAlertRecoveryApplescriptCode_enum SSYAlertRecoveryAppleScriptCode ;
48
71
49
72
/* !
50
73
@brief Key used in the contextInfo sent to attemptRecoveryFromError:::::
@@ -114,8 +137,9 @@ extern NSString* const SSYAlertDidProcessErrorNotification ;
114
137
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
115
138
in the 'recoveryOption' parameter.
116
139
@param error
117
- @param recoveryOption Should be either NSAlertFirstButtonReturn, NSAlertThirdButtonReturn,
118
- or NSAlertAlternate return. Note that this is different from Apple's method
140
+ @param recoveryOption Should be one of NSAlertFirstButtonReturn,
141
+ NSAlertSecondButtonReturn, or NSAlertAlternate return. Note that this is
142
+ different from Apple's method
119
143
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
120
144
in which the analagous optionIndex parameter can be any nonnegative integer.
121
145
@param delegate
@@ -135,8 +159,9 @@ extern NSString* const SSYAlertDidProcessErrorNotification ;
135
159
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
136
160
in the 'recoveryOption' parameter.
137
161
@param error
138
- @param recoveryOption Should be either NSAlertFirstButtonReturn, NSAlertThirdButtonReturn,
139
- or NSAlertAlternate return. Note that this is different from Apple's method
162
+ @param recoveryOption Should be one of NSAlertFirstButtonReturn,
163
+ NSAlertSecondButtonReturn, or NSAlertThirdButton return. Note that this is
164
+ different from Apple's method
140
165
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
141
166
in which the analagous optionIndex parameter can be any nonnegative integer.
142
167
@result
@@ -433,9 +458,9 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
433
458
to specify which didEndSelector runs.
434
459
@result Same as Apple's alert returns:
435
460
<ul>
436
- <li>If button 1 (left ) was clicked, NSAlertFirstButtonReturn.</li>
437
- <li>If button 2 (right ) was clicked, NSAlertThirdButtonReturn .</li>
438
- <li>If button 3 (middle ) was clicked, NSAlertSecondButtonReturn .</li>
461
+ <li>If button 1 (right ) was clicked, NSAlertFirstButtonReturn.</li>
462
+ <li>If button 2 (middle ) was clicked, NSAlertSecondButtonReturn .</li>
463
+ <li>If button 3 (left ) was clicked, NSAlertThirdButtonReturn .</li>
439
464
</ul>
440
465
*/
441
466
@property (assign ) NSInteger alertReturn ;
@@ -576,6 +601,12 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
576
601
*/
577
602
@property (assign ) BOOL shouldStickAround ;
578
603
604
+ /* !
605
+ @brief Specfies how to lay out the buttons during -doooLayout
606
+ @details Default value is SSYAlertButtonLayoutClassic.
607
+ */
608
+ @property SSYAlertButtonLayout buttonLayout ;
609
+
579
610
580
611
#pragma mark * Class Methods returning Constants
581
612
@@ -698,10 +729,11 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
698
729
the error -isOnlyInformational.
699
730
700
731
@param error The error to be presented, or nil.
701
- @result If recovery was not attempted, will be NSAlertFirstButtonReturn, NSAlertThirdButtonReturn,
702
- or NSAlertSecondButtonReturn depending on whether user clicked the first, second, or third button.
703
- If recovery was attempted, result will be SSYAlertRecoverySucceeded, SSYAlertRecoveryFailed,
704
- or SSYAlertRecoveryAttemptedAsynchronously.
732
+ @result If recovery was not attempted, will be NSAlertFirstButtonReturn,
733
+ NSAlertSecondButtonReturn, or NSAlertThirdButtonReturn depending on whether
734
+ user clicked the first, second, or third button from the right.
735
+ If recovery was attempted, result will be SSYAlertRecoverySucceeded,
736
+ SSYAlertRecoveryFailed, or SSYAlertRecoveryAttemptedAsynchronously.
705
737
*/
706
738
- (SSYAlertRecovery)alertError : (NSError *)error ;
707
739
@@ -761,7 +793,8 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
761
793
buttons 1-3, terminated by a nil sentinel.
762
794
If no button titles are passed, dialog will have 1 button titled
763
795
as localized "OK".
764
- @result Indicates button clicked by user: NSAlertFirstButtonReturn, NSAlertThirdButtonReturn or NSAlertSecondButtonReturn
796
+ @result Indicates button clicked by user: NSAlertFirstButtonReturn,
797
+ NSAlertSecondButtonReturn or NSAlertThirdButtonReturn
765
798
*/
766
799
+ (NSInteger )runModalDialogTitle : (NSString *)title
767
800
message : (NSString *)msg
@@ -777,7 +810,8 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
777
810
@param buttonsArray: An array of 0-3 strings which will become
778
811
the titles of buttons 1-3. If this parameter is nil or an
779
812
empty array, dialog will have 1 button titled as localized "OK".
780
- @result Indicates button clicked by user: NSAlertFirstButtonReturn, NSAlertThirdButtonReturn or NSAlertSecondButtonReturn
813
+ @result Indicates button clicked by user: NSAlertFirstButtonReturn,
814
+ NSAlertSecondButtonReturn or NSAlertThirdButtonReturn
781
815
*/
782
816
+ (NSInteger )runModalDialogTitle : (NSString *)title
783
817
message : (NSString *)msg
@@ -852,9 +886,9 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
852
886
853
887
/* !
854
888
@brief Sets the icon which will appear in the receiver
855
- @param iconStyle Pass one of the constants SSYAlertIconWarning, SSYAlertIconNoIcon,
856
- SSYAlertIconCritical, or SSYAlertIconInformational
857
- */
889
+ @param iconStyle Pass one of the constants SSYAlertIconNoIcon,
890
+ SSYAlertIconInformational, SSYAlertIconWarning or SSYAlertIconCritical
891
+ */
858
892
- (void )setIconStyle : (NSInteger )iconStyle ;
859
893
860
894
/* !
@@ -1031,16 +1065,19 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
1031
1065
1032
1066
@details This method must be invoked after adding, removing, or
1033
1067
changing size of any subview.
1068
+
1069
+ Name of this method has been designed to avoid confusion and/or
1070
+ conflict with Cocoa's -doLayout method.
1034
1071
*/
1035
- - (void )doLayout ;
1072
+ - (void )doooLayout ;
1036
1073
1037
1074
1038
1075
/* !
1039
1076
@brief If the receiver's window is visible, lays out all of the
1040
1077
subviews, makes it the key window and orders it to the front.
1041
1078
Otherwise, orders the window out.
1042
1079
1043
- @details This method, or -doLayout , must be invoked after adding,
1080
+ @details This method, or -doooLayout , must be invoked after adding,
1044
1081
removing, or changing size of any subview.
1045
1082
*/
1046
1083
- (void )display ;
@@ -1082,7 +1119,7 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
1082
1119
@details The only way to end a modal dialog is for the user
1083
1120
to click a button. If the alert does not currently have a button 1,
1084
1121
this method will add a button 1 before displaying. The title
1085
- of the added button will be [NSString localize:@"ok "].
1122
+ of the added button will be [NSString localize:@"OK "].
1086
1123
1087
1124
In most cases, you should configure subviews as desired and then
1088
1125
invoke -display before invoking this method.
@@ -1114,8 +1151,14 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
1114
1151
1115
1152
1116
1153
/* !
1117
- @brief Ends any modal session that might be running and closes the
1118
- receiver's window.
1154
+ @brief Ends any modal session that might be running, sets the
1155
+ receiver's window's frame size to NSZeroRect and closes it.
1156
+
1157
+ @details The reason for setting the frame size to NSZeroRect is
1158
+ because this signals to SSYSheetManager, in case the receiver's
1159
+ window is still in an SSYSheetManagerQueue and has not been displayed
1160
+ yet, to skip it when it is dequeued. In other words,
1161
+ this method also "cancels" any future display by SSYSheetManager.
1119
1162
*/
1120
1163
- (void )goAway ;
1121
1164
0 commit comments