• Keine Ergebnisse gefunden

Allocating Memory

Im Dokument Oriented Software (Seite 81-89)

These functions let you allocate and free memory. The "chunk" functions are used, principally, by the Text class.

• NX_MALLOCO, NX_REALLOCO, NX_FREEO

• NX_ZONEMALLOCO, NX_ZONEREALLOCO

• NXChunkMallocO, NXChunkReallocO, NXChunkGrowO, NXChunkCopyO, NXChunkZoneMallocO, NXChunkZoneReallocO, NXChunkZoneGrowO, NXChunkZoneCopyO

Classes

ActionCel1

Inherits From:

Declared In:

Class Description

Cell : Object appkitl ActionCell.h

An ActionCell defines an active area inside a Control (an instance of Control or one of its subclasses). As a Control's active area, an ActionCell does three things: it performs display of text or an icon; it provides the Control with a target and an action; and it handles mouse (cursor) tracking by properly highlighting its area and sending action messages to its target based on cursor movement. You can set an ActionCell's Control only by sending the drawSelf:in View: message to the ActionCell, passing the Control as the argument for the in View: keyword of the method.

ActionCell implements the target object and action method as defined by its superclass, Cell. As a user manipulates a Control, ActionCell's trackMouse:inRect:otView: method (inherited from Cell) updates its appearance and sends the action message to the target object with the Control object as the only argument.

A single Control may have more than one ActionCell. An integer tag is used to identify an ActionCell; this is important for Controls that contain more than one ActionCell. Note, however, that no checking is done by the ActionCell object itself to ensure that the tag is unique. See the Matrix class for an example of a subclass of Control that contains multiple ActionCells.

Many of the methods that define the contents and look of an ActionCell, such as setFont:

and setBordered:, are reimplementations of methods inherited from Cell. They're subclassed to ensure that the ActionCell is redisplayed if it's currently in a Control.

Instance Variables

An integer used to identify the ActionCell.

The object that is sent the ActionCell's action.

The message that the ActionCell sends to its target.

- setEnabled:

- setString ValueN oCopy:shouldFree:

- string Value

Instance Methods

action

- (SEL)action

Returns the ActionCell's action method. Keep in mind that the argument of an action method sent by an ActionCell is its associated Control (the object returned by

controIView).

See also: - setAction:, - target, - controlView

controlView - controlView

Returns the Control in which the ActionCell was most recently drawn. In general, your code should use the object returned by this method only to (indirectly) redisplay the ActionCell. For example, the subclasses of ActionCell defined by the Application Kit invoke this method in order to send the Control a message such as updateCelllnside:.

The Control in which an ActionCell is drawn is set automatically by the drawS elf: in View:

method. You can't explicitly set the Control.

See also: - drawS elf: in View:

doubleValue

- (double )double Value

Returns the ActionCell's contents as a double-precision floating point number. If the ActionCell is being edited when this message is received, editing is validated first.

See also: - setDoubleValue: (Cell), - floatValue, - intValue, - stringValue, - validateEditing (Control)

drawSelf:in View:

- drawSelf:(const NXRect *)cellFrame inView:controlView

Displays the ActionCell. Sets the ActionCell's Control to controlView and performs drawing if and only if controlView is a Control object (an instance of Control or a subclass thereof). You must lock focus on the Control before invoking this method (Control's display method automatically performs this).

See also: - drawS elf: in View: (Cell)

floatValue

- (float)floatValue

Returns the ActionCell's contents as a single-precision floating point number. If the ActionCell is being edited when this message is received, editing is validated first.

See also: - setFloatValue: (Cell), - doubleValue, - intValue, - stringValue, - validateEditing (Control)

intValue - (int)intValue

Returns the ActionCell's contents as an integer. If the ActionCell is being edited when this message is received, editing is validated first.

See also: - setlntValue: (Cell), - doubleValue, - floatValue, - stringValue, - validateEditing (Control)

read:

- read:(NXTypedStream *)stream

Reads the ActionCell from the typed stream stream. Returns self.

See also: - write:

setAction:

- setAction:(SEL)aSelector

Sets the ActionCell's action method to aSelector. The argument of an action method sent by an ActionCell is its associated Control (the object returned by controIView).

Returns self.

See also: - action, - setTarget:, - controlView, - sendAction:to: (Control)

setAlignment:

- setAlignment:(int)mode

If the ActionCell is a text Cell (type NX_TEXTCELL), this sets its text alignment to mode, which should be NX_LEFTALIGNED, NX_CENTERED, or NX_RIGHTALIGNED. If it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay. Returns self.

See also: - alignment (Cell)

setBezeled:

- setBezeled:(BOOL)jfag

Adds or removes the ActionCell's bezel, according to the value ofjfag. Adding a bezel will remove the ActionCell's border, if any. If it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay. Returns self.

See also: - isBezeled (Cell), - setBordered:

setBordered:

- setBordered:(BOOL)jlag

Adds or removes the ActionCell's border, according to the value ofjlag. The border is black and has a width of 1.0. Adding a border will remove the ActionCell's bezel, if any.

If it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay. Returns self.

See also: - isBordered (Cell), - setBezeled:

setEnabled:

- setEnabled:(BOOL)jlag

Enables or disables the ActionCell's ability to receive mouse events, according to the value ofjlag. If it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay. Returns self.

See also: - isEnabled (Cell)

setFloatingPointFormat:left:right:

- setFloatingPointFormat:(BOOL )autoRange left:(unsigned int)leftDigits

right:(unsigned int)rightDigits

Sets the ActionCell's floating point format as described in the Cell class specification for the setFloatingPointFormat:left:right: method. If it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay. Returns self.

See also: - setFloatingPointFormat:left:right: (Cell)

setFont:

- setFont:fontObject

If the ActionCell is a text Cell (type NX_TEXTCELL), this sets its Font tofontObject. In addition, if it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay. Returns self.

See also: - font (Cell)

setlcon:

- setlcon:( const char *)iconName

Sets the ActionCell's icon to iconName and sets its Cell type to NX_ICONCELL. If it's currently in a Control view, the ActionCell is redisplayed or marked as needing redisplay.

Returns self.

See also: - setlcon: (Cell)

Im Dokument Oriented Software (Seite 81-89)