Re: [perl-win32-gui] Capturing ListView Clicks
Thanks ... I think that solved the problem. Jonathan -- Jonathan Southwick [EMAIL PROTECTED] Technical and Network Services Allegheny College Meadville, PA 16335 814-332-2755 - Original Message - From: "Anthony George" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, April 25, 2000 10:21 AM Subject: Re: [perl-win32-gui] Capturing ListView Clicks > If you're trying to pass a reference to SortListItem, it should be with a \ > i.e. &SortListItem(\%data,\%sortonly); > > >tony >
Re: [perl-win32-gui] Capturing ListView Clicks
If you're trying to pass a reference to SortListItem, it should be with a \ i.e. &SortListItem(\%data,\%sortonly); >tony Jonathan Southwick wrote: > Cam, > > Okay I am getting this to almost work. However I get an error on this line in the >code you gave: > > &SortListItem(/%data,/%sortonly); > > ### the code ### > sub ListView_ColumnClick > > my $col = shift; > print "You click on column number $col\n"; > my %sortonly = &NewList($col,%data); ## %data is a global variable > &SortListItem(/%data,/%sortonly); > } > > If I take out the '/' before the %data and the %sortonly then in the SortListItem >subroutine the variable $check is NULL > and so $check always goes to the sort number part of the routine. What obvious >thing am I doing wrong? > > ### the code ### > sub SortListItem { > my ($data,$sortonly,$section) = @_; > my $check; > my %data = %$data; > my %sortonly = %$sortonly; > > $check .= "$_" foreach (values %sortonly); ## Merge all values into 1 string > > if ($check =~ /[a-z]|[A-Z]/g) { ##--> Compare Num or by Char depending in >%sortonly values > print "Text Compare!\n"; > foreach (sort { $sortonly{$a} cmp $sortonly{$b} } keys %sortonly) { > ## Code in here needs to clear the current View > ## and then add items all over again. Just like > ## you did when you first created it > ## Use the keys that are stored in $_, but get the values > ## from the original hash(in this case %data) > } > } else { > print "Number Compare\n"; > foreach (sort { $sortonly{$b} <=> $sortonly{$a} } keys %sortonly) { > ## Code in here needs to clear the current View > ## and then add items all over again. Just like > ## you did when you first created it. > ## Use the keys that are stored in $_, but get the values > ## from the original hash(in this case %data) > } > } > } > > Jonathan > -- > Jonathan Southwick [EMAIL PROTECTED] > Technical and Network Services > Allegheny College > Meadville, PA 16335 814-332-2755 begin:vcard n:George;Anthony tel;pager:(231) 315-4709 tel;cell:(231) 730-2863 tel;fax:(231) 720-1681 tel;work:(231) 720-1481 x-mozilla-html:TRUE url:http://www.emsts.com org:EMS Technical Services adr:;;965 Fork;Muskegon;MI;49442;USA version:2.1 email;internet:[EMAIL PROTECTED] title:Systems Engineer fn:Anthony C. George end:vcard
Re: [perl-win32-gui] Capturing ListView Clicks
Well I figured out how to capture the column click but I don't know how to tell which one was clicked. As far as the sorting goes I think you have to write your own routine to sort the items and write them back to the listview but I could be wrong. To capture the event: sub ListView_ColumnClick { [code in here] } So how do I determine exactly what column was clicked? Jonathan -- Jonathan Southwick [EMAIL PROTECTED] Technical and Network Services Allegheny College Meadville, PA 16335 814-332-2755 - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 24, 2000 11:55 AM Subject: RE: [perl-win32-gui] Capturing ListView Clicks > Hey, if you figure it out, let me know how you get it. I knew at one point > how to capture the column clicks, there is a function there somewhere for > it, I just have to dig it out, I just couldn't figure out how to sort the > items in the list. > Tim Thomas > > -- -- > - > Tim Thomas > Unix Systems Administrator > Lockheed Martin EIS · Denver Data Center > 303-430-2281 > mailto:[EMAIL PROTECTED] > -- -- > - > > > -Original Message- > > From: Jonathan Southwick [SMTP:[EMAIL PROTECTED]] > > Sent: Monday, April 24, 2000 9:55 AM > > To: Perl-Win32-GUI Help > > Subject: [perl-win32-gui] Capturing ListView Clicks > > > > Never mind ... I think figured it out ... > > > > hehe ... I am gonna go try it now! > > > > Jonathan > > -- > > Jonathan Southwick [EMAIL PROTECTED] > > Technical and Network Services > > Allegheny College > > Meadville, PA 16335 814-332-2755 > > > > >
RE: [perl-win32-gui] Capturing ListView Clicks
Hey, if you figure it out, let me know how you get it. I knew at one point how to capture the column clicks, there is a function there somewhere for it, I just have to dig it out, I just couldn't figure out how to sort the items in the list. Tim Thomas - Tim Thomas Unix Systems Administrator Lockheed Martin EIS · Denver Data Center 303-430-2281 mailto:[EMAIL PROTECTED] - > -Original Message- > From: Jonathan Southwick [SMTP:[EMAIL PROTECTED]] > Sent: Monday, April 24, 2000 9:55 AM > To: Perl-Win32-GUI Help > Subject: [perl-win32-gui] Capturing ListView Clicks > > Never mind ... I think figured it out ... > > hehe ... I am gonna go try it now! > > Jonathan > -- > Jonathan Southwick [EMAIL PROTECTED] > Technical and Network Services > Allegheny College > Meadville, PA 16335 814-332-2755 > >