FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Redefine Listview - Error.
Posts: 4
Joined: Fri Dec 02, 2011 09:53 AM
Redefine Listview - Error.
Posted: Fri Jul 24, 2015 04:41 PM
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 (fw): Select all Collapse
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
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: Redefine Listview - Error.
Posted: Fri Jul 24, 2015 04:54 PM

Hello,
can you post the RC file too?
Regards,
Antonino

Posts: 4
Joined: Fri Dec 02, 2011 09:53 AM
Re: Redefine Listview - Error.
Posted: Fri Jul 24, 2015 05:00 PM
Hi Antonino.
Thanks :-)

Code (fw): Select all Collapse
// 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.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Redefine Listview - Error.
Posted: Sat Jul 25, 2015 12:48 PM
Ana,

You have to code it this way:

Code (fw): Select all Collapse
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
Posts: 4
Joined: Fri Dec 02, 2011 09:53 AM
Re: Redefine Listview - Error.
Posted: Mon Jul 27, 2015 04:37 PM

Hi Antonio.
Now it's working fine.
Thank you !
You are awesome!


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.

:D

Continue the discussion