inherits from Button;
Class SpecialButton is an example of a hackitecture. It provides a framework for light subclasses of class Button, each of which is only slightly different from the others. It also provides a framework for updateable buttons that change over time or that depend on the state of other objects.
Instantiate: rarely Subclass: sometimes Call its methods: rarely
You're unlikely to use class SpecialButton in its factory state. You're more likely to subclass it to define your own special button types.
Class SpecialButton defines the following methods:
Method | Description |
---|---|
AboutToShow | Overridden to call UpdateButton before showing the button |
Action | Overridden to handle special cases |
Idle | Overridden to call UpdateButton before calling inherited |
Orientation | Overridden to return kFlipMask if the button selector is FlipButton |
Swallow | Overridden to allow certain kinds of buttons to swallow certain kinds of | morsels |
Touch | Overridden to do the button's action immediately if the option bit of the | operation field is set |
Target | Overridden to return the value of the button's specialData field |
UpdateButton | Handle the zillions of special cases understood by class SpecialButton |
When you subclass SpecialButton, you are likely to override the following methods:
Method | When to override |
---|---|
Action | To handle any special case or set of special cases |
Swallow | If some of your special buttons should be able to swallow certain kinds of morsels |
UpdateButton | To add your own custom special cases |
Class SpecialButton defines the following fields:
Field | Type | Description |
---|---|---|
Inherited from SingleLinkable | ||
next | Object | Next item in view list |
Inherited from Linkable | ||
previous | Object | Previous item in view list |
Inherited from Viewable | ||
superview | Viewable | Container for this object |
subview | Viewable | Object contained by this object |
relativeOrigin | Dot | Origin relative to superview |
contentSize | Dot | Size of content rectangle |
viewFlags | Unsigned | Property settings |
labelStyle | TextStyle | Text style of object's label |
color | Unsigned | Color of object's content |
altColor | Unsigned | Not used by button |
shadow | Shadow | Shadow drawn with object |
sound | Sound | Sound associated with object |
Inherited from Stamp | ||
image | Image | Image used to draw stamp |
Inherited from HasBorder | ||
border | Border | The button's border |
Defined by class SpecialButton | ||
selector | UnsignedShort | The type of special case this button is |
operationNumber | Unsigned | Number of an operation to be called; used by certain kinds of special buttons |
specialData | Object | Any other object used by a special button; use is defined by the particular button type |
Class SpecialButton comes from the factory understanding nearly fifty kinds of special buttons. They are listed here, in the off chance that you might find them useful someday in some bizarre set of circumstances.
Special case | Value | Description |
---|---|---|
ClearPasswordButton | 1 | |
FolderSortingButton | 2 | |
EnvelopeButton | 3 | |
MailAddressButton | 4 | |
NameCardButton | 5 | |
DiscardButton | 6 | |
EditCardButton | 7 | |
ChangeButton | 8 | |
FlipButton | 9 | |
ScheduledTaskButton | 10 | |
TaskNotesButton | 11 | |
GroupButton | 12 | |
NoGroupButton | 13 | |
GroupAddButton | 14 | |
SelectionButton | 15 | button is visible if Selection(target) is not nilObject |
ExtendButton | 16 | |
ReplaceButton | 17 | |
NewTaskButton | 18 | |
TaskRepeatButton | 19 | |
TaskRemindButton | 20 | |
TaskInviteButton | 21 | |
SendButton | 22 | |
GetInfoButton | 23 | |
CanDeleteVisButton | 24 | |
BookmarkButton | 25 | |
CanDeleteButton | 26 | |
ReplyButton | 27 | |
NoSelectionButton | 28 | button is visible if Selection(target) is nilObject |
ContentListButton | 29 | button is disabled if contentList of HasContentList_ is empty |
NewNameButton | 30 | button is visible if the PeopleList has a target |
SignatureDoneButton | 31 | button is visable if both signatures filled out |
SearchStartedButton | 32 | button is visible if find dog has been started |
ChangeAddressButton | 33 | button is visible if card's address can be changed |
NoAttributeButton | 34 | button is disabled if attribute window's are showing |
CanDeleteSelectionVisibleButton | 35 | button is visible if CanDeleteSelection(target) |
CanDeleteSelectionButton | 36 | button is enabled if CanDeleteSelection(target) |
TOCButton | 37 | contents button in books |
LogButton | 38 | button is disabled if current user or not person or company |
MustHaveCardButton | 39 | button is disabled if DirectID(iCurrentCard) is nilObject |
EnabledSelectionButton | 41 | button is enabled if Selected(target) is not nilObject |
PreviousRecipientButton | 42 | button is disabled if iCurrentCard (a delivery report) does not | have a previous recipient |
NextRecipientButton | 43 | button is disabled if iCurrentCard (ditto) does not have a next | recipient |
DatedWordListButton | 44 | button is enabled if current card is a BookOfListsPage and its | list is a DatedWordList |
DeliveryLogButton | 45 | button is enabled if iCurrentScene's stepBackScene is not | iDeliveryLogScene |
EnabledGoToSelectionButton | 46 | button is enabled if CanGoToSelection(target) is true |
DeleteControlsButton | 47 | button is disabled if there are no controls to delete |
RemoveCurrentTaskButton | 48 | button is disabled if iCurrentTask is not delteable, or not | scheduled |
TurnDSTOnButton | 49 | button is used to turn dst on for a specific group of cities |
TurnDSTOffButton | 50 | button is used to turn dst off for a specific group of cities |
IsAssignedCardButton | 51 | button is visible when IsAssigned(iCurrentCard) is true |
PhoneLineConnectedMailButton | 52 | button is disabled when in the register for mail lesson |
overrides Action Call: rarely Override: often
The system calls Action when the user has tapped a button. See the description of Button_Action for details. Class SpecialButton overrides Action to do special work for certain cases. If the current button matches none of those certain cases, by default Action checks the button's operation number field. If there's an operation number, Action gets the button's target by calling Target. It then calls OperationByNumber on the target, using the given operation number.
Override Action to implement special actions for your own special button cases.
overrides Swallow Call: rarely Override: sometimes
The system calls Swallow when the user attempts to drop an object onto the button. SpecialButton_Action overrides Swallow to handle one special case. If the button is a NewTaskButton, it accepts task morsels.
Override Swallow if some of your special buttons can accept particular morsels.
operation UpdateButton(); Call: rarely Override: often
The system calls UpdateButton from various other methods of class SpecialButton, most notable at idle time. You should not need to call UpdateButton directly. UpdateButton is a very large switch statement that calls various private methods for various special button types. The types handled are listed in the table in the section on Constants used by class SpecialButton. UpdateButton usually checks whether the particular button should be visible or disabled, but it can potentially do a large number of updating tasks.
Override UpdateButton to perform your own special update tasks for your button types.