ListView

Тема в разделе "WASM.ENGLISH", создана пользователем dcskm4200, 5 дек 2005.

  1. dcskm4200

    dcskm4200 New Member

    Публикаций:
    0
    Регистрация:
    12 окт 2004
    Сообщения:
    173
    Адрес:
    China
    Hello,everyone

    ;------------------------------

    lOCAL lv:LV_ITEM



    ...

    mov lv.cchTextMax, 65535d

    ...

    ;------------------------------

    the tested result !=65535d

    How many MAX bytes is there in a SysListView32 cell(row,column)?



    regards
     
  2. shoo

    shoo New Member

    Публикаций:
    0
    Регистрация:
    17 июл 2003
    Сообщения:
    1.537
    Адрес:
    Ukraine
    this member contains size of buffer pointed with pszText and allocated by you to recieve string from listview - so, you can place there any value, as i understand. in other cases it is ignored. - it is from msdn.
     
  3. dcskm4200

    dcskm4200 New Member

    Публикаций:
    0
    Регистрация:
    12 окт 2004
    Сообщения:
    173
    Адрес:
    China
    Hello,shoo

    i'm glad to meet you here again.

    MS Said:

    ;=========================================================

    pszText

    If the structure specifies item attributes, pszText is a pointer to a null-terminated string containing the item text. If the structure receives item attributes, pszText is a pointer to a buffer that receives the item text. Note that although the list-view control allows any length string to be stored as item text, only the first 260 characters are displayed.



    If the value of pszText is LPSTR_TEXTCALLBACK, the item is a callback item. If the callback text changes, you must explicitly set pszText to LPSTR_TEXTCALLBACK and notify the list-view control of the change by sending an LVM_SETITEM or LVM_SETITEMTEXT message.



    Do not set pszText to LPSTR_TEXTCALLBACK if the list-view control has the LVS_SORTASCENDING or LVS_SORTDESCENDING style.

    cchTextMax

    Number of characters in the buffer pointed to by pszText. This member is only used when the structure receives item attributes. It is ignored when the structure specifies item attributes.

    ;=======================================================

    when i tested a code, i found:



    if i wrote a text file(2M) into lv.pszText, the cell(row,column) of listview only displaied a 260 chars.

    and then i read the text of the cell into a richedit, the richedit can't display all the text file.



    How do i can change the sizes for displaying all text?



    regards
     
  4. shoo

    shoo New Member

    Публикаций:
    0
    Регистрация:
    17 июл 2003
    Сообщения:
    1.537
    Адрес:
    Ukraine
    understand problem: i think it could be impossible to do this with that way - it can be implemented through these callback functions / ownerdrawing: then you have to manage strings in memory with your code, and display it with own code also. these common controls are universal in some limits.

    you can also put only 260 chars into listview "as beginning" and have a button eg. "More...", which will show full text from associated text buffer. also it is possible to have a richedit near listview and load it from buffer synchronousely with listview position, but it can appear very slow. in these last solutions text buffers have to be managed with your code, of course: you have to allocate memory, store pointers somewhere (buffer sequence can be built as linked list) etc.



    may be this will help :)
     
  5. dcskm4200

    dcskm4200 New Member

    Публикаций:
    0
    Регистрация:
    12 окт 2004
    Сообщения:
    173
    Адрес:
    China
    Hello, shoo

    Thanks you.

    I'm interesting your method. but it is some complicated toward me. have you some demos ?



    I used the LisView as a real time database for storing datas in memory. the buffer is being used to recv the datas from net, the datas in buffer is updating at every time. the richedit is used to show the datas.



    regards
     
  6. cresta

    cresta Active Member

    Публикаций:
    0
    Регистрация:
    13 июн 2004
    Сообщения:
    2.257




    May be you need another sheme: storing data in memory array instead of storing it in listview. Array haven't 260 symbols limitation.

    And to show your data's preview (for example some first symbols) in listview you can create him with style LVS_OWNERDATA.

    May be this method will deside your problem?
     
  7. cresta

    cresta Active Member

    Публикаций:
    0
    Регистрация:
    13 июн 2004
    Сообщения:
    2.257
    A simple sample:



    Here data was retrieved from file. You can store in array of pointers (named pData) pointers to your own buffers. And your buffers may be edited at any time you need without recreating of array of pointers.

    Also richedit may be used instead of edit if edit's limit (32k) is too small.





    [​IMG] _1004359462__listview.zip
     
  8. dcskm4200

    dcskm4200 New Member

    Публикаций:
    0
    Регистрация:
    12 окт 2004
    Сообщения:
    173
    Адрес:
    China
    hello,cresta

    it is very helpful. I'll learn How it works.



    Thank you very much.