home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
wgridd.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-12-11
|
7KB
|
214 lines
/*************************************************************************
*
* WGridData --
*
*
************************************************************************/
#ifndef _WGRIDD_HPP_INLCLUDED
#define _WGRIDD_HPP_INLCLUDED
#include "wgriddr.hpp"
#ifndef _WOBJECT_HPP_INCLUDED
# include "wobject.hpp"
#endif
struct WGridDataRowTitle {
WString title;
WULong rowNumber;
};
extern template WArrayReference<WGridDataRowTitle>;
extern template WArray<WGridDataRowTitle>;
typedef WArray<WGridDataRowTitle> WGridDataRowTitleArray;
struct WGridDataColumnTitle {
WString title;
WULong columnNumber;
};
extern template WArrayReference<WGridDataColumnTitle>;
extern template WArray<WGridDataColumnTitle>;
typedef WArray<WGridDataColumnTitle> WGridDataColumnTitleArray;
struct WGridDataRowHeight {
WInt height;
WULong rowNumber;
};
extern template WArrayReference<WGridDataRowHeight>;
extern template WArray<WGridDataRowHeight>;
typedef WArray<WGridDataRowHeight> WGridDataRowHeightArray;
struct WGridDataColumnWidth {
WInt width;
WULong columnNumber;
};
extern template WArrayReference<WGridDataColumnWidth>;
extern template WArray<WGridDataColumnWidth>;
typedef WArray<WGridDataColumnWidth> WGridDataColumnWidthArray;
struct WGridDataColumnReadOnly {
WBool readOnly;
WULong columnNumber;
};
extern template WArrayReference<WGridDataColumnReadOnly>;
extern template WArray<WGridDataColumnReadOnly>;
typedef WArray<WGridDataColumnReadOnly> WGridDataColumnReadOnlyArray;
class WCMCLASS WGridData : public WObject {
public:
/**************************************************************
* Constructors and destructors
**************************************************************/
WGridData();
~WGridData();
/**************************************************************
* Properties
**************************************************************/
// UseArray
WBool GetUseArray() const;
WBool SetUseArray( WBool useArray );
// DefaultColumnWidth
WInt GetDefaultColumnWidth() const;
WBool SetDefaultColumnWidth( WInt defaultColumnWidth );
// DefaultRowHeight
WInt GetDefaultRowHeight() const;
WBool SetDefaultRowHeight( WInt defaultRowHeight );
// LeftColumnNumber
WULong GetLeftColumnNumber() const;
WBool SetLeftColumnNumber( WULong leftCol );
// MaximumColumnNumber
//
// Note: The Set only works when UseArray == TRUE
WLong GetMaximumColumnNumber() const;
WBool SetMaximumColumnNumber( WLong maxColNum );
// MaximumRowNumber
//
// Note: The Set only works when UseArray == TRUE
WLong GetMaximumRowNumber() const;
WBool SetMaximumRowNumber( WLong maxRowNum );
// MinimumColumnNumber
WLong GetMinimumColumnNumber() const;
// MinimumRowNumber
WLong GetMinimumRowNumber() const;
// TopRowNumber
WULong GetTopRowNumber() const;
WBool SetTopRowNumber( WULong topRow );
/**************************************************************
* Item Properties
**************************************************************/
// ColumnTitle
WString GetColumnTitle( WULong columnNumber ) const;
WBool SetColumnTitle( WULong columnNumber,
const WString & columnTitle );
// ColumnWidth
WInt GetColumnWidth( WULong columnNumber ) const;
WBool SetColumnWidth( WULong columnNumber, WInt columnWidth );
// ReadOnly
WBool GetReadOnly( WULong columnNumber ) const;
WBool SetReadOnly( WULong columnNumber, WBool readOnly );
WBool GetReadOnly( WULong rowNumber, WULong columnNumber ) const;
WBool SetReadOnly( WULong rowNumber, WULong columnNumber,
WBool readOnly );
// Row
WGridDataRow * GetRow( WULong rowNumber );
// RowHeight
WInt GetRowHeight( WULong rowNumber ) const;
WBool SetRowHeight( WULong rowNumber, WInt rowHeight );
// RowTitle
WString GetRowTitle( WULong rowNumber ) const;
WBool SetRowTitle( WULong rowNumber, const WString & rowTitle );
// Text
WString GetText( WULong rowNumber, WULong columnNumber ) const;
WBool SetText( WULong rowNumber, WULong columnNumber,
const WString & string );
// UserData
void * GetUserData( WULong rowNumber, WULong columnNumber ) const;
WBool SetUserData( WULong rowNumber, WULong columnNumber,
void * userData );
// Value
WGridDataValue GetValue( WULong rowNumber,
WULong columnNumber ) const;
WBool SetValue( WULong rowNumber, WULong columnNumber,
const WGridDataValue & value );
/**************************************************************
* Methods
**************************************************************/
// DeleteAllRows
WBool DeleteAllRows();
// AddRow
WBool AddRow( WULong rowNumber );
// DeleteRow
WBool DeleteRow( WULong rowNumber );
/**************************************************************
* Data Members
**************************************************************/
private:
WGridDataRow * _rowHead;
WGridDataValue ** _valueArray;
WLong _maxRow;
WLong _maxCol;
WLong _minRow;
WLong _minCol;
WInt _defaultColWidth;
WInt _defaultRowHeight;
WULong _topRow;
WULong _leftCol;
WGridDataColumnWidthArray _colWidths;
WGridDataRowHeightArray _rowHeights;
WGridDataColumnTitleArray _colTitles;
WGridDataRowTitleArray _rowTitles;
WGridDataColumnReadOnlyArray _colReadOnly;
WBool _useArray;
};
#endif // _WGRIDD_HPP_INCLUDED