home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
sybase
/
starbuck
/
hpp.z
/
wgrid.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-29
|
17KB
|
514 lines
/*
WGrid.hpp
NOTE: This file is a generated file.
Do not modify it by hand!
*/
#ifndef _WGRID_HPP_INCLUDED
#define _WGRID_HPP_INCLUDED
// Declarations added here will be included at the top of the .HPP file
#include "WGridD.hpp"
#ifndef _WTEXTBOX_HPP_INCLUDED
# include "wtextbox.hpp"
#endif
#ifndef _WCOMBOX_HPP_INCLUDED
# include "wcombox.hpp"
#endif
#ifndef _WMASKTB_HPP_INCLUDED
# include "wmasktb.hpp"
#endif
/*************************************************************************
*
* WGrid -- Base Grid class
*
*
* Events:
*
* BeginLabelEdit --
*
* Click --
*
* DoubleClick --
*
* EndLabelEdit --
*
* InsertItem -- Called immediately after an item is added.
*
* Select -- Called immediately after an item is selected.
*
************************************************************************/
struct WGridEventData : public WEventData {
WULong rowNumber;
WULong columnNumber;
WString text;
};
struct WGridUserData {
WLong row;
void * userData;
};
#pragma warning 849 9
class WGrid;
class WCMCLASS WGridComboBox : public WComboBox
{
public:
WGridComboBox( WGrid * grid=NULL ) { _grid = grid; };
~WGridComboBox() {};
public:
virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
virtual WBool Move( const WRect & rectangle, WBool update=TRUE );
virtual WBool Move( const WRect & rectangle, WDeferMoveHandle & dwp );
virtual WBool Move( const WPoint & point, WBool update=TRUE );
virtual WBool Move( const WPoint & point, WDeferMoveHandle & dwp );
private:
WGrid * _grid;
};
class WCMCLASS WGridMaskedTextBox : public WMaskedTextBox
{
public:
WGridMaskedTextBox( WGrid * grid=NULL ) { _grid = grid; };
~WGridMaskedTextBox() {};
public:
virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
private:
WGrid * _grid;
};
class WCMCLASS WGridTextBox : public WTextBox
{
public:
WGridTextBox( WGrid * grid=NULL ) { _grid = grid; };
~WGridTextBox() {};
public:
virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
private:
WGrid * _grid;
};
class WCMCLASS WGrid : public WControl
{
/**************************************************************
* Constructors and destructors
**************************************************************/
public:
WGrid();
~WGrid();
/**************************************************************
* Properties
**************************************************************/
// ColumnCount
WULong GetColumnCount() const;
WBool SetColumnCount( WULong columnCount=0xFFFFFFFFL );
// DataColumns
WString GetDataColumns() const;
WBool SetDataColumns( const WString & columns );
// DataGuardRows
WLong GetDataGuardRows() const;
WBool SetDataGuardRows( WLong guardRows );
// DataKeptRows
WLong GetDataKeptRows() const;
WBool SetDataKeptRows( WLong keptRows );
// DataSource
WDataSource * GetDataSource() const;
WBool SetDataSource( WDataSource * source );
// DefaultColumnWidth
WInt GetDefaultColumnWidth() const;
WBool SetDefaultColumnWidth( WInt defaultColumnWidth,
WBool repaint=TRUE );
// DefaultRowHeight
WInt GetDefaultRowHeight() const;
WBool SetDefaultRowHeight( WInt defaultRowHeight,
WBool repaint=TRUE );
// Editor
WWindow * GetEditor() const;
WBool SetEditor( WWindow * editor, WBool deleteOld=TRUE );
// FullRowSelection
WBool GetFullRowSelection() const;
WBool SetFullRowSelection( WBool fullRowSelection );
// HorizontalHeaderHeight
WBool SetHorizontalHeaderHeight( WShort headerHeight );
WShort GetHorizontalHeaderHeight() const;
// LeftColumnNumber
WULong GetLeftColumnNumber() const;
WBool SetLeftColumnNumber( WULong columnNumber );
// LiveEditMode
WBool GetLiveEditMode() const;
WBool SetLiveEditMode( WBool liveEditMode=TRUE );
// MultipleSelection
WBool SetMultipleSelection( WBool multipleSelection );
WBool GetMultipleSelection() const;
// ReadOnly
WBool GetReadOnly() const;
WBool SetReadOnly( WBool readOnly );
// ResizableColumns
WBool SetResizableColumns( WBool resizableColumns );
WBool GetResizableColumns() const;
// ResizableRows
WBool SetResizableRows( WBool resizableRows );
WBool GetResizableRows() const;
// RowCount
WULong GetRowCount() const;
WBool SetRowCount( WULong rowCount=0xFFFFFFFFL );
// SelectedColumnNumber
WULong GetSelectedColumnNumber() const;
WBool SetSelectedColumnNumber( WULong columnNumber,
WBool repaint=TRUE,
WBool scrollIntoView=TRUE );
// SelectedEndColumnNumber
WULong GetSelectedEndColumnNumber() const;
WBool SetSelectedEndColumnNumber( WULong columnNumber,
WBool repaint=TRUE );
// SelectedEndRowNumber
WULong GetSelectedEndRowNumber() const;
WBool SetSelectedEndRowNumber( WULong rowNumber, WBool repaint=TRUE );
// SelectedRowNumber
WULong GetSelectedRowNumber() const;
WBool SetSelectedRowNumber( WULong rowNumber, WBool repaint=TRUE,
WBool scrollIntoView=TRUE );
// ShowColumnLines
WBool SetShowColumnLines( WBool showColumnLines=TRUE );
WBool GetShowColumnLines() const;
// ShowRowLines
WBool SetShowRowLines( WBool showRowLines=TRUE );
WBool GetShowRowLines() const;
// ShowHorizontalHeader
WBool GetShowHorizontalHeader() const;
WBool SetShowHorizontalHeader( WBool showHorizontalHeader,
WBool repaint=TRUE );
// ShowVerticalHeader
WBool GetShowVerticalHeader() const;
WBool SetShowVerticalHeader( WBool showVerticalHeader,
WBool repaint=TRUE );
// TopRowNumber
WULong GetTopRowNumber() const;
WBool SetTopRowNumber( WULong rowNumber );
// UseTabs
WBool SetUseTabs( WBool useTabs );
WBool GetUseTabs() const;
// VerticalHeaderWidth
WBool SetVerticalHeaderWidth( WShort headerWidth );
WShort GetVerticalHeaderWidth() const;
// VisibleColumnCount
WULong GetVisibleColumnCount() const;
// VisibleRowCount
WULong GetVisibleRowCount() const;
// DataTrackRow
WBool GetDataTrackRow() const;
WBool SetDataTrackRow( WBool trackRow );
/**************************************************************
* Item Properties
**************************************************************/
// ColumnTitle
WBool SetColumnTitle( WULong columnNumber,
const WString & columnTitle,
WBool repaint=FALSE );
WString GetColumnTitle( WULong columnNumber ) const;
// ColumnWidth
WBool SetColumnWidth( WULong columnNumber, WInt columnWidth );
WInt GetColumnWidth( WULong columnNumber ) const;
// ReadOnly
WBool SetReadOnly( WULong rowNumber, WULong columnNumber,
WBool readOnly );
WBool SetReadOnly( WULong columnNumber, WBool readOnly );
WBool GetReadOnly( WULong rowNumber, WULong columnNumber ) const;
WBool GetReadOnly( WULong columnNumber ) const;
// Rectangle
WRect GetRectangle( WULong rowNumber, WULong columnNumber );
// RowTitle
WBool SetRowTitle( WULong rowNumber, const WString & rowTitle,
WBool repaint=FALSE );
WString GetRowTitle( WULong rowNumber ) const;
// RowHeight
WBool SetRowHeight( WULong rowNumber, WInt rowHeight );
WInt GetRowHeight( WULong rowNumber ) const;
// Text
WBool SetText( WULong rowNumber, WULong columnNumber,
const WString & text, WBool createIfDoesntExist=TRUE,
WBool repaint=TRUE );
WString GetText( WULong rowNumber, WULong columnNumber ) const;
// UserData
WBool SetUserData( WULong rowNumber, WULong columnNumber,
void * userData );
void * GetUserData( WULong rowNumber, WULong columnNumber ) const;
/**************************************************************
* Methods
**************************************************************/
// AddRow
WBool AddRow( WULong rowNumber=0xFFFFFFFFL );
// CreateComboBoxEditor
WGridComboBox * CreateComboBoxEditor( WBool set=TRUE );
// CreateMaskedTextBoxEditor
WGridMaskedTextBox * CreateMaskedTextBoxEditor( WBool set=TRUE );
// CreateTextBoxEditor
WGridTextBox * CreateTextBoxEditor( WBool set=TRUE );
// DeleteAllRows
WBool DeleteAllRows();
// DeleteRow
WBool DeleteRow( WULong rowNumber );
// EnsureRowIsVisible
WBool EnsureRowIsVisible( WULong rowNumber );
// Retrieve
WBool Retrieve( const WPoint & point, WULong & rowNumber,
WULong & columnNumber );
/**************************************************************
* Overrides
**************************************************************/
virtual WString GetText() const;
virtual WBool SetText( const WString & text );
virtual WStyle GetDefaultStyle() const;
virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
virtual WRect GetRectangle( WBool absolute=FALSE ) const;
virtual WBool MakeWindow( WWindow * parent, WUInt id,
const WChar *className, const WChar *title,
const WRect & r, WStyle wstyle,
WStyle exStyle, void * data=NULL );
virtual WBool LoadWindow( WWindow * parent, const WResourceID & id,
WModuleHandle module=_ApplicationModule );
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
/**************************************************************
* Event Handlers
**************************************************************/
WBool DataAvailableHandler( WGrid * source, WDataAvailableEventData * ev );
WBool DataCloseHandler( WGrid * source, WDataCloseEventData * event );
WBool DataGuardRowHandler( WGrid * source, WDataGuardRowEventData * ev );
WBool DataOpenHandler( WGrid * source, WDataOpenEventData * event );
WBool DataRequestHandler( WGrid * source, WDataRequestEventData * );
WBool EraseBackgroundEvent( WGrid * source, WPaintEventData * event );
WBool GetCursorEvent( WGrid * source, WGetCursorEventData * event );
WBool KeyDownEvent( WGrid * source, WKeyPressEventData * event );
WBool LeftButtonDownEvent( WGrid * source, WMouseEventData * event );
WBool LeftButtonUpEvent( WGrid * source, WMouseEventData * event );
WBool MouseMoveEvent( WGrid * source, WMouseEventData * event );
WBool PaintEvent( WGrid * source, WPaintEventData * event );
WBool ResizeEvent( WGrid * source, WResizeEventData * event );
WBool ScrollEvent( WGrid * source, WScrollBarEventData * event );
WBool TextBoxCharacterPressEvent( WWindow * source, WCharacterPressEventData * event );
WBool TextBoxKeyDownEvent( WWindow * source, WKeyPressEventData * event );
WBool TextBoxLeftButtonUpEvent( WGrid * source, WMouseEventData * event );
WBool LeftButtonDoubleEvent( WGrid * source, WMouseEventData * event );
/**************************************************************
* Others
**************************************************************/
WBool ChangeVerticalHeaderSize( WULong oldSize, WULong newSize,
WULong columnNumber );
WBool ChangeHorizontalHeaderSize( WULong oldSize, WULong newSize,
WULong rowNumber );
WBool SetSelected( WULong rowNumber, WULong columnNumber,
WBool repaint=TRUE, WBool scrollIntoView=TRUE );
private:
WBool ShowTextBox();
WBool HideTextBox();
WBool HandleRefreshRow( WLong reason, WLong currentRow,
WULong count );
WBool AddDataRow( WULong row, WULong rowNumber=0xFFFFFFFFL );
void RenumberDataRows();
WULong FindDataRow( WULong dbrow, WLong itemCount=0xFFFFFFFFL );
WBool IndirectUserData( WBool indirect );
void * GetRealUserData( WULong rowNumber, WULong columnNumber ) const;
WBool SetRealUserData( WULong rowNumber, WULong columnNumber,
void * userData );
WBool GetNonEmptyRowRange( WULong & startRowNumber,
WULong & endRowNumber ) const;
WULong GetNonEmptyRowCount() const;
WBool ResetColumnGap();
WBool ResetRowGap();
WBool IsSizing( const WPoint & point, WBool * vertical );
WBool DrawSizingLine( WBool vertical, WULong rowNumber,
WULong columnNumber, WPoint * currPoint=NULL,
WBool eraseOnly=FALSE );
WBool SelectiveInvalidate( WULong oldTopRowNum, WULong oldLeftColNum,
WULong oldSelEndRowNum,
WULong oldSelEndColNum );
WBool AllocDTTable();
void UpdateExtents( WInt count );
WBool UpdateHorizontalScrollbars();
WBool UpdateVerticalScrollbars();
protected:
WBool doDataTargetScroll();
/**************************************************************
* Data Members
**************************************************************/
private:
WGridData _data;
WWindow * _editor;
WShort _headerHeight;
WShort _headerWidth;
WULong _selectedRowNum;
WULong _selectedColNum;
WRect _sizingRect;
WULong _sizingNumber;
WPoint _sizingPos;
WULong _rowCount;
WULong _colCount;
WULong _selectedEndRowNum;
WULong _selectedEndColNum;
WULong _rowGap;
WULong _colGap;
WDataTargetTable * _dataTargetTable;
WLong _addRow;
WLong _lastScrollPos;
WLong _scrollUp;
WLong _scrollDown;
// TODO: Put these into flags
WBool _liveEditMode;
WBool _editting;
WBool _showVertHeader;
WBool _showHorzHeader;
WBool _readOnly;
WBool _headerSizing;
WBool _verticalSizing;
WBool _horizontalSizing;
WBool _selecting;
WBool _allowVertSizing;
WBool _allowHorzSizing;
WBool _fullRowSelect;
WBool _rowLines;
WBool _colLines;
WBool _useTabs;
WBool _multiSelect;
WBool _dataFilling;
WBool _wasPainting;
WBool _ignoreItemChanged;
WBool _indirectUserData;
WBool _ignoreDataAvailableMove;
WBool _scrolling;
WLong _dataGuardRowOffset;
};
#pragma warning 849 1
#endif