Hello,
I'm trying to create a LISTVIEW widget in the centre of a window. The problem is that the LISTVIEW that I create does not have the left border. I tried LISTVIEW_SetLBorder(ListviewHandle, 1); but it seems to not work at all. I also tried using LISTVIEW_SetRBorder(ListviewHandle, 0); to remove the right border, just to see if the function works but I had the same result - this function also does not seem have any effect .
Please, tell me what I'm doing wrong or how to create a LISTVIEW widget with both right and left borders. Here is my callback function for the window in which I want to create the LISTVIEW.
Display All
Regards
Piotr
I'm trying to create a LISTVIEW widget in the centre of a window. The problem is that the LISTVIEW that I create does not have the left border. I tried LISTVIEW_SetLBorder(ListviewHandle, 1); but it seems to not work at all. I also tried using LISTVIEW_SetRBorder(ListviewHandle, 0); to remove the right border, just to see if the function works but I had the same result - this function also does not seem have any effect .
Please, tell me what I'm doing wrong or how to create a LISTVIEW widget with both right and left borders. Here is my callback function for the window in which I want to create the LISTVIEW.
Source Code
- static void
- cbTableOfResultsWindow (WM_MESSAGE *pMsg)
- {
- //**************************************************************************
- switch (pMsg->MsgId)
- {
- //**********************************************************************
- case WM_PAINT:
- {
- GUI_SetBkColor(GUI_BROWN); // debug
- GUI_Clear();
- break;
- }
- //**********************************************************************
- case WM_CREATE:
- {
- LISTVIEW_Handle ListviewHandle;
- HEADER_Handle hHeader;
- int Columns = 4;
- int Rows = 5;
- int ColWidth = (int)(300 / Columns);
- int RowHeight = (int)(100 / Rows);
- int BorderH = 0;
- int BorderV = 0;
- // create the listview
- ListviewHandle = LISTVIEW_CreateEx(TAB_OF_RESULTS_MARGIN,
- TAB_OF_RESULTS_MARGIN,
- 300+1, // 1 extra pixel to show the right border
- 100,
- pMsg->hWin,
- WM_CF_SHOW,
- 0,
- UI_ID_TAB_OF_RESULTS_LISTVIEW);
- WIDGET_SetEffect(ListviewHandle, &WIDGET_Effect_None);
- LISTVIEW_SetGridVis(ListviewHandle, true);
- // create columns
- for (uint8_t i = 0; i < Columns; i++)
- {
- LISTVIEW_AddColumn(ListviewHandle,
- ColWidth,
- NULL,
- GUI_TA_VCENTER | GUI_TA_HCENTER);
- }
- hHeader = LISTVIEW_GetHeader(ListviewHandle);
- HEADER_SetHeight(hHeader, RowHeight);
- // create rows
- for (uint8_t i = 0; i < Rows; i++)
- {
- LISTVIEW_AddRow(ListviewHandle, NULL);
- }
- LISTVIEW_SetRowHeight(ListviewHandle, RowHeight);
- // !!! these two don't work !!!
- LISTVIEW_SetRBorder(ListviewHandle, 0);
- LISTVIEW_SetLBorder(ListviewHandle, 1);
- break;
- }
- //**********************************************************************
- default:
- {
- WM_DefaultProc(pMsg);
- break;
- }
- }
- }
Regards
Piotr