This is MiscTableView.h in view mode; [Download] [Up]
#ifndef __MiscTableView_h
#define __MiscTableView_h
//=============================================================================
//
// Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine.
// Written by Paul S. McCarthy and Eric Sunshine.
// All Rights Reserved.
//
// This notice may not be removed from this source code.
//
// This object is included in the MiscKit by permission from the authors
// and its use is governed by the MiscKit license, found in the file
// "License.rtf" in the MiscKit distribution. Please refer to that file
// for a list of all applicable permissions and restrictions.
//
//=============================================================================
//-----------------------------------------------------------------------------
// MiscTableView.h
//
// General-purpose 2-D display object that works with the
// MiscTableScroll to provide row/column sizing and dragging.
//
// This object is responsible for drawing, mouse and keyboard
// events in the content portion of the display.
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// $Id: MiscTableView.h,v 1.10 97/02/11 19:15:41 sunshine Exp $
// $Log: MiscTableView.h,v $
// Revision 1.10 97/02/11 19:15:41 sunshine
// v123: reflectSelection --> selectionChanged
// Now checks isAutodisplay in -selectionChanged.
// No longer unnecessarily sets up clipping rectangle in -drawSelf::.
//
// Revision 1.9 96/12/30 16:34:49 zarnuk
// v113: Migrated cell editing to table scroll from here.
//
// Revision 1.8 96/12/17 22:27:07 sunshine
// v112: Completely overhauled keyboard cursor display to be consistent with
// OpenStep objects. Now draws dashed non-blinking rectangle instead of old
// blinking rectangle. Added ability to inhibit display of keyboard cursor.
// Many methods with "Focus" in name replaced with "Cursor".
//-----------------------------------------------------------------------------
extern "Objective-C" {
#import <appkit/View.h>
#import <dpsclient/dpsNeXT.h>
}
#import <misckit/MiscTableTypes.h>
@class MiscBorderView, MiscMouseTracker, MiscTableScroll;
@class Cell, Text;
class MiscSparseSet;
class MiscTableBorder;
struct MiscTSPageBreak
{
MiscPixels offset;
MiscPixels size;
MiscCoord_V first; // One's comp if started on earlier page.
MiscCoord_V last; // One's comp if ends on later page.
};
struct MiscTSPageImages
{
NXImage* page_header;
NXImage* page_footer;
NXImage* col_titles;
NXImage* row_titles;
};
struct MiscTablePages
{
MiscTablePrintInfo info;
MiscTSPageBreak* col_breaks;
MiscTSPageBreak* row_breaks;
MiscTSPageImages* images;
id pageHeader;
id pageFooter;
MiscBorderView* colTitles;
MiscBorderView* rowTitles;
NXCoord page_header_height;
NXCoord page_footer_height;
NXCoord col_titles_height;
NXCoord row_titles_width;
};
@interface MiscTableView : View
{
MiscTableScroll* scroll;
MiscTableBorder* col_border;
MiscTableBorder* row_border;
MiscBorderType tracker_border;
MiscMouseTracker* tracker;
MiscSparseSet* oldColSel;
MiscSparseSet* oldRowSel;
MiscTablePages* pages;
unsigned int inhibitCursor;
MiscCoord_V cursorSlot;
}
- (id)initFrame:(NXRect const*)frameRect
scroll:(MiscTableScroll*)i_scroll
colInfo:(MiscTableBorder*)i_col_border
rowInfo:(MiscTableBorder*)i_row_border;
- (void)adjustSize;
- (void)getCellInside:(NXRect*)r at:(MiscCoord_P)row :(MiscCoord_P)col;
- (id)getCellFrame:(NXRect*)rect at:(int)row :(int)col; // Physical coords
- (id)getRow:(int*)row andCol:(int*)col // Physical coords
forPoint:(NXPoint const*)point;
- (id)drawCellAt:(int)row :(int)col;
- (id)drawRow:(int)row; // Physical coord
- (id)drawCol:(int)col; // Physical coord
- (void)scrollCellToVisible:(int)row :(int)col; // Physical coords
- (void)scrollRowToVisible:(int)row; // Physical coord
- (void)scrollColToVisible:(int)col; // Physical coord
- (int)numVisibleSlots:(MiscBorderType)b; // all physical coords.
- (int)firstVisibleSlot:(MiscBorderType)b;
- (int)lastVisibleSlot:(MiscBorderType)b;
- (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n;
- (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n;
- (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n;
- (void)setSelectionMode:(MiscSelectionMode)mode;
- (void)selectionChanged;
- (void)resetSelection;
- (void)reflectCursor;
- (void)trackBy:(MiscBorderType)b;
- (MiscBorderType)trackingBy;
- (void)disableCursor; // Can nest.
- (void)reenableCursor;
- (BOOL)isCursorEnabled;
- (void)drawCursor;
- (void)eraseCursor;
- (BOOL)shouldDrawCursor;
- (id)sendAction:(SEL)cmd to:(id)obj;
- (id)mouseDown:(NXEvent*)event;
- (void)keyboardSelect:(NXEvent const*)p;
- (void)moveCursorBy:(int)delta;
@end
// PRINTING -------------------------------------------------------------------
@interface MiscTableView(Print)
- (id)printPSCode:(id)sender;
- (BOOL)knowsPagesFirst:(int*)first last:(int*)last;
- (BOOL)getRect:(NXRect*)r forPage:(int)page;
- (id)placePrintRect:(NXRect const*)r offset:(NXPoint*)p;
- (id)drawPageBorder:(float)width :(float)height;
- (MiscTablePrintInfo const*)getPrintInfo;
@end
#endif // __MiscTableView_h
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.