Started button columns. LVN_GETDISPINFO handled. Also filled in the rest of the new column functions.
This commit is contained in:
parent
a00ca05136
commit
9fba903c4a
|
@ -258,7 +258,10 @@ void uiTableAppendTextColumn(uiTable *t, const char *name, int textModelColumn,
|
|||
|
||||
void uiTableAppendImageColumn(uiTable *t, const char *name, int imageModelColumn)
|
||||
{
|
||||
// TODO
|
||||
uiprivTableColumnParams *p;
|
||||
|
||||
p = appendColumn(t, name, LVCFMT_LEFT);
|
||||
p->imageModelColumn = imageModelColumn;
|
||||
}
|
||||
|
||||
void uiTableAppendImageTextColumn(uiTable *t, const char *name, int imageModelColumn, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)
|
||||
|
@ -305,7 +308,12 @@ void uiTableAppendProgressBarColumn(uiTable *t, const char *name, int progressMo
|
|||
|
||||
void uiTableAppendButtonColumn(uiTable *t, const char *name, int buttonTextModelColumn, int buttonClickableModelColumn)
|
||||
{
|
||||
// TODO
|
||||
uiprivTableColumnParams *p;
|
||||
|
||||
// TODO see if we can get rid of this parameter
|
||||
p = appendColumn(t, name, LVCFMT_LEFT);
|
||||
p->buttonModelColumn = buttonTextModelColumn;
|
||||
p->buttonClickableModelColumn = buttonClickableModelColumn;
|
||||
}
|
||||
|
||||
void uiTableSetRowBackgroundColorModelColumn(uiTable *t, int modelColumn)
|
||||
|
|
|
@ -2,8 +2,12 @@
|
|||
#include "uipriv_windows.hpp"
|
||||
#include "table.hpp"
|
||||
|
||||
// further reading:
|
||||
// - https://msdn.microsoft.com/en-us/library/ye4z8x58.aspx
|
||||
|
||||
static HRESULT handleLVIF_TEXT(uiTable *t, NMLVDISPINFOW *nm, uiprivTableColumnParams *p)
|
||||
{
|
||||
int strcol;
|
||||
uiTableData *data;
|
||||
WCHAR *wstr;
|
||||
int progress;
|
||||
|
@ -12,8 +16,13 @@ static HRESULT handleLVIF_TEXT(uiTable *t, NMLVDISPINFOW *nm, uiprivTableColumnP
|
|||
if ((nm->item.mask & LVIF_TEXT) == 0)
|
||||
return S_OK;
|
||||
|
||||
if (p->textModelColumn != -1) {
|
||||
data = (*(t->model->mh->CellValue))(t->model->mh, t->model, nm->item.iItem, p->textModelColumn);
|
||||
strcol = -1;
|
||||
if (p->textModelColumn != -1)
|
||||
strcol = p->textModelColumn;
|
||||
else if (p->buttonModelColumn != -1)
|
||||
strcol = p->buttonModelColumn;
|
||||
if (strcol != -1) {
|
||||
data = (*(t->model->mh->CellValue))(t->model->mh, t->model, nm->item.iItem, strcol);
|
||||
wstr = toUTF16(uiTableDataString(data));
|
||||
uiFreeTableData(data);
|
||||
// We *could* just make pszText into a freshly allocated
|
||||
|
|
Loading…
Reference in New Issue