1. setLVTextItem - Help Needed Still

This is a multi-part message in MIME format.

------=_NextPart_000_00ED_01C0DD7C.E36B09E0
	charset="iso-8859-1"

Hi all,
A while ago I asked how can I change the text of the selected row in a list
view in a predefined column.

Matt Lewis suggested using changeLVItemText(), but I see no such command.

Derek I tried your suggestion to no avail.

Please look at attached code which is a simple to do list I knocked up so
someone can show me how to change the text. The idea is select a list view
item click Done button and last column changes to "Done"

Can anyone help please as this is holding up a large prog I am writing, at
the moment I am re-reading the whole list and when it contains in excess of
1000 lines it takes too long. Especially when all I want to do is change one
word.

Thanks

Tony Steward

Come Visit Me At www.locksdownunder.com


------=_NextPart_000_00ED_01C0DD7C.E36B09E0
Content-Type: application/octet-stream;
	name="TestLV.exw"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="TestLV.exw"

--  code generated by Win32Lib IDE v0.10.3

include Win32Lib.ew
without warning

setWindowBackColor( MainWin,12632256)
global constant LV =3D create( ListView, {"Item","Action"}, MainWin, 64, =
8,208, 84,or_all({LVS_REPORT,LVS_SHOWSELALWAYS}))
global constant DoneButton =3D create( PushButton, "Done", MainWin, 116, =
112, 90, 30, 0 )

myicon =3D addIcon( extractIcon( "key.ico" )) =20

    data =3D {
            {"Mow Lawns", "To Do"},
            {"Fix Fence", "To Do"},
            {"Check Tyres", "To Do"}
            }
    listid =3D {}
    for i =3D 1 to length(data) do
        listid &=3D addLVItem( LV, myicon, data[i][1..2])
    end for
end procedure
onOpen[MainWin] =3D routine_id("MainWin_onOpen")

atom id

--    rowselected =3D getIndex(LV) -- Does not work
    itemselected =3D getLVSelected(LV)
    id =3D listid[itemselected[1]]
--    setLVItemText(LV, rowselected[1], 1, "Done")=20
    setLVItemText(LV, id, 1, "Done")=20

end procedure
onClick[DoneButton] =3D routine_id("DoneButton_onClick")



WinMain( MainWin, Normal )

------=_NextPart_000_00ED_01C0DD7C.E36B09E0--

new topic     » topic index » view message » categorize

2. Re: setLVTextItem - Help Needed Still

Tony,
below is the corrected routine from Matt Lewis. His original routine had a
couple of bugs.

--/topic ListView Control
--/proc changeLVItemText( lv, item, column, text )
global procedure changeLVItemText( integer LV, integer item,
                                   integer subitem, sequence text )
    atom hWnd

    subitem += 1
    release_mem( lvitem_data[item][2][subitem][1] )

    lvitem_data[item][2][subitem][1] = acquire_mem(0,  text)
    lvitem_data[item][2][subitem][2] = length( text)

    hWnd = getHandle( LV )

    -- invalidate all of the current window, and clear it
    VOID = w32Func( xInvalidateRect, {hWnd, NULL, 1} )

    -- trigger an immediate paint message
    VOID = w32Func( xSendMessage, { hWnd, WM_PAINT, 0, 0 } )

end procedure


------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

----- Original Message -----
From: "Tony Steward" <figjam at nlc.net.au>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, January 02, 2001 9:41 AM
Subject: setLVTextItem - Help Needed Still


>
>
> Hi all,
> A while ago I asked how can I change the text of the selected row in a
list
> view in a predefined column.
>
> Matt Lewis suggested using changeLVItemText(), but I see no such command.
>
> Derek I tried your suggestion to no avail.
>
> Please look at attached code which is a simple to do list I knocked up so
> someone can show me how to change the text. The idea is select a list view
> item click Done button and last column changes to "Done"
>
> Can anyone help please as this is holding up a large prog I am writing, at
> the moment I am re-reading the whole list and when it contains in excess
of
> 1000 lines it takes too long. Especially when all I want to do is change
one
> word.
>
> Thanks
>
> Tony Steward
>
> Come Visit Me At www.locksdownunder.com
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu