diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
commit | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch) | |
tree | eaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/T2DlgItemTable.h | |
download | t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2DlgItemTable.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/T2DLL/T2DlgItemTable.h b/src/T2DLL/T2DlgItemTable.h new file mode 100644 index 0000000..577fb52 --- /dev/null +++ b/src/T2DLL/T2DlgItemTable.h @@ -0,0 +1,81 @@ +#pragma once +#include "common.h" +#include "LListener.h" +#include "T2DlgItem.h" + +class DLL_EXPORT T2DlgItemTable : public T2DlgItem, public LListener { +public: + enum ScrollerStyle { + ScrollerStyle_0 + }; + + T2DlgItemTable(T2TowerDoc*, T2ImageObj*, CPalette*); + T2DlgItemTable(int, int, int, int, int, T2TowerDoc*, T2ImageObj*, CPalette*); + + virtual ~T2DlgItemTable(); + virtual int Create(const char*, unsigned long, const RECT&, CWnd*, unsigned int); + virtual void InsertRows(int, unsigned int, void*); + virtual void InsertCols(int, unsigned int, void*); + virtual void RemoveRows(int, unsigned int); + virtual void RemoveCols(int, unsigned int); + virtual void SetRowHeight(int, unsigned int, unsigned int); + virtual void SetColWidth(int, unsigned int, unsigned int); + virtual void SetCellData(const TableCellT&, void*); + virtual void GetCellData(const TableCellT&, void*); + virtual void SelectCell(const TableCellT&); + virtual void ToggleCell(const TableCellT&); + virtual void ClearSelectedCells(); + + void GetTableSize(unsigned int&, unsigned int&) const; + int IsMultiSelectable() const; + void EnableMultiSelect(int); + int IsValidCell(const TableCellT&) const; + int EqualCell(const TableCellT&, const TableCellT&) const; + void SetCellDataSize(int); + int IsSelected(const TableCellT&) const; + void GetSelectedCell(TableCellT&) const; + virtual void ListenToMessage(unsigned int, void*); + T2DlgItemHScr* GetHScroller() const; + T2DlgItemVScr* GetVScroller() const; + void AttachHScroller(T2DlgItemHScr*, int); + void AttachVScroller(T2DlgItemVScr*, int); + void SetHScrollerStyle(ScrollerStyle); + void SetVScrollerStyle(ScrollerStyle); + +protected: + virtual int OnCommand(unsigned int, long); + virtual int OnT2DlgItemEraseBkgnd(CDC*); + virtual void OnT2DlgItemLButtonDown(UINT, CPoint); + virtual void OnT2DlgItemLButtonUp(UINT, CPoint); + virtual void OnT2DlgItemMouseMove(UINT, CPoint); + virtual int OnT2DlgItemCreate(CREATESTRUCT*); + virtual void OnT2Size(unsigned int, int, int); + + virtual void ClickSelf(const POINT&, unsigned int); + virtual void HiliteCells(CDC*, LArrayIterator&); + virtual void UnhiliteCells(CDC*, LArrayIterator&); + virtual void HiliteCell(CDC*, const TableCellT&); + virtual void UnhiliteCell(CDC*, const TableCellT&); + virtual void ClickCell(const TableCellT&, const POINT&); + virtual void DrawCell(CDC*, const TableCellT&); + virtual int FetchLocalCellFrame(const TableCellT&, RECT&); + virtual void FetchCellHitBy(const POINT&, TableCellT&); + + int FetchCellDataIndex(const TableCellT&); + void InvalidateCell(const TableCellT&); + void ViewToClient(POINT*, int); + void ClientToView(POINT*, int); + void DoScroll(); + int IsOwnHScroller() const; + int IsOwnVScroller() const; + +private: + void InitTable(int, int, int, int, int); + int Resized(); +}; + +class DLL_EXPORT TableCellIterator { +public: + TableCellIterator(const TableCellT&, const TableCellT&); + int Next(TableCellT&); +}; |