Hello,
My question is related to skinning of HEADER widgets. I've got a LISTVIEW which has a white background, created like this:
Display All
The above code is setting the column header names as I'd like, however I'm unsure how to make this work when skinning the header. The skinning routine does this:
Display All
So, what I'm trying to do is to have a white background header with my text on top for each column name. I would usually do this by implementing the WIDGET_ITEM_DRAW_TEXT case, however I don't know how to retrieve the previously set text here. I hope this makes some sense?
I had hoped that simply setting HEADER_SetBkColor(hHeader, GUI_WHITE); would have done the trick but this seems to have no effect. I've also tried to change the SKINFLEX props (this almost works) but means there are some undesirable (for me) artefacts left over.
So, the question really is how do I set the header item text fields from the skin callback?
Cheers,
Peter.
My question is related to skinning of HEADER widgets. I've got a LISTVIEW which has a white background, created like this:
C Source Code
- static void
- cbResultsListview (WM_MESSAGE * pMsg)
- {
- char ColumnName[COLUMN_NAME_MAX_LEN];
- switch (pMsg->MsgId)
- {
- case WM_CREATE:
- {
- HEADER_Handle hHeader;
- uint32_t XSize, YSize;
- int RowHeight;
- int ColWidth;
- lgListView = LISTVIEW_CreateAttached(pMsg->hWin,
- GUI_ID_LISTVIEW1,
- 0);
- WIDGET_SetEffect(lgListView, &WIDGET_Effect_None);
- LISTVIEW_SetAutoScrollV(lgListView, 1);
- LISTVIEW_SetGridVis(lgListView, 1);
- XSize = WM_GetWindowSizeX(pMsg->hWin);
- YSize = WM_GetWindowSizeY(pMsg->hWin);
- ColWidth = XSize / (PHOTOMETRY_MAX_SAMPLE_POINTS + 1);
- RowHeight = YSize / 8;
- LISTVIEW_AddColumn(lgListView,
- ColWidth,
- "SAMPLE #",
- GUI_TA_VCENTER | GUI_TA_HCENTER);
- for (uint8_t i = 1; i < PHOTOMETRY_MAX_SAMPLE_POINTS + 1; i++)
- {
- if (i <= gPhotometryScanParams.WLCount)
- {
- snprintf(ColumnName,
- COLUMN_NAME_MAX_LEN,
- "WL %d\n%.1f nm",
- i,
- gPhotometryScanParams.SampleWLs[i - 1]);
- }
- else
- {
- snprintf(ColumnName,
- COLUMN_NAME_MAX_LEN,
- "WL %d\n____",
- i);
- }
- LISTVIEW_AddColumn(lgListView,
- ColWidth,
- ColumnName,
- GUI_TA_VCENTER | GUI_TA_HCENTER);
- }
- hHeader = LISTVIEW_GetHeader(lgListView);
- HEADER_SetHeight(hHeader, RowHeight);
- //HEADER_SetFont(hHeader, GUI_FONT_16_ARIAL);
- HEADER_SetTextColor(hHeader, GUI_GRAY);
- HEADER_SetSkin(hHeader, TableOfResultsWhiteHeaderSkin);
- LISTVIEW_SetRowHeight(lgListView, RowHeight);
- break;
- }
The above code is setting the column header names as I'd like, however I'm unsure how to make this work when skinning the header. The skinning routine does this:
C Source Code
So, what I'm trying to do is to have a white background header with my text on top for each column name. I would usually do this by implementing the WIDGET_ITEM_DRAW_TEXT case, however I don't know how to retrieve the previously set text here. I hope this makes some sense?
I had hoped that simply setting HEADER_SetBkColor(hHeader, GUI_WHITE); would have done the trick but this seems to have no effect. I've also tried to change the SKINFLEX props (this almost works) but means there are some undesirable (for me) artefacts left over.
So, the question really is how do I set the header item text fields from the skin callback?
Cheers,
Peter.