NCBI C++ Toolkit Cross Reference

  C++/src/gui/widgets/loaders/bam_coverage_graph_panel.cpp


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622
/* $Id: bam_coverage_graph_panel.cpp 33145 2015-06-03 21:59:31Z evgeniev $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * Authors: Liangshou Wu */ // Generated by DialogBlocks (unregistered), 02/03/2011 09:12:09 #include <ncbi_pch.hpp> #include <gui/widgets/loaders/bam_coverage_graph_panel.hpp> #include <gui/widgets/wx/wx_utils.hpp> #include <corelib/ncbifile.hpp> #include <wx/dirdlg.h> #include <wx/filename.h> #include <wx/checkbox.h> #include <wx/radiobut.h> #include <wx/sizer.h> #include <wx/stattext.h> #include <wx/statbox.h> #include <wx/button.h> #include <wx/msgdlg.h> #include <wx/textctrl.h> #include <wx/filedlg.h> #include <gui/widgets/loaders/assembly_sel_panel.hpp> #include <sra/readers/bam/bamread.hpp> ////@begin XPM images ////@end XPM images BEGIN_NCBI_SCOPE USING_SCOPE(objects); /*! * CBamCoverageGraphPanel type definition */ IMPLEMENT_DYNAMIC_CLASS( CBamCoverageGraphPanel, wxPanel ) /*! * CBamCoverageGraphPanel event table definition */ BEGIN_EVENT_TABLE( CBamCoverageGraphPanel, wxPanel ) ////@begin CBamCoverageGraphPanel event table entries EVT_RADIOBUTTON( ID_AUTOGEN, CBamCoverageGraphPanel::OnAutogenSelected ) EVT_CHECKBOX( ID_SAVETO, CBamCoverageGraphPanel::OnSavetoClick ) EVT_BUTTON( ID_CHANGEBUTTON, CBamCoverageGraphPanel::OnChangebuttonClick ) EVT_RADIOBUTTON( ID_MANUALSELECT, CBamCoverageGraphPanel::OnManualselectSelected ) EVT_BUTTON( ID_BROWSEBUTTON, CBamCoverageGraphPanel::OnBrowsebuttonClick ) ////@end CBamCoverageGraphPanel event table entries END_EVENT_TABLE() /*! * CBamCoverageGraphPanel constructors */ CBamCoverageGraphPanel::CBamCoverageGraphPanel() { Init(); } CBamCoverageGraphPanel::CBamCoverageGraphPanel( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { Init(); Create(parent, id, caption, pos, size, style); } /*! * CBamCoverageGraphPanel creator */ bool CBamCoverageGraphPanel::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin CBamCoverageGraphPanel creation SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY); wxPanel::Create( parent, id, pos, size, style ); CreateControls(); if (GetSizer()) { GetSizer()->SetSizeHints(this); } Centre(); ////@end CBamCoverageGraphPanel creation return true; } /*! * CBamCoverageGraphPanel destructor */ CBamCoverageGraphPanel::~CBamCoverageGraphPanel() { ////@begin CBamCoverageGraphPanel destruction ////@end CBamCoverageGraphPanel destruction } /*! * Member initialisation */ void CBamCoverageGraphPanel::Init() { ////@begin CBamCoverageGraphPanel member initialisation m_AutoGenRadio = NULL; m_AutoGenBox = NULL; m_BinSize = NULL; m_SaveTo = NULL; m_SaveToBox = NULL; m_SaveLocationBox = NULL; m_ManualSelectRadio = NULL; m_ManualSelectBox = NULL; m_GraphFileBox = NULL; m_BamAssembly = NULL; m_AssemblyPanel = NULL; ////@end CBamCoverageGraphPanel member initialisation } /*! * Control creation for CBamCoverageGraphPanel */ // Fix Solaris/DialogBlocks issue #ifndef _T #define _T wxT #endif void CBamCoverageGraphPanel::CreateControls() { ////@begin CBamCoverageGraphPanel content construction CBamCoverageGraphPanel* itemPanel1 = this; wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemPanel1->SetSizer(itemBoxSizer2); wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemPanel1, wxID_ANY, _("Coverage graph options")); wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL); itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxGROW|wxALL, 5); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); itemStaticBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5); m_AutoGenRadio = new wxRadioButton( itemPanel1, ID_AUTOGEN, _("Generate a graph automatically"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_AutoGenRadio->SetValue(true); itemStaticBoxSizer3->Add(m_AutoGenRadio, 0, wxALIGN_LEFT|wxALL, 5); m_AutoGenBox = new wxPanel( itemPanel1, ID_PANEL5, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer3->Add(m_AutoGenBox, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL); m_AutoGenBox->SetSizer(itemBoxSizer7); wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer7->Add(itemBoxSizer8, 0, wxALIGN_LEFT|wxRIGHT, 5); itemBoxSizer8->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxStaticText* itemStaticText10 = new wxStaticText( m_AutoGenBox, wxID_STATIC, _("Graph bin size (bases):"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer8->Add(itemStaticText10, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); m_BinSize = new wxSpinCtrl( m_AutoGenBox, ID_SPINCTRL, _T("1000"), wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, 1, 1000000, 1000 ); itemBoxSizer8->Add(m_BinSize, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); itemBoxSizer8->Add(20, 5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); m_SaveTo = new wxCheckBox( m_AutoGenBox, ID_SAVETO, _("Save Graph"), wxDefaultPosition, wxDefaultSize, 0 ); m_SaveTo->SetValue(false); itemBoxSizer8->Add(m_SaveTo, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); m_SaveToBox = new wxPanel( m_AutoGenBox, ID_PANEL6, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemBoxSizer7->Add(m_SaveToBox, 0, wxGROW|wxBOTTOM, 5); wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxHORIZONTAL); m_SaveToBox->SetSizer(itemBoxSizer15); itemBoxSizer15->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText17 = new wxStaticText( m_SaveToBox, wxID_STATIC, _("Save as"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer15->Add(itemStaticText17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_SaveLocationBox = new wxTextCtrl( m_SaveToBox, ID_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(185, -1), 0 ); itemBoxSizer15->Add(m_SaveLocationBox, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5); wxButton* itemButton19 = new wxButton( m_SaveToBox, ID_CHANGEBUTTON, _("Change"), wxDefaultPosition, wxSize(70, -1), 0 ); itemBoxSizer15->Add(itemButton19, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); m_ManualSelectRadio = new wxRadioButton( itemPanel1, ID_MANUALSELECT, _("Use existing graph files"), wxDefaultPosition, wxDefaultSize, 0 ); m_ManualSelectRadio->SetValue(false); itemStaticBoxSizer3->Add(m_ManualSelectRadio, 0, wxALIGN_LEFT|wxALL, 5); m_ManualSelectBox = new wxPanel( itemPanel1, ID_PANEL4, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer3->Add(m_ManualSelectBox, 0, wxGROW|wxLEFT|wxRIGHT, 5); wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxHORIZONTAL); m_ManualSelectBox->SetSizer(itemBoxSizer22); itemBoxSizer22->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText24 = new wxStaticText( m_ManualSelectBox, wxID_STATIC, _("File:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer22->Add(itemStaticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_GraphFileBox = new wxTextCtrl( m_ManualSelectBox, ID_TEXTCTRL8, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 ); itemBoxSizer22->Add(m_GraphFileBox, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton26 = new wxButton( m_ManualSelectBox, ID_BROWSEBUTTON, _("Browse"), wxDefaultPosition, wxSize(70, -1), 0 ); itemBoxSizer22->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); itemStaticBoxSizer3->Add(itemBoxSizer27, 0, wxGROW|wxALL, 5); wxStaticBox* itemStaticBoxSizer28Static = new wxStaticBox(itemPanel1, wxID_ANY, _("BAM File Assembly Identifier")); wxStaticBoxSizer* itemStaticBoxSizer28 = new wxStaticBoxSizer(itemStaticBoxSizer28Static, wxVERTICAL); itemBoxSizer27->Add(itemStaticBoxSizer28, 0, wxALIGN_TOP|wxALL, 5); m_BamAssembly = new wxStaticText( itemPanel1, wxID_STATIC, _("N/A"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT|wxSTATIC_BORDER ); itemStaticBoxSizer28->Add(m_BamAssembly, 0, wxGROW|wxALL, 5); m_AssemblyPanel = new CAssemblySelPanel( itemPanel1, ID_PANEL9, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemBoxSizer27->Add(m_AssemblyPanel, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); ////@end CBamCoverageGraphPanel content construction m_ManualSelectBox->Enable(false); m_SaveToBox->Hide(); } void CBamCoverageGraphPanel::SetBamFiles(const set<string>& bam_files) { if (bam_files.empty()) return; wxBusyCursor wait; m_BamFiles = bam_files; wxString def_graph_file = ToWxString(*bam_files.begin()) + wxT(".graph"); wxString def_path; wxFileName::SplitPath(def_graph_file, &def_path, NULL, NULL); bool single_input = m_BamFiles.size() == 1; if (m_GraphFileBox) { if (single_input) { m_GraphFileBox->SetValue(def_graph_file); } else { m_GraphFileBox->SetValue(def_path); } } if (m_SaveLocationBox) { if (single_input) { m_SaveLocationBox->SetValue(def_graph_file); } else { m_SaveLocationBox->SetValue(def_path); } } bool has_graph_files = true; ITERATE (set<string>, iter, m_BamFiles) { string graph_file = *iter + ".graph"; if ( !CFile(graph_file).Exists() ) { has_graph_files = false; break; } } if (has_graph_files) { m_ManualSelectRadio->SetValue(true); m_ManualSelectBox->Enable(true); m_AutoGenRadio->SetValue(false); m_AutoGenBox->Enable(false); } string bamAssembly; for (set<string>::const_iterator iter = m_BamFiles.begin(); bamAssembly.empty() && iter != m_BamFiles.end(); ++iter) { try { CBamMgr mgr; CBamDb db(mgr, *iter); string header = db.GetHeaderText(); if (header.empty()) continue; list<string> lines; NStr::Split(header, "\n\r", lines); for (list<string>::const_iterator it = lines.begin(); bamAssembly.empty() && it != lines.end(); ++it) { if (it->size() > 3 && it->substr(0, 3) == "@SQ") { list<string> fields; NStr::Split(*it, "\t", fields); ITERATE (list<string>, it2, fields) { if (it2->size() > 3 && it2->substr(0, 3) == "AS:") { bamAssembly = it2->substr(3); break; } } } } } catch (const exception&) { } } if (!bamAssembly.empty()) { wxString str = ToWxString(bamAssembly); m_BamAssembly->SetLabel(str); m_BamAssembly->SetToolTip(str); } else { m_BamAssembly->SetLabel(wxT("N/A")); m_BamAssembly->SetToolTip(wxEmptyString); } } string CBamCoverageGraphPanel::GetGraphFile(const string& bam_file) const { return ToStdString(GetGraphFile_wx(bam_file)); } wxString CBamCoverageGraphPanel::GetGraphFile_wx(const string& bam_file) const { bool single_input = m_BamFiles.size() == 1; if (m_ManualSelectRadio->GetValue()) { if (single_input) { return m_GraphFileBox->GetValue(); } else { string base, ext; CDirEntry::SplitPath(bam_file, NULL, &base, &ext); wxString graph_file = m_GraphFileBox->GetValue(); graph_file += wxFileName::GetPathSeparator(); graph_file += ToWxString(base + ext + ".graph"); return graph_file; } } else if (m_SaveTo->GetValue()) { if (single_input) { return m_SaveLocationBox->GetValue(); } else { string base, ext; CDirEntry::SplitPath(bam_file, NULL, &base, &ext); wxString graph_file = m_SaveLocationBox->GetValue(); graph_file += wxFileName::GetPathSeparator(); graph_file += ToWxString(base + ext + ".graph"); return graph_file; } } return wxString(wxT("")); } int CBamCoverageGraphPanel::GetGraphBinSize() const { return m_BinSize->GetValue(); } #define GRAPH_FILE_ERR "BAM Coverage Graph - error in input" bool CBamCoverageGraphPanel::IsInputValid() { bool valid = true; set<string>::const_iterator iter = m_BamFiles.begin(); bool single_input = m_BamFiles.size() == 1; bool remove_existing_files = false; while (valid && iter != m_BamFiles.end()) { wxString graph_file = GetGraphFile_wx(*iter); if (m_ManualSelectRadio->GetValue()) { if ( !wxFileExists(graph_file) ) { wxString err_msg; if (single_input) { err_msg = wxT("The selected file doesn't exist! File: "); err_msg += graph_file; } else { err_msg = wxT("Not all Bam files have a graph file under the selected folder: "); err_msg += m_GraphFileBox->GetValue(); } wxMessageBox(err_msg, wxT(GRAPH_FILE_ERR), wxOK | wxICON_ERROR, this); valid = false; } } else if ( !graph_file.IsEmpty() ) { // make sure the folder exists and writable; wxString path; wxFileName::SplitPath(graph_file, &path, NULL, NULL); if ( !wxDirExists(path) ) { wxString err_msg = wxT("The input directory doesn't exist! File: "); err_msg += path; wxMessageBox(err_msg, wxT(GRAPH_FILE_ERR), wxOK | wxICON_ERROR, this); valid = false; } else if ( !wxFileName::IsDirWritable(path) ) { wxString err_msg = wxT("No write permission to the input directory: "); err_msg += path; wxMessageBox(err_msg, wxT(GRAPH_FILE_ERR), wxOK | wxICON_ERROR, this); valid = false; } else if (wxFileExists(graph_file)) { if ( !remove_existing_files ) { // make sure user really wants to overwrite an existing file wxString err_msg; if (single_input) { err_msg = wxT("The input file already exists. Really want to overwrite it? File: "); err_msg += graph_file; } else { err_msg = wxT("Graph files for some Bam files already exist under the selected folder: "); err_msg += path; err_msg += wxT(". Really want to overwrite them?"); } int res = wxMessageBox(err_msg, wxT(GRAPH_FILE_ERR), wxYES_NO | wxICON_EXCLAMATION, this); valid = (res == wxYES); remove_existing_files = valid; } if (remove_existing_files) { // delete the file wxRemoveFile(graph_file); } } } if (!valid) { break; } ++iter; } if (!valid) return false; return m_AssemblyPanel->TransferDataFromWindow(); } /*! * Should we show tooltips? */ bool CBamCoverageGraphPanel::ShowToolTips() { return true; } /*! * Get bitmap resources */ wxBitmap CBamCoverageGraphPanel::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin CBamCoverageGraphPanel bitmap retrieval wxUnusedVar(name); return wxNullBitmap; ////@end CBamCoverageGraphPanel bitmap retrieval } /*! * Get icon resources */ wxIcon CBamCoverageGraphPanel::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin CBamCoverageGraphPanel icon retrieval wxUnusedVar(name); return wxNullIcon; ////@end CBamCoverageGraphPanel icon retrieval } /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSEBUTTON */ void CBamCoverageGraphPanel::OnBrowsebuttonClick( wxCommandEvent& event ) { wxString old_path = m_GraphFileBox->GetValue(); wxString def_path; wxFileName::SplitPath(old_path, &def_path, NULL, NULL); if (m_BamFiles.size() == 1) { wxFileDialog dlg(this, wxT("Select a BAM coverage graph file"), def_path, wxT(""), wxT("Graph files (") wxALL_FILES_PATTERN wxT(")|") wxALL_FILES_PATTERN, wxFD_OPEN); if (dlg.ShowModal() == wxID_OK) { m_GraphFileBox->SetValue(dlg.GetPath()); } } else { wxDirDialog dlg(this, wxT("Select the folder all graph files reside"), def_path, wxDD_DIR_MUST_EXIST); if (dlg.ShowModal() == wxID_OK) { m_GraphFileBox->SetValue(dlg.GetPath()); } } } /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CHANGEBUTTON */ void CBamCoverageGraphPanel::OnChangebuttonClick( wxCommandEvent& event ) { wxString old_path = m_SaveLocationBox->GetValue(); wxString def_path; wxFileName::SplitPath(old_path, &def_path, NULL, NULL); if (m_BamFiles.size() == 1) { wxFileDialog dlg(this, wxT("Select a folder and input a file name to save coverage graph"), def_path); if (dlg.ShowModal() == wxID_OK) { m_SaveLocationBox->SetValue(dlg.GetPath()); } } else { wxDirDialog dlg(this, wxT("Choose an existing folder to save graph files"), def_path, wxDD_DIR_MUST_EXIST); if (dlg.ShowModal() == wxID_OK) { m_SaveLocationBox->SetValue(dlg.GetPath()); } } } /*! * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_MANUALSELECT */ void CBamCoverageGraphPanel::OnManualselectSelected( wxCommandEvent& event ) { m_AutoGenBox->Enable(false); m_ManualSelectBox->Enable(true); } /*! * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_AUTOGEN */ void CBamCoverageGraphPanel::OnAutogenSelected( wxCommandEvent& event ) { m_ManualSelectBox->Enable(false); m_AutoGenBox->Enable(true); } /*! * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_SAVETO */ void CBamCoverageGraphPanel::OnSavetoClick( wxCommandEvent& event ) { if (m_SaveTo->GetValue()) { m_SaveToBox->Show(true); } else { m_SaveToBox->Hide(); } Layout(); } static const char* kMappingAssembly = ".MapAssembly"; void CBamCoverageGraphPanel::LoadSettings() { if( ! m_RegPath.empty()) { CGuiRegistry& gui_reg = CGuiRegistry::GetInstance(); CGuiRegistry::TReadView view = gui_reg.GetReadView(m_RegPath + kMappingAssembly); m_AssemblyPanel->GetData().LoadSettings(view); } } void CBamCoverageGraphPanel::SaveSettings() const { if ( !m_RegPath.empty() ) { CGuiRegistry& gui_reg = CGuiRegistry::GetInstance(); CGuiRegistry::TReadWriteView view = gui_reg.GetReadWriteView(m_RegPath + kMappingAssembly); m_AssemblyPanel->GetData().SaveSettings(view); } } END_NCBI_SCOPE

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.