From: Eric H. <Ha...@sw...> - 2002-02-19 22:30:13
|
Peter, I don't think I can help you with any of your problems I'm sorry to = say.=20 I'm especially sorry not to be able to help you with initially setting = checkboxes within a ListView. Don't know how to do that. Was not = something my app needed to do, but I can see how it would be useful. I = can share a couple things I do know howver that might be of interest to = you or someone else: Peter, you already know that you can get the value of the checkbox state = for a row in the ListView using EXAMPLE $row=3D15; $checked=3D$LV->ItemCheck($row); # checkbox state is 0 or 1. This is documented. But, what is not documented is how to get the value of other properties = within the ListView such as -text and -image EXAMPLE $row=3D15; %data =3D $LV->ItemInfo($row,0); $image=3D $data{-image}; # image nbr in image list displayed = at row 15=20 $column1text=3D $data{-text}; # text value in first column of row = 15 =20 %data =3D $LV->ItemInfo($row,1); $column2text=3D $data{-text}; # text value in 2nd column of row 15 You can change the value of a property associated with a row of the = ListView by EXAMPLE $LV->ChangeItem(-item =3D> $row, -image =3D> 1); # display 2nd image = in image list Here is a complete declaration of the ListView and its ImageList: EXAMPLE $B1 =3D new Win32::GUI::Bitmap("deselected.bmp"); # off light $B2 =3D new Win32::GUI::Bitmap("selected.bmp"); # on light $IL =3D new Win32::GUI::ImageList(16, 16, 0, 2, 10); $IL->Add($B1, 0); # image 0 or first image in list $IL->Add($B2, 0); # image 1 or 2nd image in list $LV =3D $W->AddListView( -name =3D> "ListView", -left =3D> 12, -top =3D> 70, -height =3D> 260, -width =3D> 670,=20 ); $LV->View(1); # detailed listing, i.e. columns and rows $LV->SetImageList($IL,1); # enable gridline and checkboxes cabability=20 # fullrowselect defined below, but not activated with SendMessage $LVM_SETEXTENDEDLISTVIEWSTYLE =3D 0x1000 + 54; $LVS_EX_GRIDLINES =3D 0x001; $LVS_EX_FULLROWSELECT =3D 0x020; $LVS_EX_CHECKBOXES =3D 0x004; $LV->SendMessage($LVM_SETEXTENDEDLISTVIEWSTYLE, 0, $LVS_EX_GRIDLINES | $LVS_EX_CHECKBOXES, ); HOW DO YOU KNOW WHAT ROW IN THE LISTVIEW HAS BEEN SELECTED BY THE USER??? EXAMPLE =20 ######################## sub ListView_ItemClick { ######################## $row =3D shift; =20 } Off the subject a little, here is a little trick that is useful to someone = wanting to initially set focus on a text box and have the data highlighted = in replace/overwrite mode.=20 EXAMPLE $DetailSearchTXT->SetFocus(); $DetailSearchTXT->Select(0,length($DetailSearchTXT->Text())); Regards, Eric Hansen Dallas, Texas USA |
From: Jeremy B. <sco...@ya...> - 2002-02-20 01:02:34
|
Or you can simply use: $DetailSearchTXT->SelectAll(); Which will also place the entry into replace/overwrite mode. Jeremy Blonde ----- Original Message ----- From: "Eric Hansen" <Ha...@sw...> To: <per...@li...>; <pko...@me...> Sent: Tuesday, February 19, 2002 2:32 PM Subject: [perl-win32-gui-users] ListView Checkboxes, ImageList, etc. Off the subject a little, here is a little trick that is useful to someone wanting to initially set focus on a text box and have the data highlighted in replace/overwrite mode. EXAMPLE $DetailSearchTXT->SetFocus(); $DetailSearchTXT->Select(0,length($DetailSearchTXT->Text())); Regards, Eric Hansen Dallas, Texas USA _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: NAHUM M. <mar...@re...> - 2002-02-25 10:36:46
|
hye, How can'i refresh a windows ? I try to made a progress bar and i need refresh the window when a new action is do ... Thanks for help ... Marc, |
From: Johan L. <jo...@ba...> - 2002-02-25 11:59:12
|
At 11:32 2002-02-25 +0100, NAHUM Marc wrote: >How can'i refresh a windows ? >I try to made a progress bar and i need refresh the window when a new action >is do ... $win->InvalidateRect(1); will send a WM_PAINT to the window, causing it to be redrawn. The method can also be called on a single control. /J -------- ------ ---- --- -- -- -- - - - - - Johan Lindström Sourcerer @ Boss Casinos jo...@ba... Latest bookmark: "Re (tilly) 6 Code Critique" <http://www.perlmonks.org/index.pl?lastnode_id=133235&node_id=135630> |