home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / lckowl15 / dtctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-04  |  19.7 KB  |  491 lines

  1. /***************************************************************************\
  2.                        Copyright (c) 1992 by
  3.    ProtoView Development Co. and Atlantic Information Management, Inc.
  4.                         All Rights Reserved
  5. \***************************************************************************/
  6.  
  7. //============================================================================
  8. //
  9. //        Borland C++ Class Library for the Data Table Custom Control
  10. //
  11. //============================================================================
  12.  
  13. #ifndef __DTCTL_H
  14. #define __DTCTL_H
  15.  
  16. #ifndef __CONTROL_H
  17. #include <control.h>
  18. #endif
  19.  
  20. #ifndef __ARRAY_H
  21. #include <array.h>
  22. #endif
  23.  
  24. #include "datatbl.h"
  25.  
  26. #ifndef EXPORT
  27. #ifdef __DLL__
  28. #    define EXPORT _export
  29. #else
  30. #    define EXPORT huge
  31. #endif
  32. #endif
  33.  
  34. #define DTE_NOWINDOW    DTE_MESSAGENUM
  35.     // This error is only returned by a member function when there is no
  36.     // interface element (HWindow) associated with this object.  If all
  37.     // operations on the interface element are done through the member
  38.     // functions of the object, DTE_MESSAGENUM will never be returned.
  39.     // Therefore, DTE_NOWINDOW can safely share the same number.
  40.  
  41. typedef long    DT_STATUS;
  42. typedef int        EDIT_ACTION;
  43. typedef COLNUM far *    LPCOLNUM;
  44. typedef ROWNUM far *    LPROWNUM;
  45.  
  46. enum SELECT_TYPE {UNSELECT = FALSE, SELECT = TRUE};
  47. enum SELECT_MODE {ROW_SELECTION = FALSE, COLUMN_SELECTION = TRUE};
  48.  
  49. /**************************************************************************\
  50.                                 TDataTbl Class Definition
  51. \**************************************************************************/
  52.  
  53. _CLASSDEF(TDataTbl)
  54. _CLASSDEF(TDataTblData)
  55.  
  56. class _EXPORT TDataTbl : public TControl
  57. {
  58.  
  59. public:
  60.  
  61.     //****************** TDataTbl Constructors *******************************
  62.  
  63.     TDataTbl (PTWindowsObject AParent, int AnId, int X, int Y, int W, int H,
  64.                 PTModule AModule = NULL);
  65.  
  66.     TDataTbl (PTWindowsObject AParent, int ResourceId, PTModule AModule = NULL);
  67.  
  68.     //****************** TDataTbl Public Member Data  ************************
  69.  
  70.     static WORD wVersion;
  71.  
  72.     //****************** TDataTbl Public Member Functions  *******************
  73.  
  74.     //---------------- DeleteCol ----------------
  75.     DT_STATUS DeleteCol (ACCMODE anAccessMode)
  76.         { return (DT_STATUS) SendDataTblMessage (DTM_DELETECOL, anAccessMode); }
  77.  
  78.     //---------------- DeleteRow ----------------
  79.     DT_STATUS DeleteRow (ACCMODE anAccessMode)
  80.         { return (DT_STATUS) SendDataTblMessage (DTM_DELETEROW, anAccessMode); }
  81.  
  82.     //---------------- EditCurrCell ----------------
  83.     DT_STATUS EditCurrCell (EDIT_ACTION anEditAction)
  84.         { return (DT_STATUS) SendDataTblMessage (DTM_EDITCURRCELL, anEditAction); }
  85.  
  86.     //---------------- GetAccessCol ----------------
  87.     COLNUM GetAccessCol () const
  88.         { return (COLNUM) SendDataTblMessage (DTM_GETACCESSCOL); }
  89.  
  90.     //---------------- GetAccessRow ----------------
  91.     ROWNUM GetAccessRow () const
  92.         { return (ROWNUM) SendDataTblMessage (DTM_GETACCESSROW); }
  93.  
  94.     //---------------- GetCharSel ----------------
  95.     DWORD GetCharSel () const
  96.         { return SendDataTblMessage (DTM_GETCHARSEL); }
  97.  
  98.     //---------------- GetColCfg ----------------
  99.     DT_STATUS GetColCfg (COLNUM aColumnNumber, LPVOID theColumnConfig) const
  100.         { return (DT_STATUS) SendDataTblMessage (DTM_GETCOLCFG, aColumnNumber, (LONG) theColumnConfig); }
  101.  
  102.     //---------------- GetColCfgSize ----------------
  103.     int GetColCfgSize (COLNUM aColumnNumber) const
  104.         { return (int) SendDataTblMessage (DTM_GETCOLCFGSIZE, aColumnNumber); }
  105.  
  106.     //---------------- GetColCount ----------------
  107.     int GetColCount () const
  108.         { return (int) SendDataTblMessage (DTM_GETCOLCOUNT); }
  109.  
  110.     //---------------- GetColDatalen ----------------
  111.     COLLEN GetColDatalen (COLNUM aColumnNumber) const
  112.         { return (COLLEN) SendDataTblMessage (DTM_GETCOLDATALEN, aColumnNumber); }
  113.  
  114.     //---------------- GetColExtra1 ----------------
  115.     DWORD GetColExtra1 (COLNUM aColumnNumber) const
  116.         { return (DWORD) SendDataTblMessage (DTM_GETCOLEXTRA1, aColumnNumber); }
  117.  
  118.     //---------------- GetColExtra2 ----------------
  119.     DWORD GetColExtra2 (COLNUM aColumnNumber) const
  120.         { return (DWORD) SendDataTblMessage (DTM_GETCOLEXTRA2, aColumnNumber); }
  121.  
  122.     //---------------- GetColFormat ----------------
  123.     DT_STATUS GetColFormat (COLNUM aColumnNumber, LPVOID theColumnFormat) const
  124.         { return (DT_STATUS) SendDataTblMessage (DTM_GETCOLFORMAT, aColumnNumber, (LONG) theColumnFormat); }
  125.  
  126.     //---------------- GetColHead ----------------
  127.     DT_STATUS GetColHead (COLNUM aColumnNumber, LPSTR theColumnHead) const
  128.         { return (DT_STATUS) SendDataTblMessage (DTM_GETCOLHEAD, aColumnNumber, (LONG) theColumnHead); }
  129.  
  130.     //---------------- GetColName ----------------
  131.     DT_STATUS GetColName (COLNUM aColumnNumber, LPSTR theColumnName) const
  132.         { return (DT_STATUS) SendDataTblMessage (DTM_GETCOLNAME, aColumnNumber, (LONG) theColumnName); }
  133.  
  134.     //---------------- GetColNumber ----------------
  135.     int GetColNumber (LPSTR theColumnName) const
  136.         { return (int) SendDataTblMessage (DTM_GETCOLNAME, NULL, (LONG) theColumnName); }
  137.  
  138.     //---------------- GetColSelCount ----------------
  139.     int GetColSelCount () const
  140.         { return (int) SendDataTblMessage (DTM_GETCOLSELCOUNT); }
  141.  
  142.     //---------------- GetColSelFirst ----------------
  143.     int GetColSelFirst () const
  144.         { return (int) SendDataTblMessage (DTM_GETCOLSELFIRST); }
  145.  
  146.     //---------------- GetColSelList ----------------
  147.     DT_STATUS GetColSelList (LPCOLNUM aColumnSelList) const
  148.         { return (DT_STATUS) SendDataTblMessage (DTM_GETCOLSELLIST, NULL, (LONG) aColumnSelList); }
  149.  
  150.     //---------------- GetColSelNext ----------------
  151.     int GetColSelNext (COLNUM thePreviousSelCol) const
  152.         { return (int) SendDataTblMessage (DTM_GETCOLSELNEXT, thePreviousSelCol); }
  153.  
  154.     //---------------- GetColStatus ----------------
  155.     BOOL GetColStatus (COLNUM aColumnNumber) const
  156.         { return (BOOL) SendDataTblMessage (DTM_GETCOLSELNEXT, aColumnNumber); }
  157.  
  158.     //---------------- GetColStyle ----------------
  159.     COLSTYLE GetColStyle (COLNUM aColumnNumber) const
  160.         { return (COLSTYLE) SendDataTblMessage (DTM_GETCOLSTYLE, aColumnNumber); }
  161.  
  162.     //---------------- GetColType ----------------
  163.     COLTYPE GetColType (COLNUM aColumnNumber) const
  164.         { return (COLTYPE) SendDataTblMessage (DTM_GETCOLTYPE, aColumnNumber); }
  165.  
  166.     //---------------- GetColWidth ----------------
  167.     int GetColWidth (COLNUM aColumnNumber) const
  168.         { return (int) SendDataTblMessage (DTM_GETCOLWIDTH, aColumnNumber); }
  169.  
  170.     //---------------- GetConfig ----------------
  171.     DWORD GetConfig (LPTABLECFGSTRUCT theDataTblConfig) const
  172.         { return SendDataTblMessage (DTM_GETCONFIG, NULL, (LONG) theDataTblConfig); }
  173.  
  174.     //---------------- GetConfigSize ----------------
  175.     int GetConfigSize () const
  176.         { return (int) SendDataTblMessage (DTM_GETCONFIGSIZE); }
  177.  
  178.     //---------------- GetCurCol ----------------
  179.     COLNUM GetCurCol () const
  180.         { return (COLNUM) SendDataTblMessage (DTM_GETCURCOL); }
  181.  
  182.     //---------------- GetCurColSel ----------------
  183.     COLNUM GetCurColSel () const
  184.         { return (COLNUM) SendDataTblMessage (DTM_GETCURCOLSEL); }
  185.  
  186.     //---------------- GetCurRow ----------------
  187.     ROWNUM GetCurRow () const
  188.         { return (ROWNUM) SendDataTblMessage (DTM_GETCURROW); }
  189.  
  190.     //---------------- GetCurRowSel ----------------
  191.     ROWNUM GetCurRowSel () const
  192.         { return (ROWNUM) SendDataTblMessage (DTM_GETCURROWSEL); }
  193.  
  194.     //---------------- GetDTMetrics ----------------
  195.     LONG    GetDTMetrics (int aMetricIndex) const
  196.         { return (LONG) SendDataTblMessage (DTM_GETDTMETRICS, aMetricIndex); }
  197.  
  198.     //---------------- GetEditKey ----------------
  199.     WORD GetEditKey (EDIT_ACTION anEditAction) const
  200.         { return (WORD) SendDataTblMessage (DTM_GETEDITKEY, anEditAction); }
  201.  
  202.     //---------------- GetLeftIndex ----------------
  203.     COLNUM GetLeftIndex () const
  204.         { return (COLNUM) SendDataTblMessage (DTM_GETLEFTINDEX); }
  205.  
  206.     //---------------- GetNotifyCol ----------------
  207.     COLNUM GetNotifyCol () const
  208.         { return (COLNUM) SendDataTblMessage (DTM_GETNOTIFYCOL); }
  209.  
  210.     //---------------- GetNotifyRow ----------------
  211.     ROWNUM GetNotifyRow () const
  212.         { return (ROWNUM) SendDataTblMessage (DTM_GETNOTIFYROW); }
  213.  
  214.     //---------------- GetRowCount ----------------
  215.     ROWNUM GetRowCount () const
  216.         { return (ROWNUM) SendDataTblMessage (DTM_GETROWCOUNT); }
  217.  
  218.     //---------------- GetRowSelCount ----------------
  219.     ROWNUM GetRowSelCount () const
  220.         { return (ROWNUM) SendDataTblMessage (DTM_GETROWSELCOUNT); }
  221.  
  222.     //---------------- GetRowSelFirst ----------------
  223.     ROWNUM GetRowSelFirst () const
  224.         { return (ROWNUM) SendDataTblMessage (DTM_GETROWSELFIRST); }
  225.  
  226.     //---------------- GetRowSelList ----------------
  227.     DT_STATUS GetRowSelList (LPROWNUM aRowSelList) const
  228.         { return (DT_STATUS) SendDataTblMessage (DTM_GETROWSELLIST, NULL, (LONG) aRowSelList); }
  229.  
  230.     //---------------- GetRowSelNext ----------------
  231.     LONG GetRowSelNext (ROWNUM thePreviousSelRow) const
  232.         { return (LONG) SendDataTblMessage (DTM_GETROWSELNEXT, NULL, thePreviousSelRow); }
  233.  
  234.     //---------------- GetRowStatus ----------------
  235.     BOOL GetRowStatus (ROWNUM aRowNumber) const
  236.         { return (BOOL) SendDataTblMessage (DTM_GETROWSTATUS, NULL, aRowNumber); }
  237.  
  238.     //---------------- GetSelMode ----------------
  239.     BOOL GetSelMode () const
  240.         { return (BOOL) SendDataTblMessage (DTM_GETSELMODE); }
  241.  
  242.     //---------------- GetTopIndex ----------------
  243.     ROWNUM GetTopIndex () const
  244.         { return (ROWNUM) SendDataTblMessage (DTM_GETTOPINDEX); }
  245.  
  246.     //---------------- GetVisCols ----------------
  247.     int GetVisCols () const
  248.         { return (int) SendDataTblMessage (DTM_GETVISCOLS); }
  249.  
  250.     //---------------- GetVisRows ----------------
  251.     LONG GetVisRows () const
  252.         { return (LONG) SendDataTblMessage (DTM_GETVISROWS); }
  253.  
  254.     //---------------- GetWndStyle ----------------
  255.     DWORD GetWndStyle () const
  256.         { return SendDataTblMessage (DTM_GETWNDSTYLE); }
  257.  
  258.     //---------------- InsertCol ----------------
  259.     DT_STATUS InsertCol (ACCMODE anAccessMode, LPCOLUMNCFGSTRUCT theColConfig)
  260.         { return (DT_STATUS) SendDataTblMessage (DTM_INSERTCOL, anAccessMode, (LONG) theColConfig); }
  261.  
  262.     //---------------- InsertRow ----------------
  263.     DT_STATUS InsertRow (ACCMODE anAccessMode, LPVOID theRowData)
  264.         { return (DT_STATUS) SendDataTblMessage (DTM_INSERTROW, anAccessMode, (LONG) theRowData); }
  265.  
  266.     //---------------- MoveColTo ----------------
  267.     DT_STATUS MoveColTo (ACCMODE anAccessMode, COLNUM aNewColumnNumber)
  268.         { return (DT_STATUS) SendDataTblMessage (DTM_MOVECOLTO, anAccessMode, aNewColumnNumber); }
  269.  
  270.     //---------------- MoveRowTo ----------------
  271.     DT_STATUS MoveRowTo (ACCMODE anAccessMode, ROWNUM aNewRowNumber)
  272.         { return (DT_STATUS) SendDataTblMessage (DTM_MOVEROWTO, anAccessMode, aNewRowNumber); }
  273.  
  274.     //---------------- ReadCell ----------------
  275.     DT_STATUS ReadCell (ACCMODE anAccessMode, LPDWORD theCellData) const
  276.         { return (DT_STATUS) SendDataTblMessage (DTM_READCELL, anAccessMode, (LONG) theCellData); }
  277.  
  278.     //---------------- ReadCellRect ----------------
  279.     DT_STATUS ReadCellRect (ACCMODE anAccessMode, LPRECT theCellRect) const
  280.         { return (DT_STATUS) SendDataTblMessage (DTM_READCELLRECT, anAccessMode, (LONG) theCellRect); }
  281.  
  282.     //---------------- ReadCol ----------------
  283.     DT_STATUS ReadCol (ACCMODE anAccessMode, LPVOID theColData) const
  284.         { return (DT_STATUS) SendDataTblMessage (DTM_READCOL, anAccessMode, (LONG) theColData); }
  285.  
  286.     //---------------- ReadRow ----------------
  287.     DT_STATUS ReadRow (ACCMODE anAccessMode, LPVOID theRowData) const
  288.         { return (DT_STATUS) SendDataTblMessage (DTM_READROW, anAccessMode, (LONG) theRowData); }
  289.  
  290.     //---------------- ReplicateColTo ----------------
  291.     DT_STATUS ReplicateColTo (ACCMODE anAccessMode, COLNUM aNewColumnNumber)
  292.         { return (DT_STATUS) SendDataTblMessage (DTM_REPLICATECOLTO, anAccessMode, aNewColumnNumber); }
  293.  
  294.     //---------------- ReplicateRowTo ----------------
  295.     DT_STATUS ReplicateRowTo (ACCMODE anAccessMode, ROWNUM aNewRowNumber)
  296.         { return (DT_STATUS) SendDataTblMessage (DTM_REPLICATEROWTO, anAccessMode, aNewRowNumber); }
  297.  
  298.     //---------------- ResetAll ----------------
  299.     DT_STATUS ResetAll ()
  300.         { return (DT_STATUS) SendDataTblMessage (DTM_RESETALL); }
  301.  
  302.     //---------------- ResetData ----------------
  303.     DT_STATUS ResetData ()
  304.         { return (DT_STATUS) SendDataTblMessage (DTM_RESETDATA); }
  305.  
  306.     //---------------- SelAllCols ----------------
  307.     DT_STATUS SelAllCols (SELECT_TYPE aSelectType)
  308.         { return (DT_STATUS) SendDataTblMessage (DTM_SELALLCOLS, NULL, aSelectType); }
  309.  
  310.     //---------------- SelAllRows ----------------
  311.     DT_STATUS SelAllRows (SELECT_TYPE aSelectType)
  312.         { return (DT_STATUS) SendDataTblMessage (DTM_SELALLROWS, aSelectType); }
  313.  
  314.     //---------------- SelCol ----------------
  315.     DT_STATUS SelCol (COLNUM aColumnNumber, SELECT_TYPE aSelectType)
  316.         { return (DT_STATUS) SendDataTblMessage (DTM_SELCOL, aColumnNumber, aSelectType); }
  317.  
  318.     //---------------- SelColRange ----------------
  319.     DT_STATUS SelColRange (COLNUM theLastColumnInRange, SELECT_TYPE aSelectType)
  320.         { return (DT_STATUS) SendDataTblMessage (DTM_SELCOLRANGE, theLastColumnInRange, aSelectType); }
  321.  
  322.     //---------------- SelRow ----------------
  323.     DT_STATUS SelRow (SELECT_TYPE aSelectType, ROWNUM aRowNumber)
  324.         { return (DT_STATUS) SendDataTblMessage (DTM_SELROW, aSelectType, aRowNumber); }
  325.  
  326.     //---------------- SelRowRange ----------------
  327.     DT_STATUS SelRowRange (SELECT_TYPE aSelectType, ROWNUM theLastRowInRange)
  328.         { return (DT_STATUS) SendDataTblMessage (DTM_SELROWRANGE, aSelectType, theLastRowInRange); }
  329.  
  330.     //---------------- SetAccessPos ----------------
  331.     DT_STATUS SetAccessPos (COLNUM aColumnNumber, ROWNUM aRowNumber)
  332.         { return (DT_STATUS) SendDataTblMessage (DTM_SETACCESSPOS, aColumnNumber, aRowNumber); }
  333.  
  334.     //---------------- SetCharSel ----------------
  335.     DT_STATUS SetCharSel (int theFirstSelectedChar, int theLastSelectedChar)
  336.          { return (DT_STATUS) SendDataTblMessage (DTM_SETCHARSEL, NULL,
  337.             MAKELONG (theFirstSelectedChar, theLastSelectedChar)); }
  338.  
  339.     //---------------- SetColCfg ----------------
  340.     DT_STATUS SetColCfg (COLNUM aColumnNumber, LPVOID aColumnConfig)
  341.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLCFG, aColumnNumber, (LONG) aColumnConfig); }
  342.  
  343.     //---------------- SetColCount ----------------
  344.     DT_STATUS SetColCount (int columnCount)
  345.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLCOUNT, columnCount); }
  346.  
  347.     //---------------- SetColDatalen ----------------
  348.     DT_STATUS SetColDatalen (COLNUM aColumnNumber, COLLEN columnLength)
  349.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLDATALEN, aColumnNumber, columnLength); }
  350.  
  351.     //---------------- SetColExtra1 ----------------
  352.     DT_STATUS SetColExtra1 (COLNUM aColumnNumber, DWORD columnExtra)
  353.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLEXTRA1, aColumnNumber, columnExtra); }
  354.  
  355.     //---------------- SetColExtra2 ----------------
  356.     DT_STATUS SetColExtra2 (COLNUM aColumnNumber, DWORD columnExtra)
  357.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLEXTRA2, aColumnNumber, columnExtra); }
  358.  
  359.     //---------------- SetColFormat ----------------
  360.     DT_STATUS SetColFormat (COLNUM aColumnNumber, LPSTR aColumnFormat)
  361.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLFORMAT, aColumnNumber, (LONG) aColumnFormat); }
  362.  
  363.     //---------------- SetColHead ----------------
  364.     DT_STATUS SetColHead (COLNUM aColumnNumber, LPSTR aColumnHead)
  365.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLHEAD, aColumnNumber, (LONG) aColumnHead); }
  366.  
  367.     //---------------- SetColName ----------------
  368.     DT_STATUS SetColName (COLNUM aColumnNumber, LPSTR aColumnName)
  369.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLNAME, aColumnNumber, (LONG) aColumnName); }
  370.  
  371.     //---------------- SetColStyle ----------------
  372.     DT_STATUS SetColStyle (COLNUM aColumnNumber, COLSTYLE columnStyle)
  373.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLSTYLE, aColumnNumber, columnStyle); }
  374.  
  375.     //---------------- SetColType ----------------
  376.     DT_STATUS SetColType (COLNUM aColumnNumber, COLTYPE aColumnType)
  377.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLTYPE, aColumnNumber, aColumnType); }
  378.  
  379.     //---------------- SetColWidth ----------------
  380.     DT_STATUS SetColWidth (COLNUM aColumnNumber, int columnWidth)
  381.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCOLWIDTH, aColumnNumber, columnWidth); }
  382.  
  383.     //---------------- SetConfig ----------------
  384.     DT_STATUS SetConfig (LPTABLECFGSTRUCT theDataTblConfig)
  385.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCONFIG, NULL, (LONG) theDataTblConfig); }
  386.  
  387.     //---------------- SetCurCell ----------------
  388.     DT_STATUS SetCurCell (COLNUM aColumnNumber, ROWNUM aRowNumber)
  389.         { return (DT_STATUS) SendDataTblMessage (DTM_SETCURCELL, aColumnNumber, aRowNumber); }
  390.  
  391.     //---------------- SetEditKey ----------------
  392.     DT_STATUS SetEditKey (EDIT_ACTION anEditAction, WORD aVirtualKey)
  393.         { return (DT_STATUS) SendDataTblMessage (DTM_SETEDITKEY, anEditAction, aVirtualKey); }
  394.  
  395.     //---------------- SetLeftIndex ----------------
  396.     DT_STATUS SetLeftIndex (COLNUM aColumnNumber)
  397.         { return (DT_STATUS) SendDataTblMessage (DTM_GETLEFTINDEX, NULL, aColumnNumber); }
  398.  
  399.     //---------------- SetSelMode ----------------
  400.     DT_STATUS SetSelMode (SELECT_MODE columnSelectToggle)
  401.         { return (DT_STATUS) SendDataTblMessage (DTM_SETSELMODE, NULL, columnSelectToggle); }
  402.  
  403.     //---------------- SetTopIndex ----------------
  404.     DT_STATUS SetTopIndex (ROWNUM aRowNumber)
  405.         { return (DT_STATUS) SendDataTblMessage (DTM_SETTOPINDEX, NULL, aRowNumber); }
  406.  
  407.     //---------------- SetWndStyle ----------------
  408.     DT_STATUS SetWndStyle (DWORD windowStyle)
  409.         { return (DT_STATUS) SendDataTblMessage (DTM_SETWNDSTYLE, NULL, windowStyle); }
  410.  
  411.     //---------------- UpdateCell ----------------
  412.     DT_STATUS UpdateCell (ACCMODE anAccessMode, LPDWORD theCellData)
  413.         { return (DT_STATUS) SendDataTblMessage (DTM_UPDATECELL, anAccessMode, (LONG) theCellData); }
  414.  
  415.     //---------------- UpdateCol ----------------
  416.     DT_STATUS UpdateCol (ACCMODE anAccessMode, LPDWORD theColData)
  417.         { return (DT_STATUS) SendDataTblMessage (DTM_UPDATECOL, anAccessMode, (LONG) theColData); }
  418.  
  419.     //---------------- UpdateRow ----------------
  420.     DT_STATUS UpdateRow (ACCMODE anAccessMode, LPDWORD theRowData)
  421.         { return (DT_STATUS) SendDataTblMessage (DTM_UPDATEROW, anAccessMode, (LONG) theRowData); }
  422.  
  423. private:
  424.  
  425.     DWORD SendDataTblMessage (WORD wMsg, WORD wParam = NULL, LONG lParam = NULL) const
  426.         {
  427.         if (HWindow)
  428.             return SendMessage (HWindow, wMsg, wParam, lParam);
  429.         else
  430.             return DTE_NOWINDOW;
  431.         }
  432.  
  433.     void TransferGetData (RTDataTblData DTData);
  434.     void TransferSetData (RTDataTblData DTData);
  435.  
  436. protected:
  437.  
  438.     virtual LPSTR GetClassName (void);
  439.     virtual void GetWindowClass (WNDCLASS _FAR & AWndClass);
  440.     virtual BOOL Register (void);
  441.     virtual WORD Transfer (Pvoid _FAR DataPtr, WORD TransferFlag);
  442.  
  443. };
  444.  
  445. //==================================================================
  446. //        TDataTblData class - for Transfer functions
  447. //==================================================================
  448.  
  449. typedef void ForEachRowFunc (LPVOID lpRowData, void _FAR * pArg);
  450. typedef void ForEachColFunc (COLNUM Col, void _FAR * pArg);
  451.  
  452. //==================================================================
  453.  
  454. class _EXPORT TDataTblData
  455. {
  456. private:
  457.  
  458.     int RowLen;
  459.     PArray pRows;
  460.    PArray pSelRows;
  461.     PArray pSelCols;
  462.  
  463. public:
  464.  
  465.     TDataTblData (int RowLength);
  466.     ~TDataTblData (void);
  467.  
  468.     int GetRowLength (void) const;
  469.    ROWNUM GetRowCount (void) const;
  470.     ROWNUM GetSelectedRowCount (void) const;
  471.     COLNUM GetSelectedColCount (void) const;
  472.  
  473.     void AddRow (LPVOID lpRowData, BOOL IsSelected = FALSE);
  474.     BOOL RowIsSelected (LPVOID lpRowData);
  475.     void SelectRow (ROWNUM Row);
  476.     void SelectCol (COLNUM Col);
  477.  
  478.     void ForEachRow (ForEachRowFunc _FAR *fn, void _FAR *pArg) const;
  479.     void ForEachSelectedRow (ForEachRowFunc _FAR *fn, void _FAR *pArg) const;
  480.     void ForEachSelectedCol (ForEachColFunc _FAR *fn, void _FAR *pArg) const;
  481.  
  482.     void ResetRows (void);
  483.     void ResetRowSelections (void);
  484.     void ResetColSelections (void);
  485.  
  486.     friend void TDataTbl::TransferGetData (RTDataTblData DTData);
  487.     friend void TDataTbl::TransferSetData (RTDataTblData DTData);
  488. };
  489.  
  490. #endif // ifndef _DTCTL_H
  491.