[opendemo-cvs] CVS: opendemo/tools/odcut OdGui.pm,1.2,1.3
Status: Beta
Brought to you by:
girlich
From: Uwe G. <gi...@us...> - 2005-02-08 20:23:12
|
Update of /cvsroot/opendemo/opendemo/tools/odcut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12753 Modified Files: OdGui.pm Log Message: selection of a single file cell will result in the full file line to be selected. Index: OdGui.pm =================================================================== RCS file: /cvsroot/opendemo/opendemo/tools/odcut/OdGui.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OdGui.pm 8 Feb 2005 19:11:45 -0000 1.2 --- OdGui.pm 8 Feb 2005 20:22:43 -0000 1.3 *************** *** 9,13 **** use base qw(OdGuiFrame); use Wx qw(wxOPEN wxMULTIPLE wxID_CANCEL); ! use Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT_MENU); use Cwd qw(getcwd); use File::Basename qw(fileparse); --- 9,13 ---- use base qw(OdGuiFrame); use Wx qw(wxOPEN wxMULTIPLE wxID_CANCEL); ! use Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT_GRID_SELECT_CELL EVT_MENU); use Cwd qw(getcwd); use File::Basename qw(fileparse); *************** *** 42,45 **** --- 42,46 ---- EVT_BUTTON($self,$self->{fileClose},\&OnFileClose); + EVT_GRID_SELECT_CELL($self->{gridFiles},\&OnSelectFileCell); # Give a positive result. *************** *** 106,118 **** my ($self) = @_; my $grid = $self->{gridFiles}; my @rows = $grid->GetSelectedRows(); if (@rows) { - my @files; foreach my $row (@rows) { ! printf STDERR "row %d\n", $row; ! push @files, $grid->GetCellValue($row,0); } ! foreach my $file (@files) { ! printf STDERR "close file: %s\n", $file; # close the desired file --- 107,121 ---- my ($self) = @_; my $grid = $self->{gridFiles}; + my %files; my @rows = $grid->GetSelectedRows(); if (@rows) { foreach my $row (@rows) { ! # printf STDERR "row %d\n", $row; ! $files{$grid->GetCellValue($row,0)} = 1; } ! } ! if (%files) { ! foreach my $file (keys %files) { ! # printf STDERR "close file: %s\n", $file; # close the desired file *************** *** 122,130 **** } else { ! printf STDERR "nothing selected\n"; } } sub do_command($$) { --- 125,143 ---- } else { ! # printf STDERR "nothing selected\n"; } } + sub OnSelectFileCell($$) + { + my ($grid, $event) = @_; + my $row = $event->GetRow(); + # printf STDERR "got row $row\n"; + $grid->SelectRow($row, 0); + } + + + sub do_command($$) { *************** *** 141,145 **** my $self = shift; ! print STDERR "UpdateGUI stub\n"; my $grid = $self->{gridFiles}; --- 154,158 ---- my $self = shift; ! # print STDERR "UpdateGUI stub\n"; my $grid = $self->{gridFiles}; |