1. strange win32lib problem
- Posted by don cole <doncole at pacbell.net> May 29, 2007
- 653 views
Hello everybody, What I don't get is this was working before:
constant ListView15 = createEx( ListView, {"ListView15",""}, Window1, 184, 56, 160, 200, w32or_all({LVS_REPORT,LVS_SHOWSELALWAYS}), 0 ) atom lvMask integer lvOk lvMask = w32or_all({LVS_EX_CHECKBOXES}) lvOk = sendMessage(ListView15,LVM_SETEXTENDEDLISTVIEWSTYLE,lvMask,lvMask)
for x=1 to length(FILE) do VOID=addLVItem(ListView15,0,FILE[x]) end for
Don Cole }}}
2. strange win32lib problem
- Posted by don cole <doncole at pacbell.net> May 29, 2007
- 634 views
Hello Everybody, What I don't get, This was working before:
constant FILE-{"afile.dat","bFile.dat",cFile.dat"}--etc... constant ListView15 = createEx( ListView, {"ListView15",""}, Window1, 184, 56, 160, 200, w32or_all({LVS_REPORT,LVS_SHOWSELALWAYS}), 0 ) atom lvMask integer lvOk lvMask = w32or_all({LVS_EX_CHECKBOXES}) lvOk = sendMessage(ListView15,LVM_SETEXTENDEDLISTVIEWSTYLE,lvMask,lvMask) procedure load_controls() for x=1 to length(FILE) do VOID=addLVItem(ListView15,0,FILE[x]) end for setCheck({ListView15,3},w32True) end procedure
Now I keep getting error: F:\eu\WIN32LIB\Win32Lib.ew:22844 in procedure setCheck() variable row has not been assigned a value pControls = {13,3} flag = 1 hMII = <no value> lType = <no value> id = 13 row = <no value> TV_ITEM = <no value> state = <no value> lFlags = <no value> mask = <no value> k = 1 i = <no value> j = <no value> row IS declared it's 3, I don't get it. Any help appreciated. Don Cole
3. Re: strange win32lib problem
- Posted by Guillermo Bonvehi <gbonvehi at gmail.com> May 29, 2007
- 616 views
Taken from win32lib's setCheck documentation: Note: For ListViews, the id is actually in the form {{id,row}} so it knows which row to check. Take note of the double sequence syntax. -- Add a check mark to row 2. {setCheck}( {{myLV, 2}}, w32True) See the last sentence :) Cheers, Guillermo Bonvehí
4. Re: strange win32lib problem
- Posted by don cole <doncole at pacbell.net> May 29, 2007
- 587 views
Guillermo Bonvehi wrote: > > Taken from win32lib's setCheck documentation: > Note: For ListViews, the id is actually in the form {{id,row}} so it knows > which > row to check. Take note of the double sequence syntax. > -- Add a check mark to row 2. > {setCheck}( {{myLV, 2}}, w32True) > > See the last sentence :) > > Cheers, > Guillermo Bonvehí Thank you Guillermo, But I am doing that. setCheck({ListView15,3},w32True)--the list view and row 3 in funny brackets. I see you you have put setCheck in funny brackets. Is that on purpose for this to work? Anyway I fixed my problem by using setLVCheck(ListView15,3,w32True). But it should work with setCheck also. Don Cole
5. Re: strange win32lib problem
- Posted by Guillermo Bonvehi <gbonvehi at gmail.com> May 29, 2007
- 573 views
Sorry Don, the funny brackets were there because of the html viewer I was using for documentation. The sentence I told you to read was "Take note of the double sequence syntax." The correct sintax if you're using setCheck is:
setCheck({{ListView15,3}},w32True)
If you read carefully, you'll see it's a sequence inside a sequence. Best regards, Guillermo Bonvehí
6. Re: strange win32lib problem
- Posted by don cole <doncole at pacbell.net> May 29, 2007
- 632 views
- Last edited May 30, 2007
Guillermo Bonvehi wrote: > > Sorry Don, the funny brackets were there because of the html viewer I was > using > for documentation. > The sentence I told you to read was "Take note of the double sequence syntax." > The correct sintax if you're using setCheck is: > }}} <eucode> > setCheck({{ListView15,3}},w32True) > </eucode> {{{ > If you read carefully, you'll see it's a sequence inside a sequence. > > Best regards, > Guillermo Bonvehí Thanks Guillermo, But that's what I got, setCheck({{ListView15,3}},w32True) And I still get the same error row is not defined, But it IS. It's 3. Don Cole
7. Re: strange win32lib problem
- Posted by Guillermo Bonvehi <gbonvehi at gmail.com> May 30, 2007
- 641 views
Weird, maybe you've some old version, I really don't know, the following code works fine here:
include Win32Lib.ew constant Window1 = createEx( Window, "", 0, Default, Default, 190, 220, 0, 0 ) constant FILE={"afile.dat","bFile.dat","cFile.dat"} constant ListView15 = createEx( ListView, {"ListView15",""}, Window1, 1, 1, 160, 200, w32or_all({LVS_REPORT,LVS_SHOWSELALWAYS}), 0 ) atom lvMask integer lvOk lvMask = w32or_all({LVS_EX_CHECKBOXES}) lvOk = sendMessage(ListView15,LVM_SETEXTENDEDLISTVIEWSTYLE,lvMask,lvMask) procedure load_controls() for x=1 to length(FILE) do VOID=addLVItem(ListView15,0,FILE[x]) end for setCheck({{ListView15,3}},w32True) end procedure load_controls() WinMain( Window1,Normal )
setCheck just calls setLVChecked, so I guess you can still continue without problems. Cheers, Guillermo Bonvehí