Re: ListViews in Win32Lib

new topic     » goto parent     » topic index » view thread      » older message » newer message

This is a multi-part message in MIME format.

------=_NextPart_000_0046_01C270CA.F0010AA0
	charset="iso-8859-1"

Thanks!

Ive been waiting what seems forever for te response.
It took somewhere around 1 1/2 hrs for my email to make it to topica and =
back.
I thought I was going to croak  :P

also..  Derek..

I think there might just be an error in win32lib with listviews

I was using getLVAllChecked() and it returned the checked items  =
except..
Item # 1 wasnt even included and the last thing in the returned sequence =
was -1

I have resorted to..

   lvcount =3D getLVCount(prefslbox)
   for i =3D 0 to lvcount-1 do
      if getLVChecked(prefslbox,i) then
        <some code>
      end if
   end for

maybe its already fixed since 0.57.9   *shrug*
  ----- Original Message -----=20
  From: tone.skoda at gmx.net=20
  To: EUforum=20
  Sent: Friday, October 11, 2002 1:32 AM
  Subject: Re: ListViews in Win32Lib



  Hi,
  =20
  You can use my funciton ListView_SetCheckState ():
  =20
  --/*
  -- shift_left [Created on 30. December 2001, 07:16]
  -- The 'shift_left' function does same thing as C's <<.
  --
  -- PARAMETERS
  -- 'x'
  --    .
  -- 'count'
  --    ?.
  --
  -- RETURN VALUES
  -- ?.
  --
  -- ALGORITHM
  -- (WORD (a)) | ((DWORD) ((WORD) (b))) << 16
  --*/
  global function shift_left (atom x, integer count)
    return x * power (2, count) =20
  end function
  =20
  --/*
  -- ListView_SetItemState [Created on 22. July 2002, 05:33]
  -- The 'ListView_SetItemState' procedure sets various attributes
  -- to listview item.
  --
  -- PARAMETERS
  -- 'listview'
  --    .
  -- 'item_row'
  --    .
  -- 'data'
  --    .
  -- 'mask'
  --    .
  --*/
  global procedure ListView_SetItemState (integer listview, integer =
item_row,=20
      atom data, atom mask)
      atom LV_ITEM
      LV_ITEM =3D struct_LVITEM(0, 0,
          0, data, mask,=20
          0, 0, 0)
      Void =3D sendMessage (listview, LVM_SETITEMSTATE, item_row - 1, =
LV_ITEM)
      release_mem(LV_ITEM)
  end procedure
  =20
  --/*
  -- ListView_SetCheckState [Created on 22. July 2002, 05:30]
  -- The 'ListView_SetCheckState' procedure checks or unchecks
  -- checkbox which is besides listview item.
  --
  -- PARAMETERS
  -- 'listview'
  --    win32lib id of listview window.
  -- 'item_row'
  --    row at which is item in listview currently
  -- 'state'
  --    true or false.
  --*/
  global procedure ListView_SetCheckState (integer listview, integer =
item_row, integer state)
      ListView_SetItemState (listview, item_row, shift_left (state + 1, =
12), LVIS_STATEIMAGEMASK)
  end procedure
    ----- Original Message -----=20
    From: robsz1 at netzero.net=20
    To: EUforum=20
    Sent: Friday, October 11, 2002 5:07 AM
    Subject: ListViews in Win32Lib



    Hello list.

    I am using Win32Lib v 0.57.9 and have a question.

    I have a ListView(Report style) with checkboxes.

    Does anyone know how i can tell it to check item # x ?

    thanks in advance,
        Robert Szalay




------=_NextPart_000_0046_01C270CA.F0010AA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Ive been waiting what seems forever for =
te=20
response.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>It took somewhere around 1 1/2 hrs for =
my email to=20
make it to topica and back.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I thought&nbsp;I was going to =
croak&nbsp;=20
:P</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>also..&nbsp; Derek..</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think there might just be an error in =
win32lib=20
with listviews</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I was using getLVAllChecked() and it =
returned the=20
checked items&nbsp; except..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Item # 1 wasnt even included and the =
last thing in=20
the returned sequence was -1</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have resorted to..</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; lvcount =3D=20
getLVCount(prefslbox)<BR>&nbsp;&nbsp; for i =3D 0 to lvcount-1=20
do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if getLVChecked(prefslbox,i)=20
then<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;some =
code&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end =

if<BR>&nbsp;&nbsp; end for</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>maybe its already fixed since =
0.57.9&nbsp;&nbsp;=20
*shrug*</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:tone.skoda at gmx.net"=20
  title=3Dtone.skoda at gmx.net>tone.skoda at gmx.net</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:EUforum at topica.com"=20
  title=3DEUforum at topica.com>EUforum</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, October 11, 2002 =
1:32=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: ListViews in =
Win32Lib</DIV>
  <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria =
Mailing List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
</PRE>
  <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>You can use my funciton =
ListView_SetCheckState=20
  ():</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>--/*<BR>-- shift_left [Created on 30. =
December=20
  2001, 07:16]<BR>-- The 'shift_left' function does same thing as C's=20
  &lt;&lt;.<BR>--<BR>-- PARAMETERS<BR>-- 'x'<BR>--&nbsp;&nbsp;&nbsp; =
.<BR>--=20
  'count'<BR>--&nbsp;&nbsp;&nbsp; ?.<BR>--<BR>-- RETURN VALUES<BR>--=20
  ?.<BR>--<BR>-- ALGORITHM<BR>-- (WORD (a)) | ((DWORD) ((WORD) (b))) =
&lt;&lt;=20
  16<BR>--*/<BR>global function shift_left (atom x, integer =
count)<BR>&nbsp;=20
  return x * power (2, count)&nbsp; <BR>end function</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>--/*<BR>-- ListView_SetItemState =
[Created on 22.=20
  July 2002, 05:33]<BR>-- The 'ListView_SetItemState' procedure sets =
various=20
  attributes<BR>-- to listview item.<BR>--<BR>-- PARAMETERS<BR>--=20
  'listview'<BR>--&nbsp;&nbsp;&nbsp; .<BR>-- =
'item_row'<BR>--&nbsp;&nbsp;&nbsp;=20
  .<BR>-- 'data'<BR>--&nbsp;&nbsp;&nbsp; .<BR>-- =
'mask'<BR>--&nbsp;&nbsp;&nbsp;=20
  .<BR>--*/<BR>global procedure ListView_SetItemState (integer listview, =
integer=20
  item_row, <BR>&nbsp;&nbsp;&nbsp; atom data, atom =
mask)<BR>&nbsp;&nbsp;&nbsp;=20
  atom LV_ITEM<BR>&nbsp;&nbsp;&nbsp; LV_ITEM =3D struct_LVITEM(0,=20
  0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, data, mask,=20
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, 0, =
0)<BR>&nbsp;&nbsp;&nbsp;=20
  Void =3D sendMessage (listview, LVM_SETITEMSTATE, item_row - 1,=20
  LV_ITEM)<BR>&nbsp;&nbsp;&nbsp; release_mem(LV_ITEM)<BR>end=20
  procedure</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>--/*<BR>-- ListView_SetCheckState =
[Created on 22.=20
  July 2002, 05:30]<BR>-- The 'ListView_SetCheckState' procedure checks =
or=20
  unchecks<BR>-- checkbox which is besides listview item.<BR>--<BR>--=20
  PARAMETERS<BR>-- 'listview'<BR>--&nbsp;&nbsp;&nbsp; win32lib id of =
listview=20
  window.<BR>-- 'item_row'<BR>--&nbsp;&nbsp;&nbsp; row at which is item =
in=20
  listview currently<BR>-- 'state'<BR>--&nbsp;&nbsp;&nbsp; true or=20
  false.<BR>--*/<BR>global procedure ListView_SetCheckState (integer =
listview,=20
  integer item_row, integer state)<BR>&nbsp;&nbsp;&nbsp; =
ListView_SetItemState=20
  (listview, item_row, shift_left (state + 1, 12), =
LVIS_STATEIMAGEMASK)<BR>end=20
  procedure</FONT></DIV>
  <BLOCKQUOTE dir=3Dltr=20
  style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
    <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV=20
    style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
    <A href=3D"mailto:robsz1 at netzero.net"=20
    title=3Drobsz1 at netzero.net>robsz1 at netzero.net</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:EUforum at topica.com"=20
    title=3DEUforum at topica.com>EUforum</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, October 11, =
2002 5:07=20
    AM</DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> ListViews in =
Win32Lib</DIV>
    <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The =
Euphoria Mailing List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
</PRE>
    <DIV><FONT face=3DArial size=3D2>Hello list.</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>I am using Win32Lib v 0.57.9 and =
have a=20
    question.</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>I have a ListView(Report style) =
with=20
    checkboxes.</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Does anyone know how i can tell it =
to check=20
    item # x ?</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>thanks in advance,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Robert=20
  =
Szalay</FONT></DIV></BLOCKQUOTE><PRE>=3D=3D^=3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
This email was sent to: robsz1 at netzero.net

EASY UNSUBSCRIBE click here: <A =
href=3D"http://topica.com/u/?b1dd66.b3fcPV">http://topica.com/u/?b1dd66.b=
3fcPV</A>
Or send an email to: EUforum-unsubscribe at topica.com

T O P I C A -- Register now to manage your mail!
<A =
href=3D"http://www.topica.com/partner/tag02/register">http://www.topica.c=
om/partner/tag02/register</A>
=3D=3D^=3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

------=_NextPart_000_0046_01C270CA.F0010AA0--

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu