sub save_STC_values{ my ( $this ) = @_; # TODO: check, if the file has changed - if not, do nothing print "save file...\n"; my $STC = $this->FindWindow(Wx::XmlResource::GetXRCID('STC_edit')); my $tmp_path = Win32::GetFullPathName( File::Spec->catfile($recent_nb, $recent_page) ); my %H_cur_data; my $stc_content = $STC->GetText(); my @A_stc_content = split("\n", $stc_content); my @A_new_stc_content; my $line_counter = 1; # TODO: find all data from "this" file in DB and remove them! foreach my $cur_line( @A_stc_content ){ my $sorted_line = BT_Parse_Line::parse_line( $cur_line, \%H_cur_data, $H_cfgs ); if( $sorted_line){ push( @A_new_stc_content, $sorted_line ); DB_WorkOn::check_linedata( \%H_cur_data, $line_counter, $tmp_path ); DB_WorkOn::insert_linedata( \%H_cur_data, $line_counter, $tmp_path ); } else{ push( @A_new_stc_content, ""); } $line_counter++; } $STC->SetText(''); $STC->SetText(join("\n", @A_new_stc_content)."\n"); print $STC->GetCodePage()."\n"; $STC->SaveFile( $tmp_path ); get_classifications_from_db(); }