Listview problems

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Listview problems

    Hello everyone.

    I have a few problems with Listview that I cannot seem to work out.

    The first one is that I would like to disable the customer resizing of the columns. Is there any way of doing this? I have the product on a dedicated device with everything under my control, so there is no re-sizing of any text and I would like to use Listview without scrolls or resizing.

    The second one is when leaving out the scrolling there is always one extra column and one extra row. If I make the Listview box just big enough to fit my regular 8x8 table in it, the bottom extra row of cells pops up and forces the top one off of the page and without scrolls, it seems impossible to bring it back after exiting the edit dialog box.

    Is it possible to get rid of the blank row/column and disable the customer/cursor resizing?

    Thanks,
    Michael
  • Ok, I was able to get the resizing to stop, but I am sure it is not quite the correct way.

    With this, it still tries to resize, but it immediately goes back to its original size. I put it at the top of the callback with no case statement:

    C Source Code

    1. hList = WM_GetDialogItem(hDlg, ID_LISTVIEW_0);
    2. LISTVIEW_SetColumnWidth(hList, i, col_width);



    I just index it up to cover all 8 columns, but if there is a way to just shut it off, I would love to know what it is.

    I still have the annoying blank column/row at the bottom/right hand side that I cannot get rid of or cover up completely. It only really seems to be a problem with the bottom. With the right hand side, I can cover it up with no adverse effects. On the bottom, if I cover more than half of it and then click the box above it (the lowest valid box) it shifts the other cells up and makes the top one be hidden. This is a problem because it had values in it. Any help there would be greatly appreciated as well.
  • Hello Michael,

    please try the code below. I have disabled touch input for the HEADER widget attached to the LISTVIEW. This will prevent the user from resizing the columns. If the LISTVIEW fits exactly to the rows, there is no longer automatic 'scrolling'.

    C Source Code

    1. #include "DIALOG.h"
    2. char * _apText [] = {
    3. "A", "B", "C",
    4. };
    5. /*********************************************************************
    6. *
    7. * _cbListView
    8. */
    9. static void _cbHeader(WM_MESSAGE * pMsg) {
    10. switch (pMsg->MsgId) {
    11. case WM_TOUCH:
    12. break;
    13. default:
    14. HEADER_Callback(pMsg);
    15. break;
    16. }
    17. }
    18. /*********************************************************************
    19. *
    20. * MainTask
    21. */
    22. void MainTask(void) {
    23. WM_HWIN hItem;
    24. int i;
    25. GUI_Init();
    26. hItem = LISTVIEW_CreateEx(10, 10, 150, 56, WM_HBKWIN, WM_CF_SHOW, 0, 0);
    27. for (i = 0; i < 3; i++) {
    28. LISTVIEW_AddColumn(hItem, 50, "Col", GUI_TA_HCENTER | GUI_TA_VCENTER);
    29. }
    30. for (i = 0; i < 3; i++) {
    31. LISTVIEW_AddRow(hItem, _apText);
    32. }
    33. hItem = LISTVIEW_GetHeader(hItem);
    34. WM_SetCallback(hItem, _cbHeader);
    35. while (1) {
    36. GUI_Delay(10);
    37. }
    38. }
    Display All


    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thank you Sven, but I could not quite get that to work either.

    I am watching the pMsg->MsgId and it never goes to WM_TOUCH when actually moving the top of the columns on Listview. It always equals 0xd (WM_TOUCH_CHILD), so I tried to substitute that one instead, but it still resized the columns when they were dragged across the screen. With either the WM_TOUCH or WM_TOUCH_CHILD, it had the exact same results.

    If you have any more suggestions, I would greatly appreciate them.

    Thanks,
    Michael
  • Freeze or fix row of Listview.

    While I am trying to move the horizontal scroll bar of listview, the header remains fixed. I want that the header should also get scrolled with horizontal scroll bar and the cells.

    Also is there any workaround to freeze or fix row in listview.


    Regards,
    Rohit Mishra.
    Images
    • listview.jpeg

      271.97 kB, 1,040×780, viewed 549 times

    The post was edited 1 time, last by mrohit2011 ().

  • Hi,

    I can't reproduce the issue. On my end the header moves along with the cells.

    Same question as in your other post, which emWin version are you using?

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    Please ask ST to update to the latest version. We are not responsible for keeping STemWin up to date.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.