| 655 | } |
| 656 | |
| 657 | bool cr3view::LoadDocument( const wxString & fname ) |
| 658 | { |
| 659 | //printf("cr3view::LoadDocument()\n"); |
| 660 | _renderTimer->Stop(); |
| 661 | _clockTimer->Stop(); |
| 662 | CloseDocument(); |
| 663 | |
| 664 | wxCursor hg( wxCURSOR_WAIT ); |
| 665 | this->SetCursor( hg ); |
| 666 | wxSetCursor( hg ); |
| 667 | //=========================================== |
| 668 | GetParent()->Update(); |
| 669 | //printf(" loading... "); |
| 670 | bool res = getDocView()->LoadDocument( fname.c_str() ); |
| 671 | //printf(" done. \n"); |
| 672 | //DEBUG |
| 673 | //_docview->exportWolFile( "test.wol", true ); |
| 674 | //_docview->SetPos(0); |
| 675 | if ( !res ) |
| 676 | getDocView()->createDefaultDocument(lString16(L"File open error"), lString16(L"Cannot open file ") + fname.c_str() ); |
| 677 | lString16 title = getDocView()->getAuthors(); |
| 678 | if ( !title.empty() && !getDocView()->getTitle().empty() ) |
| 679 | title << L". "; |
| 680 | title << getDocView()->getTitle(); |
| 681 | GetParent()->SetLabel( wxString( title.c_str() ) ); |
| 682 | |
| 683 | //UpdateScrollBar(); |
| 684 | _firstRender = true; |
| 685 | _allowRender = false; |
| 686 | ScheduleRender(); |
| 687 | //_docview->restorePosition(); |
| 688 | //_docview->Render(); |
| 689 | //UpdateScrollBar(); |
| 690 | //Paint(); |
| 691 | GetParent()->SetFocus(); |
| 692 | //=========================================== |
| 693 | wxSetCursor( wxNullCursor ); |
| 694 | this->SetCursor( wxNullCursor ); |
| 695 | return res; |
| 696 | } |
| 697 | |
| 698 | void cr3view::goToBookmark(ldomXPointer bm) |
| 699 | { |
no test coverage detected