Redefine Listview - Error.

Post Reply
anacatacombs
Posts: 4
Joined: Fri Dec 02, 2011 9:53 am
Location: Paraná-Brasil

Redefine Listview - Error.

Post 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
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: Redefine Listview - Error.

Post by AntoninoP »

Hello,
can you post the RC file too?
Regards,
Antonino
anacatacombs
Posts: 4
Joined: Fri Dec 02, 2011 9:53 am
Location: Paraná-Brasil

Re: Redefine Listview - Error.

Post 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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Redefine Listview - Error.

Post 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.)
regards, saludos

Antonio Linares
www.fivetechsoft.com
anacatacombs
Posts: 4
Joined: Fri Dec 02, 2011 9:53 am
Location: Paraná-Brasil

Re: Redefine Listview - Error.

Post 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.
Post Reply