2018-06-09 23:49:44 -05:00
|
|
|
// 10 june 2018
|
2018-06-23 22:35:42 -05:00
|
|
|
#include "../common/table.h"
|
2018-06-09 23:49:44 -05:00
|
|
|
|
|
|
|
// table.cpp
|
|
|
|
#define uiprivNumLVN_GETDISPINFOSkip 3
|
|
|
|
struct uiTableModel {
|
|
|
|
uiTableModelHandler *mh;
|
|
|
|
std::vector<uiTable *> *tables;
|
|
|
|
};
|
|
|
|
typedef struct uiprivTableColumnParams uiprivTableColumnParams;
|
|
|
|
struct uiprivTableColumnParams {
|
|
|
|
int textModelColumn;
|
2018-06-24 08:52:01 -05:00
|
|
|
int textEditableModelColumn;
|
2018-06-09 23:49:44 -05:00
|
|
|
uiTableTextColumnOptionalParams textParams;
|
|
|
|
|
|
|
|
int imageModelColumn;
|
|
|
|
|
|
|
|
int checkboxModelColumn;
|
2018-06-24 08:52:01 -05:00
|
|
|
int checkboxEditableModelColumn;
|
2018-06-09 23:49:44 -05:00
|
|
|
|
|
|
|
int progressBarModelColumn;
|
|
|
|
|
|
|
|
int buttonModelColumn;
|
|
|
|
int buttonClickableModelColumn;
|
|
|
|
};
|
|
|
|
struct uiTable {
|
|
|
|
uiWindowsControl c;
|
|
|
|
uiTableModel *model;
|
|
|
|
HWND hwnd;
|
|
|
|
std::vector<uiprivTableColumnParams *> *columns;
|
|
|
|
WPARAM nColumns;
|
|
|
|
int backgroundColumn;
|
2018-06-15 22:00:39 -05:00
|
|
|
// TODO make sure replacing images while selected in the listview is even allowed
|
|
|
|
HIMAGELIST imagelist;
|
2018-06-16 18:05:36 -05:00
|
|
|
// TODO document all this
|
|
|
|
std::map<std::pair<int, int>, LONG> *indeterminatePositions;
|
2018-06-17 14:06:45 -05:00
|
|
|
BOOL inLButtonDown;
|
2018-06-20 17:03:56 -05:00
|
|
|
// TODO is this even necessary? it seems NM_CLICK is not sent if NM_DBLCLICK or LVN_ITEMACTIVATE (one of the two) happens...
|
2018-06-17 14:06:45 -05:00
|
|
|
BOOL inDoubleClickTimer;
|
2018-06-17 16:56:45 -05:00
|
|
|
HWND edit;
|
2018-06-19 22:07:24 -05:00
|
|
|
int editedItem;
|
|
|
|
int editedSubitem;
|
2018-06-09 23:49:44 -05:00
|
|
|
};
|
2018-06-16 18:05:36 -05:00
|
|
|
extern int uiprivTableProgress(uiTable *t, int item, int subitem, int modelColumn, LONG *pos);
|
2018-06-13 20:06:08 -05:00
|
|
|
|
2018-06-16 11:33:16 -05:00
|
|
|
// tabledispinfo.cpp
|
|
|
|
extern HRESULT uiprivTableHandleLVN_GETDISPINFO(uiTable *t, NMLVDISPINFOW *nm, LRESULT *lResult);
|
2018-06-15 09:04:32 -05:00
|
|
|
|
|
|
|
// tabledraw.cpp
|
|
|
|
extern HRESULT uiprivTableHandleNM_CUSTOMDRAW(uiTable *t, NMLVCUSTOMDRAW *nm, LRESULT *lResult);
|
2018-06-15 21:50:19 -05:00
|
|
|
extern HRESULT uiprivUpdateImageListSize(uiTable *t);
|
2018-06-17 10:48:39 -05:00
|
|
|
|
2018-06-20 09:45:14 -05:00
|
|
|
// tableediting.cpp
|
2018-06-20 17:47:55 -05:00
|
|
|
extern HRESULT uiprivTableResizeWhileEditing(uiTable *t);
|
2018-06-17 10:48:39 -05:00
|
|
|
extern HRESULT uiprivTableHandleNM_CLICK(uiTable *t, NMITEMACTIVATE *nm, LRESULT *lResult);
|
2018-06-19 22:07:24 -05:00
|
|
|
extern HRESULT uiprivTableFinishEditingText(uiTable *t);
|
|
|
|
extern HRESULT uiprivTableAbortEditingText(uiTable *t);
|
2018-06-20 17:03:56 -05:00
|
|
|
|
|
|
|
// tablemetrics.cpp
|
|
|
|
typedef struct uiprivTableMetrics uiprivTableMetrics;
|
|
|
|
struct uiprivTableMetrics {
|
|
|
|
BOOL hasText;
|
|
|
|
BOOL hasImage;
|
|
|
|
BOOL focused;
|
|
|
|
BOOL selected;
|
|
|
|
|
|
|
|
RECT itemBounds;
|
|
|
|
RECT itemIcon;
|
|
|
|
RECT itemLabel;
|
|
|
|
RECT subitemBounds;
|
|
|
|
RECT subitemIcon;
|
|
|
|
RECT subitemLabel;
|
|
|
|
|
|
|
|
LRESULT bitmapMargin;
|
|
|
|
int cxIcon;
|
|
|
|
int cyIcon;
|
|
|
|
|
|
|
|
RECT realTextBackground;
|
|
|
|
RECT realTextRect;
|
|
|
|
};
|
|
|
|
extern HRESULT uiprivTableGetMetrics(uiTable *t, int iItem, int iSubItem, uiprivTableMetrics **mout);
|