This is CardHolder.h in view mode; [Download] [Up]
/* Generated by Interface Builder */
#import "TagView.h"
#import "CardView.h"
#import <objc/List.h>
// This is a base class for objects that hold cards.
@interface CardHolder:TagView
{
// This flag indicates whether this object responds to the
// tracking highlight method.
BOOL trackingEnabledFlag;
// This flag determines whether the cards added to instances of
// this class are to react to events.
BOOL reactiveCardsFlag;
// The title of the view is drawn at an angle from
// the lower left corner to the upper right.
char *myTitle;
// These flag controls whether a frame and highlighted frame
// is drawn around the view. In speed piles, etc the frame
// is drawn. When a stack view is used inside a distance pile,
// for example, it isn't framed.
BOOL frameModeFlag,
highlightModeFlag;
}
+ newFrame:( const NXRect * )frameRect;
- free;
// These methods are intended to be overridden. Their
// execution will cause an assertion.
// These methods are ment to disconnect a card(s) from the
// subclass and send it to another view. This results in a
// -addCard method send to the receipent.
- sendCard:( CardView * )aCard to:anObject;
- sendAllCardsTo:anObject;
// These methods are intended to be overridden. Their
// execution will cause an assertion. Traditionally, these
// should be the methods used to add and remove cards from the
// holder--exceptions not withstanding.
- addCard:( CardView * )aCard :sender;
- removeCard:( CardView * )aCard :sender;
// These methods control the tracking of cards as they
// enter and exit view area. The first
// method enable/disable tracking. The second method determines
// if the object is a tracking rectangle. The last method is used
// to turn on/off the highlighted frame around the rectangle.
// Frame highlighting is indicated by drawing a one pixel wide
// frame around the view.
// An explination of why tracking is done in this fashion.
// Originally I tried to use tracking rects and allow the objects
// to respond accordingly when a card was dragged into their view.
// One problem. The Window Manager will only send the mouseEntered:
// and mouseExited: events to a tracking rect IF they are not
// obscured (one sentence somewhere in the concepts book).
// Since card dragging is implemented by moving a window
// underneath the cursor the tracking rects would not get the
// events from the WM.
- setTrackingEnabled:( BOOL )flag;
- ( BOOL )isTrackingEnabled;
- trackingHighlighted:( BOOL )flag;
// The method determines wheather cards will be allowed to
// respond to events once they are added to the stack. The default
// is NO.
// Cards that are allowed to react typically do so since they are
// allowed to be grabbed and dragged from an instance of this class.
- setCardsEnabled:( BOOL )flag;
// This method is used when cards are disconnected from their
// super views and connected to another views. Card holders
// can be subviews of other card holders. When removing or
// adding cards the actions must start with the base card holder
// view.
// This method searches the view hierarchy searching for the last
// card holder in the path it stops at the last one found (which
// may be itself) and returns that view. Discontinuities are
// ignored.
- baseHolder;
// YES causes a black 2 pixel frame to be drawn around the inside of
// the view. The default is NO.
- setFrameMode:( BOOL )flag;
// Display a title for this view. Titles are displayed in the view
// but is obscured if any cards are on the stack.
- setTitle:( const char * )aTitle;
// This method returns to the calling view wheather it is
// visible within its holder.
// It is intended for this method to be overridden in a subclass.
// The default value returned is YES. Subclasses of this
// object must make their own determination.
// Cards call this method to determine if they should draw
// themselves. In stacks with a large amount of cards, the
// draw pile for example, a change in the holder view causes all
// of the cards to redraw wheather obscured or not. This becomes
// a major cpu hog.
- ( BOOL )subviewVisible:aView;
// These methods are intended to be overridden
// by the subclasses. They are used to obtains
// information about the cards in the stack.
- ( List * )holderList;
- ( int )numCardTypeInHolder:( int )aCardTag;
- ( int )numSafetiesInHolder;
- drawSelf:( NXRect * )rects :( int )rectCount;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.