From ca2115ca5773036f1326ea95b1f2368d9f2c89f3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 8 Jun 2018 01:23:11 -0400 Subject: [PATCH] Removed some old files from wintable that we won't use anymore. --- windows/tablepart.cpp | 95 ------------------------------------------- windows/tableutil.cpp | 32 --------------- 2 files changed, 127 deletions(-) delete mode 100644 windows/tablepart.cpp delete mode 100644 windows/tableutil.cpp diff --git a/windows/tablepart.cpp b/windows/tablepart.cpp deleted file mode 100644 index c31932d7..00000000 --- a/windows/tablepart.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// 30 june 2016 -// TODO includes - -typedef struct tablePartDrawParams tablePartDrawParams; -typedef struct tablePartMinimumSizeParams tableDrawMinimumSizeParams; -typedef struct tablePartEditingParams tablePartEditingParams; - -struct tablePartDrawParams { - HWND hwnd; - HDC hdc; - RECT *r; - bool selected; - bool focused; - bool hovering; - uiTableModel *model; - int row; -}; - -struct tablePartMinimumSizeParams { - HWND hwnd; - HDC hdc; - uiTableModel *model; - int row; -}; - -enum { - partEventDoNothing, - partEventRedraw, - partEventEdit, -}; - -struct tablePartEditingParams { - HWND newHWND; -}; - -enum { - partEditContinue, - partEditDone, -}; - -class tablePart { -public: - // needed so we can delete a tablePart - virtual ~tablePart() {} - - virtual HRESULT Draw(tablePartDrawParams *p) = 0; - virtual HRESULT MinimumSize(tablePartMinimumSizeParams *p, int *width, int *height) = 0; - - // returns a partEvent constant - virtual int MouseMove(int x, int y, RECT *cell) = 0; - virtual int MouseLeave(void) = 0; - virtual int LButtonDown(int x, int y, int count, RECT *cell) = 0; - virtual int LButtonUp(int x, int y, RECT *cell) = 0; - virtual int CaptureBroken(void) = 0; - virtual int KeyDown(void) = 0; - virtual int KeyUp(void) = 0; - - // editing; all optional - virtual int StartEditing(tablePartEditingParams *p) { return editDone; } - virtual int EditChildWM_COMMAND(WORD code, LRESULT *lr) { return editDone; } - virtual void FinishEditing(uiTableModel *model, int row) {} - virtual void CancelEditing(void) {} - - // TODO tooltips - // TODO timers and animations - - // optional methods - virtual void SetTextColorColumn(int col) {} - virtual void SetEditable(bool editable) {} -}; - -class tablePartText : public tablePart { - int textColumn; - int colorColumn; -public: - tablePartText(int tc) - { - this->textColumn = tc; - this->colorColumn = -1; - } - - // TODO figure out vertical alignment - virtual HRESULT Draw(tablePartDrawParams *p) - { - } - - virtual HRESULT MinimumSize(tablePartMinimumSizeParams *p, int *width, int *height) - { - } -}; - -tablePart *newTablePartText(int tc) -{ - return new tablePartText(tc); -} diff --git a/windows/tableutil.cpp b/windows/tableutil.cpp deleted file mode 100644 index e6e5bb14..00000000 --- a/windows/tableutil.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// 1 july 2016 -// TODO includes - -void tableGetClientRect(HWND hwnd, RECT *r) -{ - if (GetClientRect(hwnd, r) == 0) { - r->left = 0; - r->top = 0; - r->right = 0; - r->bottom = 0; - } -} - -void tableGetWindowRect(HWND hwnd, RECT *r) -{ - if (GetWindowRect(hwnd, r) == 0) { - r->left = 0; - r->top = 0; - r->right = 0; - r->bottom = 0; - } -} - -void tableGetTextExtentPoint32W(HDC dc, const WSTR *str, int len, SIZE *s) -{ - if (len == -1) - len = wcslen(str); - if (GetTextExtentPoint32W(dc, str, len, s) == 0) { - s->cx = 0; - s->cy = 0; - } -}