Page 1 of 1

Redefine Listview - Error.

Posted: Fri Jul 24, 2015 4:41 pm
by anacatacombs
Hi, dear friends.
I updated the FiveWin version 8.01 to 13.01 , and realized that the Redefine Listview is not working.
The Items are not loaded with InsertItem method .
I did a simple test ( created a new program only with the listview ) and still not worked.
However, if used NEW method instead of the REDEFINE , it works correctly.
Below is my test :

Code: Select all


DEFINE DIALOG oDlgTeste resource 1001

ACTIVATE DIALOG oDlgTeste ON INIT Inicia_Dialog()

return(.t.)


FUNCTION Inicia_dialog()
REDEFINE Listview oListTeste ID 4001 OF oDlgTeste    

aTeste := {"1","2","3","5"}
AEVAL(aTeste,{|ItemList,x|oListTeste:InsertItem(x-1,ItemList)})
oListTeste:refresh()

return(.t.)

 
No runtime error occurs , the items just are not loaded in the ListView .
Someone with the same problem?

At.

Ana

Re: Redefine Listview - Error.

Posted: Fri Jul 24, 2015 4:54 pm
by AntoninoP
Hello,
can you post the RC file too?
Regards,
Antonino

Re: Redefine Listview - Error.

Posted: Fri Jul 24, 2015 5:00 pm
by anacatacombs
Hi Antonino.
Thanks :)

Code: Select all

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1001 DIALOGEX DISCARDABLE 6, 18, 210, 142
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "Tahoma", 0, 0, 1
{
  CONTROL "", 4001, "SysListView32", LVS_REPORT|LVS_SINGLESEL|LVS_AUTOARRANGE|WS_BORDER|WS_TABSTOP, 4, 8, 196, 116
}
 
I use .RES , but saved for .RC to post.

Re: Redefine Listview - Error.

Posted: Sat Jul 25, 2015 12:48 pm
by Antonio Linares
Ana,

You have to code it this way:

Code: Select all

DEFINE DIALOG oDlgTeste resource 1001

REDEFINE Listview oListTeste ID 4001 OF oDlgTeste    

ACTIVATE DIALOG oDlgTeste ON INIT Inicia_Dialog( oListTeste )

return(.t.)


FUNCTION Inicia_dialog( oListTeste )

local aTeste := {"1","2","3","5"}

AEVAL(aTeste,{|ItemList,x|oListTeste:InsertItem( x, ItemList ) } )

return(.t.)

Re: Redefine Listview - Error.

Posted: Mon Jul 27, 2015 4:37 pm
by anacatacombs
Hi Antonio.
Now it's working fine.
Thank you !
You are awesome!
:D
* * * *
Just to share :

I could solve the problem of listview in my small project with the tips Antonio passed, however time to replicate the fix for the main project , the problem remained .
After some time , I discovered that the problem was in the Manifest that had in a resource created by PELLES .
Removed the manifest and everything worked perfectly .

Thank you all for your attention.